On 2012-02-21, Pandu Poluan <pa...@poluan.info> wrote:

> Okay, I may have misunderstood your needs the first time around
> (blame it to not having my first cuppa tea of the day).
>
> So, you want to do these steps:
> - Pull email from an IMAP account in box A
> - Filter it in box B
> - Push it to box C

Skip the box B part.  Pull an e-mail from IMAP mailbox A, filter it,
then either discard it or append it to IMAP mailbox C (with A and C
possibly on different servers).

> So, the third step is not an LDA.

Right.  Nothing's local except the filtering.

> There are some alternatives, none of them are simple, though. The
> 'easiest' I think would be:
>
> - have fetchmail (on box B) pull email from box A, and deliver to local
>   maildir (on B) via procmail+SA
>
> - have Dovecot watch the local maildir
>
> - have *another* fetchmail instance pull email from the local Dovecot and
>   push it to an SMTP MTA on box C

If I'm going to use the SMTP server on box C, then I don't think
there's a need for the intermediate maildir stop, since I can have
procmail pipe the message to something like msmtp to deliver it to the
SMTP server.  There are a couple problem with using the SMTP server.
The first is that you can't specify a mailbox.  The big problem is
that the SMTP server may rewrite headers. For example, if it's gmail's
SMTP server, it will always muck up the From: header so the message
appars to be from the account that was used to log in to the SMTP
server (you loose the original From: header). Using the IMAP server
allows you to store a message an any folder you want and the headers
are unchanged.

> You can have multiple fetchmail daemons running at the same time by
> copying/symlinking the fetchmail initscript and creating a
> correspondent conf file. I've submitted a patch (that has been
> accepted into the tree) that allows multiple fetchmail daemons.

I think it would be simpler to write an LDA that delivers a message to
an IMAP mailbox and have procmail pipe messages to that for delivery.
It should only take a couple dozen lines of Python... (famous last words)

-- 
Grant Edwards               grant.b.edwards        Yow! But was he mature
                                  at               enough last night at the
                              gmail.com            lesbian masquerade?


Reply via email to