Postfix, maildir's, and writing filters
rock_on_the_web at comcen.com.au
Tue Sep 23 02:08:57 UTC 2008
On Mon, 2008-09-22 at 20:53 -0400, George Fazio wrote:
> Da Rock wrote:
> > Howdy. This may seem simple, but I'm completely green on this: I have a
> > postfix server with a courier-imap client frontend using maildir's. I'm
> > using imap for an internal mta, but I need to setup a system which
> > retains copies of sent emails on the network and not on individual
> > workstations (which is what happens currently).
> When you say courier-imap client, do you mean you're using maildrop to
> deliver the message to the user's maildir or that there is an end-user
> courier-imap client? I am only familiar with the maildrop piece of courier.
> > I've looked at some of the solutions (bcc and send to a psuedo account
> > for each user, bcc to the user and filter the incoming mail on this) but
> > it seems like a very roundabout way of doing things. I've read up on
> > Postfix, and there is support for custom filters, so:
> > 1. what does it take to write one?
> > 2. how does one copy email from one folder to another in maildirs? Is it
> > possible?
> This is a classic case of over engineering. You do not want to bcc back
> to the user, or filter the mta, just move the outgoing messages to the
> sent folder. You might need bcc for the purposes of journaling all
> email, if you have any legal requirement (sox, hippa, etc.) that require
> it. But, that it another ball of wax entirely.
> > This idea I have should filter the outgoing mail and copy the messages
> > to the sent folder as well as retaining its place in the queue.
> If the end-user's client is using imap and configured properly, it
> should do this for you. Thurderbird, the full version of Outlook (and
> probably Express), and many other clients support this natively - you
> just have to make sure the client is configured to do that. Typically,
> in the configuration of the client, there is something that says
> something like "save a copy of sent messages to <folder of choice>". I
> don't know what client you're using. I use Pine/Alpine, Thunderbird,
> and Outlook (when I have no other choice).
> If the end-user's client is using pop, then you have a problem that may
> require a custom solution like you speak of above.
> > Any ideas? Maybe a link to some good info? I would like to know how to
> > do this myself so I can do more in the future so info and pointers would
> > be great (if you have a script you'd like to share then please show me
> > how it works :) ).
> > Cheers
> My mail system is running postfix (mta) w/ dovecot (for imap or pop
> access from the clients), maildrop (for delivering to a maildir), and
> amavis-new (for spam filtering and virus scanning w/ clamav). My mail
> clients are configured for imap, and they save copies of sent mail to
> the sent folder as expected. While I am using dovecot, and not courier,
> for my imap server - I cannot imagine that any other imap server would
> handle things any differently ... it's core functionality that ever imap
> server should have imho.
Me too. It may be possible to save a copy in evolution, but I haven't
found it in all clients. Plus my system needs to be suitable for a
webmail system, and yes some pop clients.
You sound like you know maildrop very well, I was considering using it
as a part of the solution. If I wrote a milter script for postfix, is it
possible to pass the message to maildrop so that it can take care of the
formalities such as filenames and formats and tell it to put it in a
sent folder? Something like a shell or perl script that uses this line
to run maildrop:
maildrop -d $user Maildir/.Sent
Obviously the message itself will be piped, and the $user will be
obtained by copying the from field in the message.
Would something like this work? I've been searching on google but
haven't found a clear answer, they only mention using maildrop filters
and commands there- not actual usage of the maildrop cli.
More information about the freebsd-questions