update duplicate.cache only after successful delivery to maildir

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

update duplicate.cache only after successful delivery to maildir

kml pryn
hi

I am using getmail to poll a pop3 mailbox and getmail handovers mail to maildrop


I am using the following lines in my /etc/maildroprc to
prevent duplicate mails from delivering to the users maildir

reformail -D 8192 duplicate.cache
if ( $RETURNCODE == 0 )
exit


it is working great as long as delivery to maildir is successful

but if delivery to maildir fails due to quota limit reached

then for first time the getmail polls for the message and handovers to maildrop
    maildrop returns proper error message saying that " maildrop: maildir over quota"
but the duplicate.cache is updated with the message-id of the mail even if the delivery failed


so next time getmail tries to delivery the same message maildrop returns 0 due to the entry in
duplicate.cache and getmail removes the message from server and the mail is lost


is there anyway to update duplicate.cache only on successful delivery to the maildir


Thanks and Regards
Kamal


------------------------------------------------------------------------------
Slashdot TV.  Videos for Nerds.  Stuff that Matters.
http://pubads.g.doubleclick.net/gampad/clk?id=160591471&iu=/4140/ostg.clktrk
_______________________________________________
Courier-maildrop mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/courier-maildrop
Reply | Threaded
Open this post in threaded view
|

Re: update duplicate.cache only after successful delivery to maildir

Sam Varshavchik
kml pryn writes:

> I am using the following lines in my /etc/maildroprc to
> prevent duplicate mails from delivering to the users maildir
>
> reformail -D 8192 duplicate.cache
> if ( $RETURNCODE == 0 )
> exit
>
>
> it is working great as long as delivery to maildir is successful
>
> but if delivery to maildir fails due to quota limit reached
>
> then for first time the getmail polls for the message and handovers to  
> maildrop
>     maildrop returns proper error message saying that " maildrop: maildir  
> over quota"
> but the duplicate.cache is updated with the message-id of the mail even if  
> the delivery failed
>
>
> so next time getmail tries to delivery the same message maildrop returns 0  
> due to the entry in
> duplicate.cache and getmail removes the message from server and the mail is  
> lost
>
>
> is there anyway to update duplicate.cache only on successful delivery to the  
> maildir
It's not pretty, but something like this:

dotlock "duplicate.lock" {

  `cp duplicate.cache duplicate.cache.new`
  `reformail -D 8192 duplicate.cache.new`
  if ( $RETURNCODE == 0 )
  {
      exit
  }
  cc "./Maildir"
  `cp duplicate.cache.new duplicate.cache`
}
exit


------------------------------------------------------------------------------
Slashdot TV.  Videos for Nerds.  Stuff that Matters.
http://pubads.g.doubleclick.net/gampad/clk?id=160591471&iu=/4140/ostg.clktrk
_______________________________________________
Courier-maildrop mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/courier-maildrop

attachment0 (836 bytes) Download Attachment