Re: How to only get new mail
Changqing Li <[email protected]>
| Newsgroups | gmane.mail.getmail.user |
|---|---|
| Message-ID | <[email protected]> |
On 4/22/19 10:24 PM, Charles Cazabon wrote: > Changqing Li <[email protected]> wrote: >> [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 > Ouch. Note that it's a really bad idea to set allow_root_commands. > >> [options] >> verbose=1 >> # retrieve only new emails >> read_all = false > This should work, and retrieve only previously-unseen mail. > >> but the actual result is that, there is a mail A, it will be retrieved >> everytime crontab run "getmail --getmaildir=/opt/getmail/ --idle INBOX". > There isn't enough information in your message to tell what the problem is for > sure. I'm *guessing* that your parsemail.sh delivery script is erroring out > but still delivering a copy of the message. Since it errors out, getmail will > "remember" that message as previously-unseen, and retrieve it again the next > time it is run. Your guessing is right. This is my problem. Thanks very much. > > To help you, please do the following two things: > > 1) Run getmail from a shell with your usual options plus --dump. Post the > full output of this command. > > 2) Temporarily set `max_messages_per_session` to 1 in your config file's > options section and run getmail from a shell with your usual options plus > --verbose, i.e. by hand rather than from cron. Post the full output of this > command. > > That information should be enough to tell what your problem is. > > Charles -- BRs Sandy(Li Changqing)