Re: Can getmail only poll messages received after some specific date?
Joe <[email protected]> Thu, 2 Jun 2022 14:26:40 +0800
| Newsgroups | gmane.mail.getmail.user |
|---|---|
| Message-ID | <[email protected]> |
Charles, Very appreciate for your profesional answer, that give me a clear view of what getmail can capable of. I'm testing the "retrieve and then remove" method, and see how it works. If that doesn't work well, I'll try another way. Best regards. Joe From: Charles Cazabon Date: 2022-06-01 22:01 To: getmail Subject: Re: Re: Can getmail only poll messages received after some specific date? Joe <[email protected]> wrote: > Thank you very much,Michael. That's a good idea for single account. Michael's idea is one I was going to suggest; Gmail, I believe, treats tags on messages as being IMAP folders, so you can choose to retrieve from a specific folder that doesn't contain your archival mail. > But maybe it is not easy for multiple accounts. > and using a [date] as a setup parameter may be more flexible. Unfortunately there's no way to implement that reliably. getmail doesn't know "the date" of a message -- you can't even really define that. Does it mean when the author wrote the message? Or the value in the Date: header field of the message? Or one of the dates in the Received: headers in the message? Or when the advertised MX for the domain received it? Or when the private internal SMTP destination received it? Or when it was written into a recipient's mailstore? Or when it was first seen by getmail in the IMAP account? getmail would have to retrieve the message to get the Date: header value reliably; many IMAP servers can't provide it. And some messages just won't have a Date: header field, or will have one that cannot be parsed properly. getmail tracks the age of messages it has retrieved based on the time that it first saw them, i.e. the time of first retrieval. This allows it to keep track of "seen" status (to only retrieve new mail), as well as age of messages (to implement deleting retrieved messages X days after retrieval). messages only have to be retrieved once, then getmail will never download them again, if you have read_all set to False. So another way to accomplish this is to have getmail retrieve all your messages and write them into a junk folder that you remove afterwards, then have it go back to fetching only new messages and writing them to the local maildir. If you're really so short on disk space that this isn't practical - mail isn't all that huge - then you can even use a fake MDA or a filter to just have getmail discard the messages entirely. Charles -- ----------------------------------------------------------------------- Charles Cazabon GPL'ed software available at: http://pyropus.ca/software/ ----------------------------------------------------------------------- --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]