From owner-freebsd-questions@FreeBSD.ORG Tue Sep 23 02:08:57 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A997D1065673 for ; Tue, 23 Sep 2008 02:08:57 +0000 (UTC) (envelope-from rock_on_the_web@comcen.com.au) Received: from angel.comcen.com.au (angel.comcen.com.au [203.23.236.69]) by mx1.freebsd.org (Postfix) with ESMTP id 3F1658FC0A for ; Tue, 23 Sep 2008 02:08:57 +0000 (UTC) (envelope-from rock_on_the_web@comcen.com.au) Received: from [192.168.0.185] (unknown [202.172.126.254]) by angel.comcen.com.au (Postfix) with ESMTP id 2A4245C2E415 for ; Tue, 23 Sep 2008 12:09:34 +1000 (EST) From: Da Rock To: freebsd-questions@freebsd.org In-Reply-To: <48D83E06.2050005@n3gqf.us> References: <1222072176.4625.48.camel@laptop1.herveybayaustralia.com.au> <48D83E06.2050005@n3gqf.us> Content-Type: text/plain Date: Tue, 23 Sep 2008 12:09:13 +1000 Message-Id: <1222135753.4625.115.camel@laptop1.herveybayaustralia.com.au> Mime-Version: 1.0 X-Mailer: Evolution 2.12.3 (2.12.3-5.fc8) Content-Transfer-Encoding: 7bit Subject: Re: Postfix, maildir's, and writing filters X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Sep 2008 02:08:57 -0000 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 ". 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. > > -George > 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. Cheers