How to only get new mail
Changqing Li <[email protected]>
| Newsgroups | gmane.mail.getmail.user |
|---|---|
| Message-ID | <[email protected]> |
Hi, I met a problem about only get new mail, please provide some help, Thanks. I use getmail 4.48.0, and here is my getmail.rc [retriever] type = SimpleIMAPSSLRetriever server = *** port = *** username = *** password = *** mailboxes = ALL [destination] # we configure Patchwork as a "mail delivery agent", in that it will # handle our mails type = MDA_external path = /opt/parsemail.sh allow_root_commands = true [options] verbose=1 # retrieve only new emails read_all = false # do not add a Delivered-To: header field delivered_to = false # do not add a Received: header field received = false And I use crontab to run getmail per 5 minutes by 'getmail --getmaildir=/opt/getmail/ --idle INBOX". I hope to retrieve mail by getmail and the mail send to parsemail.sh to parse. but I only hope to get new mail or maybe get the same mail only one time. but the actual result is that, there is a mail A, it will be retrieved everytime crontab run "getmail --getmaildir=/opt/getmail/ --idle INBOX". so the mail A will be parsed per 5 minutes. but I only want to parse one time. As I thought, the first time, it is new mail, I want to retrieve it. but the second time, I have retrieve it once, it should have been seen, and not been retrieved. but actually, it now work as this. I have read the doc of getmail, it says read_all = false can retrieve only new mails. but it not work as expected. Can you help to point out where I am wrong? Thanks. Should I also add delete = true in the [options] section, in this way, after the mail is retrieved one time and deleted, it will be take as seen, and will no be retrieved in second time? -- BRs Sandy(Li Changqing)