keeping outgoing mail copy in sendmail

  • keyurjbhatt
  • Born
  • Born
  • keyurjbhatt
  • Posts: 3
  • Loc: india

Post 3+ Months Ago

we r using sendmail 8.11.6-3
we want to keep each and every outgoing copy of email
so where and what change in sendmail.cf file will do this
it will help me realy
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Posts: 9090
  • Loc: Seattle, WA & Phoenix, AZ

Post 3+ Months Ago

I am not sure if this will help. I simply copied and pasted the text below. I am not sure if there is an easier way by just editing the sendmail.cf file. If there is an easier way that you find, please let us know, I would be very interested! Thanks.

Here is where I found this answer:
http://www.experts-exchange.com/Network ... 72156.html

Make sure before you proceed, make backup of your sendmail binaries (/usr/sbin/sendmail, and your sendmail.cf I think the best way to do is just make a backup of all your etc directory

tar -cvf etc.tar /etc/

(just in case this get screwed :)

1. get the sendmail source. You can download one from ftp.redhat.com or it should be available on RH SRPMS CD.

At this stage you need to get install the sendmail source tree somewhere. Unfortunately, I'm not very good with rpm, so what I did is;

2. do a "rpm --recompile sendmail-8.11.6-15.rpm"
and during the compilation proces, press ctrl-C to interrupt the process. If you let the process continue, the whole sendmail source tree would be removed. So be quick.


3. go to /usr/src/redhat/SPECS and copy the file sendmail.spec to your working directory (let say /tmp)

4 edit the file sendmail.spec and comment out (buy placing #, wherever you see "rm -rf {$BUILDROOT}" line.

5 go back to your working directory (/tmp), and do
rpm -bp sendmil.spec

This would do any necessary patching to the sendmail.

6 go to /usr/src/redhat/BUILD/sendmail-8.11.6/sendmail

7 Edit the file conf.c and search for #ifdef EXAMPLE_CODE
insert a line before it, and add
-- from logall.c
*>>old if (tTd(49, 1))
*>>old printf("checkcompat(to=%s, from=%s)\n",
*>>old to->q_paddr, e->e_from.q_paddr);
*>>old
*>>new #include "/root/adm/mail/sendmail/logall.c"
*>>old
*>>old # ifdef EXAMPLE_CODE

go to parent directory - /usr/src/redhat/BUILD/sendmail-8.11.6

and issue a make,

if everything runs, do a "make install"

Next, go to your /etc/directory, edit the file sendmail.mc, and add the line as recommended in logall.c

add the following lines in your sendmail.mc (I placed mine a the end of the file), after that do a ;

m4 sendmail.mc > sendmail.cf

LOCAL_CONFIG
D{LogAll}/var/log/mail.log
D{LogExc}X-Mailing-List
D{LogMax}65535
C{LogBad}sex bomb

Note that the file /var/log/mail.log would be a standard mailbox format. I would be ok to use /var/mail/someuser where someuser would be a valid user -- which is good, you could use any mail client to view the mail.
65545 is the maximum size of the mailfile, and "sex bomb" would be the keyword to catch. Basically all these are ex-plained in logall.c file.

then restart your sendmail.

During the initial run, the logfile (/var/log/mail.log) must exist and writeable by sendmil process.
  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Posts: 9090
  • Loc: Seattle, WA & Phoenix, AZ

Post 3+ Months Ago

Also according to the Sendmail FAQ page they say that in order to do what you want it would require custom programming. So maybe the solution I found above might be the answer. Anyway look at this:

http://www.sendmail.org/faq/section4.html#4.20

The question is: "How can I automatically copy messages based on sender or recipient addresses?"

and their answer is: "It would require custom programming. You could either write a mail filter using the new Milter API in sendmail 8.10 and later (see libmilter/README) or you could look at some of these other unsupported hints: Axel Reinhold's logall.c module". If you check out that module it says that - This routine logs every message in a mail folder before it is actually transmitted. The log is "envelope-oriented" which means it logs every message once - not for every recipient. You must also see the sendmail syslog for actual delivery. The log includes full message bodys.

So you might try that as well.

Note that no such feature has been added to sendmail. When asked about this one of the sendmail developers said it was "because we still believe a bit in privacy."
  • keyurjbhatt
  • Born
  • Born
  • keyurjbhatt
  • Posts: 3
  • Loc: india

Post 3+ Months Ago

thanks very much for such very good elobroted answer

i will try with this and then make a full writeup for it and publish it in our forum so other can in feature use it

thanks againg
  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Posts: 9090
  • Loc: Seattle, WA & Phoenix, AZ

Post 3+ Months Ago

Thanks that would be great, looking forward to what you figure out :D

Post Information

  • Total Posts in this topic: 5 posts
  • Users browsing this forum: No registered users and 17 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.