fetchmail-friends
[Top] [All Lists]

[fetchmail]Re: how to conditionally leave mail on IMAP server?

2001-11-07 09:07:18
On Tue, 6 Nov 2001, dssyenon wrote:
So if I can force procmail to return nonzero, it should leave the mail on
the server.  I'm having trouble figuring out the syntax to do this in
procmail (man procmail, procmailex, procmailrc isn't helping).  In
.procmailrc:

:0 B
* \*\~\*\~.*
{
      EXITCODE=1
      $MAILDIR/test_exitcode
}

A coworker figured out the syntax:

:0 B
* .*\*`\*`.*
{
        :0 c:
        * .*
        $MAILDIR/inbox

        EXITCODE="1"
        DEFAULT=/dev/nosuchfile
        MAILDIR=/dev/nosuchfile
}

This causes a failed delivery and leaves the meeting invites on the server.
However, this yields a new problem: because these mails failed to deliver,
fetchmail will fetch them again, fail the delivery, leave them on the
server, repeat.  This creates a duplicate copy in my local inbox, every
minute (or however frequently fetchmail polls), until I remove the mail
from my IMAP inbox.  This could quickly fill my local inbox over a weekend
when I don't check my work mail.

Even if I don't save a copy to my local inbox, the repeated fetching is a
bandwidth waste, especially on large mails with attachments.  We'd need to
mark these mails read so fetchmail doesn't fetch it repeatedly.

So back to my original question: how to get fetchmail to conditionally
leave mail on the server and also mark the mail read if we already found
*~*~ in the body?

--+-_-++_+--+--/>:<:/\/-+-_-++_--++-+-_--_++--+_--++-+-_++--_++--
Undocumented opcode #761:
RWD  ReWind Disk
mailto : dcn @ sector0 .net  |  http :// sector0 .net / dcn/
Repeal the Digital Millennium Copyright Act!  http://anti-dmca.org
Adobe got Sklyarov in, won't help get him out! http://freesklyarov.org



<Prev in Thread] Current Thread [Next in Thread>