Re: How to only get new mail

Charles Cazabon <[email protected]>
Newsgroups gmane.mail.getmail.user
Message-ID <[email protected]>
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.

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
-- 
-----------------------------------------------------------------------
Charles Cazabon
GPL'ed software available at:               http://pyropus.ca/software/
-----------------------------------------------------------------------
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.