Discussion:
incorrect size of mail shown in IMAP folders
Olaf Hering
2018-01-12 13:14:29 UTC
Permalink
The list of mails in INBOX has a "size" field. Once the INBOX is opened,
the size of a mail is "large", likely because the size is set based on
the result of RFC822.SIZE. This is the size of header+body. Once the
mail is opened, the shown size changes to the size of the body.

Why is this inconsistent?

I think 'index_format=' controls how the list of messages is presented.
Mine is set to "%4C %5c %Z %[%d.%m %H:%M] %-15.15L %s".

Olaf
Kevin J. McCarthy
2018-01-12 23:02:56 UTC
Permalink
Post by Olaf Hering
The list of mails in INBOX has a "size" field. Once the INBOX is opened,
the size of a mail is "large", likely because the size is set based on
the result of RFC822.SIZE. This is the size of header+body. Once the
mail is opened, the shown size changes to the size of the body.
Why is this inconsistent?
I think your reasoning above is correct. The RFC822.SIZE includes
headers + body. msg_fetch_header() tries to subtract out the headers,
but it can only do so for the ones it knows about.

Later when the actual message is downloaded, hdr->content->length is set
more accurately.
--
Kevin J. McCarthy
GPG Fingerprint: 8975 A9B3 3AA3 7910 385C 5308 ADEF 7684 8031 6BDA
Olaf Hering
2018-01-15 10:29:22 UTC
Permalink
Post by Kevin J. McCarthy
Later when the actual message is downloaded, hdr->content->length is set
more accurately.
Is it accurate that the size is actually just the body?
What is the benefit of size==body, vs. size==header+body?

Olaf
Arnt Gulbrandsen
2018-01-15 10:44:58 UTC
Permalink
Post by Olaf Hering
Is it accurate that the size is actually just the body?
What is the benefit of size==body, vs. size==header+body?
Perhaps it's more helpful to look at whether it's informational rather than
accurate.

If the body is big, then header+body is effectively the same as body.

If the body is small, then half the information conveyed by header+body is
whether the sender uses DKIM, whether the recipient uses a complex setup
with several MTAs and filters each adding Received fields, and other
factors that add voluminous header fields. These are properties of the
sender and/or receiver, not of the message. Size==body filters out this and
says something purely about the message.

Arnt

Loading...