From owner-freebsd-isp@FreeBSD.ORG Tue Jun 10 06:05:06 2008 Return-Path: Delivered-To: freebsd-isp@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B78131065677 for ; Tue, 10 Jun 2008 06:05:06 +0000 (UTC) (envelope-from quakenet1@optusnet.com.au) Received: from fep01.mfe.bur.connect.com.au (fep01.mfe.bur.connect.com.au [203.63.86.21]) by mx1.freebsd.org (Postfix) with ESMTP id 6FE938FC13 for ; Tue, 10 Jun 2008 06:05:05 +0000 (UTC) (envelope-from quakenet1@optusnet.com.au) Received: from beastie.pamada.com (unknown [210.11.0.118]) by fep01.mfe.bur.connect.com.au (Postfix) with ESMTP id 51413F5B1 for ; Tue, 10 Jun 2008 15:11:13 +1000 (EST) Received: from [192.168.0.42] ([210.11.0.118]) (authenticated bits=0) by beastie.pamada.com (8.14.2/8.13.8) with ESMTP id m5A5BCr2001886 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO) for ; Tue, 10 Jun 2008 15:11:12 +1000 (EST) (envelope-from quakenet1@optusnet.com.au) Message-Id: <54930FD0-5217-4D4A-8118-D2ADF8413514@optusnet.com.au> From: Jerahmy Pocott To: freebsd-isp@freebsd.org Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v924) Date: Tue, 10 Jun 2008 15:11:06 +1000 X-Mailer: Apple Mail (2.924) Subject: Storing a local copy of out going SMTP X-BeenThere: freebsd-isp@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Internet Services Providers List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jun 2008 06:05:06 -0000 Hi, I have a 6.3 system running as a mail server, offering imap, pop3 and smtp. The smtp server can be used from anywhere because all users are required to authenticate with SMTP AUTH and it supports TLS. This is using sendmail 8.14.2. What I would like to do is have any mail submitted to the SMTP server to get automatically stored into an imap mailbox (I'm using mbox format currently) for that user, preferably based on the username they supplied to authenticate, but it could also be by the 'mail from:' field. Previously I have been configuring the users mail clients to do this, but they have proven completely unreliable and of course they may use different clients at different locations etc. Obviously having the server do this is still not 100% reliable, since they could still possibly use a different SMTP server, but I'm not going to worry about that currently as it's unlikely to happen often. It's sort of an unusual thing to have the MTA do, so I'v not been able to find anything about how I can get this to happen.. I thought maybe there might be a way to get the sent mail to be processed through procmail or something first.. Any thoughts on the best way to make this happen? Cheers, J. From owner-freebsd-isp@FreeBSD.ORG Tue Jun 10 16:17:25 2008 Return-Path: Delivered-To: freebsd-isp@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 146BB106567B for ; Tue, 10 Jun 2008 16:17:25 +0000 (UTC) (envelope-from neil@neely.cx) Received: from yw-out-2324.google.com (yw-out-2324.google.com [74.125.46.31]) by mx1.freebsd.org (Postfix) with ESMTP id C34898FC1B for ; Tue, 10 Jun 2008 16:17:24 +0000 (UTC) (envelope-from neil@neely.cx) Received: by yw-out-2324.google.com with SMTP id 9so1340594ywe.13 for ; Tue, 10 Jun 2008 09:17:11 -0700 (PDT) Received: by 10.151.148.2 with SMTP id a2mr8707466ybo.0.1213113106101; Tue, 10 Jun 2008 08:51:46 -0700 (PDT) Received: from ?10.10.130.4? ( [216.17.230.105]) by mx.google.com with ESMTPS id n27sm16409633pyh.11.2008.06.10.08.51.44 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 10 Jun 2008 08:51:44 -0700 (PDT) In-Reply-To: <54930FD0-5217-4D4A-8118-D2ADF8413514@optusnet.com.au> References: <54930FD0-5217-4D4A-8118-D2ADF8413514@optusnet.com.au> Mime-Version: 1.0 (Apple Message framework v753.1) Message-Id: <22DD0A2B-1176-4499-B82F-7C9866DD1E21@neely.cx> From: Neil Neely Date: Tue, 10 Jun 2008 09:51:21 -0600 To: Jerahmy Pocott X-Mailer: Apple Mail (2.753.1) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-isp@freebsd.org Subject: Re: Storing a local copy of out going SMTP X-BeenThere: freebsd-isp@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Internet Services Providers List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jun 2008 16:17:25 -0000 It's been years since I used sendmail, so I can only tell you how to do this using postfix, but with any luck it will point you in the right direction so you can fill in the gaps. The feature you are looking for is done via bcc, specifically sender_bcc_maps: from man 5 postconf: sender_bcc_maps (default: empty) Optional BCC (blind carbon-copy) address lookup tables, indexed by sender address. The BCC address (multiple results are not supported) is added when mail enters from outside of Postfix. Configuration looks something like this: sender_bcc_maps = hash:/etc/postfix/sender_bcc /etc/postfix/sender_bcc someuser@yourdomain.com special_address@yourdomain.com This will make a copy of all outgoing mail and inject it into something that looks like inbound mail so you can then get fancy and throw procmail in the loop or whatever you want to do. The example I included above would send it to a single account, but you could do that however you want. Your request is touching on a more broad topic of "email archiving" and a google search in there might be beneficial if you are curious of the options that exist out there . Neil Neely http://neil-neely.blogspot.com On Jun 9, 2008, at 11:11 PM, Jerahmy Pocott wrote: > Hi, > > I have a 6.3 system running as a mail server, offering imap, pop3 > and smtp. The smtp server can be used from anywhere because all > users are required to authenticate with SMTP AUTH and it supports > TLS. This is using sendmail 8.14.2. > > What I would like to do is have any mail submitted to the SMTP > server to get automatically stored into an imap mailbox (I'm using > mbox format currently) for that user, preferably based on the > username they supplied to authenticate, but it could also be by the > 'mail from:' field. Previously I have been configuring the users > mail clients to do this, but they have proven completely unreliable > and of course they may use different clients at different locations > etc. Obviously having the server do this is still not 100% > reliable, since they could still possibly use a different SMTP > server, but I'm not going to worry about that currently as it's > unlikely to happen often. > > It's sort of an unusual thing to have the MTA do, so I'v not been > able to find anything about how I can get this to happen.. I > thought maybe there might be a way to get the sent mail to be > processed through procmail or something first.. Any thoughts on the > best way to make this happen? > > Cheers, > J. > _______________________________________________ > freebsd-isp@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-isp > To unsubscribe, send any mail to "freebsd-isp-unsubscribe@freebsd.org" From owner-freebsd-isp@FreeBSD.ORG Tue Jun 10 17:47:30 2008 Return-Path: Delivered-To: freebsd-isp@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F0E01065680 for ; Tue, 10 Jun 2008 17:47:30 +0000 (UTC) (envelope-from artem@aws-net.org.ua) Received: from alf.aws-net.org.ua (alf.aws-net.org.ua [85.90.196.192]) by mx1.freebsd.org (Postfix) with ESMTP id 92E5C8FC1F for ; Tue, 10 Jun 2008 17:47:29 +0000 (UTC) (envelope-from artem@aws-net.org.ua) Received: from [192.168.32.4] (aviko.aws-net.org.ua [192.168.32.4]) (authenticated bits=0) by alf.aws-net.org.ua (8.14.2/8.14.2) with ESMTP id m5AH8TGg016746 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 10 Jun 2008 20:08:45 +0300 (EEST) (envelope-from artem@aws-net.org.ua) Message-ID: <484EB50D.4090004@aws-net.org.ua> Date: Tue, 10 Jun 2008 20:08:29 +0300 From: Artyom Viklenko Organization: Art&Co. User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) MIME-Version: 1.0 To: Jerahmy Pocott References: <54930FD0-5217-4D4A-8118-D2ADF8413514@optusnet.com.au> In-Reply-To: <54930FD0-5217-4D4A-8118-D2ADF8413514@optusnet.com.au> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0 (alf.aws-net.org.ua [192.168.32.61]); Tue, 10 Jun 2008 20:08:45 +0300 (EEST) X-Virus-Scanned: ClamAV version 0.93, clamav-milter version 0.93 on alf.aws-net.org.ua X-Virus-Status: Clean Cc: freebsd-isp@freebsd.org Subject: Re: Storing a local copy of out going SMTP X-BeenThere: freebsd-isp@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Internet Services Providers List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jun 2008 17:47:30 -0000 Jerahmy Pocott wrote: > Hi, > > I have a 6.3 system running as a mail server, offering imap, pop3 and > smtp. The smtp server can be used from anywhere because all users are > required to authenticate with SMTP AUTH and it supports TLS. This is > using sendmail 8.14.2. > > What I would like to do is have any mail submitted to the SMTP server to > get automatically stored into an imap mailbox (I'm using mbox format > currently) for that user, preferably based on the username they supplied > to authenticate, but it could also be by the 'mail from:' field. I'm not sure if I clearly understand you, but give a try to synonym milter. It's already in a ports collection. I use it to archive ALL mail passing through my mail server. Various aspects can be configured. > Previously I have been configuring the users mail clients to do this, > but they have proven completely unreliable and of course they may use > different clients at different locations etc. Obviously having the > server do this is still not 100% reliable, since they could still > possibly use a different SMTP server, but I'm not going to worry about > that currently as it's unlikely to happen often. > > It's sort of an unusual thing to have the MTA do, so I'v not been able > to find anything about how I can get this to happen.. I thought maybe > there might be a way to get the sent mail to be processed through > procmail or something first.. Any thoughts on the best way to make this > happen? > > Cheers, > J. > _______________________________________________ > freebsd-isp@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-isp > To unsubscribe, send any mail to "freebsd-isp-unsubscribe@freebsd.org" -- Sincerely yours, Artyom Viklenko. ------------------------------------------------------- artem@aws-net.org.ua | http://www.aws-net.org.ua/~artem artem@viklenko.net | ================================ FreeBSD: The Power to Serve - http://www.freebsd.org From owner-freebsd-isp@FreeBSD.ORG Tue Jun 10 20:46:55 2008 Return-Path: Delivered-To: freebsd-isp@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9C5361065671 for ; Tue, 10 Jun 2008 20:46:55 +0000 (UTC) (envelope-from quakenet1@optusnet.com.au) Received: from fallbackmx06.syd.optusnet.com.au (fallbackmx06.syd.optusnet.com.au [211.29.132.8]) by mx1.freebsd.org (Postfix) with ESMTP id 394F08FC21 for ; Tue, 10 Jun 2008 20:46:54 +0000 (UTC) (envelope-from quakenet1@optusnet.com.au) Received: from mail03.syd.optusnet.com.au (mail03.syd.optusnet.com.au [211.29.132.184]) by fallbackmx06.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id m5AAEfAa020231 for ; Tue, 10 Jun 2008 20:14:41 +1000 Received: from [10.0.2.3] (c122-106-190-227.belrs3.nsw.optusnet.com.au [122.106.190.227]) by mail03.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id m5AAEZHb026535 for ; Tue, 10 Jun 2008 20:14:36 +1000 Message-Id: From: Jerahmy Pocott To: freebsd-isp@freebsd.org In-Reply-To: <54930FD0-5217-4D4A-8118-D2ADF8413514@optusnet.com.au> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v924) Date: Tue, 10 Jun 2008 20:14:34 +1000 References: <54930FD0-5217-4D4A-8118-D2ADF8413514@optusnet.com.au> X-Mailer: Apple Mail (2.924) Subject: Re: Storing a local copy of out going SMTP X-BeenThere: freebsd-isp@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Internet Services Providers List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jun 2008 20:46:55 -0000 On 10/06/2008, at 3:11 PM, Jerahmy Pocott wrote: > Hi, > > I have a 6.3 system running as a mail server, offering imap, pop3 > and smtp. The smtp server can be used from anywhere because all > users are required to authenticate with SMTP AUTH and it supports > TLS. This is using sendmail 8.14.2. > > What I would like to do is have any mail submitted to the SMTP > server to get automatically stored into an imap mailbox (I'm using > mbox format currently) for that user, preferably based on the > username they supplied to authenticate, but it could also be by the > 'mail from:' field. Previously I have been configuring the users > mail clients to do this, but they have proven completely unreliable > and of course they may use different clients at different locations > etc. Obviously having the server do this is still not 100% reliable, > since they could still possibly use a different SMTP server, but I'm > not going to worry about that currently as it's unlikely to happen > often. > > It's sort of an unusual thing to have the MTA do, so I'v not been > able to find anything about how I can get this to happen.. I thought > maybe there might be a way to get the sent mail to be processed > through procmail or something first.. Any thoughts on the best way > to make this happen? I know I can get sendmail to run procmail on out going mail using the mailertable or putting a local_rule in the mc file, but I'm worried about what would happen when sendmail delivers mail to itself.. Resulting some some horrible loop.. For example: LOCAL_RULE_0 R$* < @ $+ .procmail. > $* $@ $1<@$2.>$3 Already archived, map back R$* < @ $+ .procmail > $* $@ $1<@$2.>$3 Already archived, map back R$* < @ $+. > $* $#procmail $@ /etc/procmailrcs/rc.archive $: $1<@$2.procmail.>$3 R$* < @ $+ > $* $#procmail $@ /etc/procmailrcs/rc.archive $: $1<@$2.procmail.>$3 Though that works on incoming and outgoing.. Or another example: LOCAL_CONFIG # add .PROCMAIL to the pseudo-domain list CP.PROCMAIL LOCAL_RULE_0 R$+ < @ $+ .procmail . > $#esmtp $@ $2 $: $1<@$2> # match all other mail and send it to procmail script R$+ < @ $+ . > $#procmail $@/etc/procmailrcs/rc.archive $:$1<@$2.procmail> I would prefer to implement as much of it through the mailertable feature as possible though and I haven't seen any examples of doing that.. Also I don't want it to cause problems with local or incoming mails.. Anyone have some insights? Cheers, J.