List Info

Thread: Storing a local copy of out going SMTP




Storing a local copy of out going SMTP
country flaguser name
Australia
2008-06-10 00:11:06
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-ispfreebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-isp
To unsubscribe, send any mail to
"freebsd-isp-unsubscribefreebsd.org"

Re: Storing a local copy of out going SMTP
country flaguser name
United States
2008-06-10 10:51:21
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
someuseryourdomain.com	special_addressyourdomain.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.blog
spot.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-ispfreebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-isp
> To unsubscribe, send any mail to
"freebsd-isp-unsubscribefreebsd.org"

_______________________________________________
freebsd-ispfreebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-isp
To unsubscribe, send any mail to
"freebsd-isp-unsubscribefreebsd.org"

Re: Storing a local copy of out going SMTP
country flaguser name
Ukraine
2008-06-10 12:08:29
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-ispfreebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-isp
> To unsubscribe, send any mail to
"freebsd-isp-unsubscribefreebsd.org"


-- 
            Sincerely yours,
                             Artyom Viklenko.
-------------------------------------------------------
artemaws-net.org.ua | http://www.aws-net.o
rg.ua/~artem
artemviklenko.net   | ================================
FreeBSD: The Power to Serve   -  http://www.freebsd.org
_______________________________________________
freebsd-ispfreebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-isp
To unsubscribe, send any mail to
"freebsd-isp-unsubscribefreebsd.org"

Re: Storing a local copy of out going SMTP
country flaguser name
Australia
2008-06-10 05:14:34
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. > $*  <tab>$
$1<$2.>$3   <tab>Already  
archived, map back
R$* <  $+ .procmail > $*   <tab>$
$1<$2.>$3   <tab>Already  
archived, map back
R$* <  $+. > $*    <tab>$#procmail $
/etc/procmailrcs/rc.archive $:  
$1<$2.procmail.>$3
R$* <  $+ > $*     <tab>$#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.
_______________________________________________
freebsd-ispfreebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-isp
To unsubscribe, send any mail to
"freebsd-isp-unsubscribefreebsd.org"

[1-4]

about | contact  Other archives ( Real Estate discussion Medical topics )