Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 17 May 2001 11:09:20 -0500
From:      Joe Guetler <joe@axiomadvertising.com>
To:        Odhiambo Washington <wash@wananchi.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Need a way to duplicate every message on mail server
Message-ID:  <3B03F7B2.9842E467@axiomadvertising.com>
References:  <45ba5b45ac14.45ac1445ba5b@mbox.com.au> <NEBBKIPDBLGMBFJFJDOMEEECCDAA.jhvhs@promavto.ru> <20010517161930.C35403@everest.wananchi.com> <3B03E69B.D2331192@axiomadvertising.com> <20010517183827.F10090@everest.wananchi.com>

next in thread | previous in thread | raw e-mail | index | archive | help


Odhiambo Washington wrote:
> 
> * Joe Guetler <joe@axiomadvertising.com> [20010517 17:55]: writing on the subject 'Re: Need a way to duplicate every message on mail server'
> Joe>
> Joe> Odhiambo Washington wrote:
> Joe> >
> Joe> > * Konstantin V. SEMENOV <jhvhs@promavto.ru> [20010517 13:41]: writing on the subject 'RE: Need a way to duplicate every message on mail server'
> Joe> > Konstantin>
> Joe> > Konstantin>
> Joe> > Konstantin> > -----Original Message-----
> Joe> > Konstantin> > From: owner-freebsd-questions@FreeBSD.ORG
> Joe> > Konstantin> > [mailto:owner-freebsd-questions@FreeBSD.ORG]On Behalf Of BSD Freak
> Joe> > Konstantin> > Sent: Thursday, May 17, 2001 2:16 PM
> Joe> > Konstantin> > To: freebsd-questions@FreeBSD.ORG
> Joe> > Konstantin> > Subject: Need a way to duplicate every message on mail server
> Joe> > Konstantin> >
> Joe> > Konstantin> >
> Joe> > Konstantin> > Hi everyone,
> Joe> > Konstantin> >
> Joe> > Konstantin> > I run several FreeBSD mail servers (sendmail) and need a way to
> Joe> > Konstantin> > duplicate every user's incoming messages to a single mailbox for
> Joe> > Konstantin> > archival purposes. Can this also be done for outgoing (SMTP) messages?
> Joe> > Konstantin> > Look forward to enlightenment from the list,
> Joe> > Konstantin> >
> Joe> > Konstantin> > Best Regards...... and thanks in advance..... :-)
> Joe> > Konstantin> >
> Joe> > Konstantin>
> Joe> > Konstantin> use /etc/mail/aliases
> Joe> > Konstantin> ie - user1: user1, archive
> Joe> > Konstantin>
> Joe> > Konstantin> don't forget to execute newaliases afterwards
> Joe> >
> Joe> > What happens if you have over 5K users and they were already
> Joe> > existent on the system?? well you can have the file in db
> Joe> > format, yes so that it's processed more quickly by your MTA but you'll
> Joe> > need some script which can take the output of `ls -1` and append it to
> Joe> > the alias file with a ':' and the two names besides it.
> Joe> >
> Joe> > First create the user called 'archive'.
> Joe> >
> Joe> > I am an amateur at this but I believe the script below will automate the
> Joe> > process.
> Joe> >
> Joe> > NB: I still DON'T know how to insert TAB character but I believe space
> Joe> > will do!!
> Joe> >
> Joe> > cd /usr/home
> Joe> > for i in `ls -1` ; do
> Joe> > echo $i: "" $i, archive >> /etc/mail/aliases
> Joe> > done
> Joe> > /usr/bin/newaliases
> Joe> > exit
> Joe> >
> Joe>
> Joe> I'm no expert, but wouldn't a procmail recipe be able to duplicate
> Joe> incoming and outgoing mail to an archive?
> Joe> btw, I just starting learning procmail, so don't look to me to write the
> Joe> recipe if it can :)
> Joe>
> Joe> Joe
> 
> In that case you'll need to have used Procmail as the Local mailer. You
> could have dug deeper and given us a recipe. I use procmail to process my
> _personal_ emails but never used it on the main MTA.
> 
> -Wash
> 

http://wss.yale.edu/fom/cache/16.html:

# The following two rules are good for experimenting: every message is first
# copied to a directory called "backup" in your mail directory, and then
# that directory is pruned to the 32 most recent items.
# The backup directory must be created manually.

                                :0 c
                                backup

                                :0 ic
                                | cd backup && rm -f dummy `ls -t msg.*
| sed -e 1,32d`

#2000-Feb-03 12:22 richard.crane@yale.edu

This is the first thing I found while casually digging for 5 minutes on
google.  I'm sure you can find more If you want to take more time.  Man
procmailex is also a good source if you want to learn procmail syntax.
As for using procmail as your local mailer, check out the sendmail docs
under /usr/share/sendmail/cf.  That's how I figured out how to do it.

Joe

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3B03F7B2.9842E467>