Sendmail - Taking copies of all outgoing mails

| | Comments (0) | TrackBacks (0)

If we need to take a copy of all outgoing mails, we have the following hack.

if you have installed sendmail from source .. create a file called copyuser.m4
in {Sendmail Source Dir}/cf/hack with the following content:
------------ Cut Here --------------
divert(0)dnl
VERSIONID(`copyuser.m4')dnl
ifdef(`_MAILER_smtp_',,`errprint(`*** MAILER(smtp) must appear before copymail mailer')')dnl
LOCAL_CONFIG
CPNOCOPY
LOCAL_NET_CONFIG
R$+<@$+.NOCOPY.> $#esmtp $@$2 $:$1<@$2.>
R$+<@$+.> $#copymail $@nohostneeded $:$1<@$2.NOCOPY>
R$+<@$+> $#copymail $@nohostneeded $:$1<@$2.NOCOPY>

MAILER_DEFINITIONS
# Copy a message by sending it back to sendmail with an additional address:
# Here, the mail is sent to user mailbackup.
Mcopymail, P=/usr/sbin/sendmail, F=fmSDFMu,S=11/31,
R=ifdef(`_ALL_MASQUERADE_', `21/31', `21'),A=sendmail mailbackup $u

------------ Cut Here --------------

then in ur sendmail.mc file add line
hack(`copyuser')

Then generate the cf file and use it ( you should have created account called mailbackup where the backedup mail goes)

0 TrackBacks

Listed below are links to blogs that reference this entry: Sendmail - Taking copies of all outgoing mails.

TrackBack URL for this entry: http://www.megalinux.net/cgi-bin/mt/mt-tb.fcgi/28

Leave a comment

About this Entry

This page contains a single entry by Ram Prasad published on August 26, 2003 5:48 PM.

RedHat 9, MP3 and XMMS was the previous entry in this blog.

Integrating Tomcat and Apache on RedHat 9.0 is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Powered by
Movable Type 4.01