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.