[prev in list] [next in list] [prev in thread] [next in thread] 

List:       getmail
Subject:    Re: Configuring getmail to delete messages or read only new
From:       "Charles Cazabon" <search-web-for-address () pyropus ! ca>
Date:       2009-08-21 4:21:55
Message-ID: 20090821042155.GA10143 () pyropus ! ca
[Download RAW message or body]

Erik Myllymaki <erik.myllymaki@gmail.com> wrote:
> Stephen Allen wrote:
> >
> >I'm only a new user to getmail so please forgive me if my answer is a
> >bit basic - but at least I'm trying to take the load off Charles ;)

And I appreciate it.

> >The getmail documentation for the 'delete' option says: "will delete
> >messages after retrieving and successfully delivering them".  Are you
> >sure they're being successfully delivered?
> 
> But your question made me think of how this script is signaling success, 
> so I just turned the ignore_stderr option on and it is now deleting the 
> messages properly.

I'm glad Stephen put you on the right track.  Yes, if getmail thinks the
message wasn't successfully delivered, it will not delete the message from the
server or consider it "read", as getmail tries very hard not to lose or
destroy your mail.

There's several things that can cause getmail to think the delivery failed
with an MDA_external:

  * mda exits nonzero
  * mda writes to stderr (overridable, as you found)
  * a failed filter before invoking the mda

If you're writing your own MDA (as you said, to deliver to a database), you
have to be careful to prevent mail being lost -- in the case of the mda being
unable to guarantee the mail is preserved, it absolutely must exit nonzero to
ensure getmail knows to preserve that message.  The stderr bit is merely extra
caution on getmail's part; some mdas can exit zero even when failing to
deliver mail properly (procmail is famous for it).

Charles
-- 
-----------------------------------------------------------------------
Charles Cazabon
GPL'ed software available at:               http://pyropus.ca/software/
-----------------------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: getmail-unsubscribe@lists.pyropus.ca
For additional commands, e-mail: getmail-help@lists.pyropus.ca

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic