This is the most complex part of the logic, so you should move some of the code into functions.
If you only want the Date header, then ask for just the Date header. (See RFC 3501 Sec 6.4.5 RFC 3501 Sec 6.4.5.)
Depending on the IMAP server implementation, the Date might be stored in a more readily accessible index, and thus faster to retrieve. Also try using the
INTERNALDATE
rather thanBODY[HEADER.FIELDS (DATE)]
to see if it's faster. (The internal date is the time at which the message was introduced into the mailbox, rather than the time at which the sender claims to have sent the message.)
This is the most complex part of the logic, so you should move some of the code into functions.
If you only want the Date header, then ask for just the Date header. (See RFC 3501 Sec 6.4.5.)
Depending on the IMAP server implementation, the Date might be stored in a more readily accessible index, and thus faster to retrieve. Also try using the
INTERNALDATE
rather thanBODY[HEADER.FIELDS (DATE)]
to see if it's faster. (The internal date is the time at which the message was introduced into the mailbox, rather than the time at which the sender claims to have sent the message.)
This is the most complex part of the logic, so you should move some of the code into functions.
If you only want the Date header, then ask for just the Date header. (See RFC 3501 Sec 6.4.5.)
Depending on the IMAP server implementation, the Date might be stored in a more readily accessible index, and thus faster to retrieve. Also try using the
INTERNALDATE
rather thanBODY[HEADER.FIELDS (DATE)]
to see if it's faster. (The internal date is the time at which the message was introduced into the mailbox, rather than the time at which the sender claims to have sent the message.)
Possible bug
Note that the minimum and the average only take into account days when there was mail. Any days with no mail at all are ignored. That may or may not be the intended behaviour.
Possible bug
Note that the minimum and the average only take into account days when there was mail. Any days with no mail at all are ignored. That may or may not be the intended behaviour.
- This is the most complex part of the logic, so you should move some of the code into functions.
This is the most complex part of the logic, so you should move some of the code into functions.
- If you only want the Date header, then ask for just the Date header. (See RFC 3501 Sec 6.4.5 .)
If you only want the Date header, then ask for just the Date header. (See RFC 3501 Sec 6.4.5 .)
Depending on the IMAP server implementation, the Date might be stored in a more readily accessible index, and thus faster to retrieve. Also try using the
INTERNALDATE
rather thanBODY[HEADER.FIELDS (DATE)]
to see if it's faster. (The internal date is the time at which the message was introduced into the mailbox, rather than the time at which the sender claims to have sent the message.)
- This is the most complex part of the logic, so you should move some of the code into functions.
- If you only want the Date header, then ask for just the Date header. (See RFC 3501 Sec 6.4.5 .)
This is the most complex part of the logic, so you should move some of the code into functions.
If you only want the Date header, then ask for just the Date header. (See RFC 3501 Sec 6.4.5 .)
Depending on the IMAP server implementation, the Date might be stored in a more readily accessible index, and thus faster to retrieve. Also try using the
INTERNALDATE
rather thanBODY[HEADER.FIELDS (DATE)]
to see if it's faster. (The internal date is the time at which the message was introduced into the mailbox, rather than the time at which the sender claims to have sent the message.)