home Mail List
Info
Info
Meetings
Goals
Upcoming
Projects
FAQ
Security
Links

[Date Prev][Date Next] [Chronological] [Thread] [Top]

[NMLUG] sendmail.cf: send vs receive


  • Subject: [NMLUG] sendmail.cf: send vs receive
  • From: _sarang_ at sarangworld.com (Sarang)
  • Date: Wed Feb 23 19:28:42 2005

I'm trying to get sendmail to include different headers when I send email
*from* my machine than when I receive email *to* my machine. Specifically,
I want to *send* mail with the following lines in /etc/sendmail.cf
commented out:

HReceived: $?sfrom $s $.$?_($?s$|from $.$_)
      $.by $j ($v/$Z)$?r with $r$. id $i$?u
      for $u; $|;
      $.$b
H?M?Resent-Message-Id: <$t.$i@$j>
H?M?Message-Id: <$t.$i@$j>

but I want these lines left in when I *receive* email. What's the best way
to do this? Here are two ways I didn't like:

% Start "sendmail -bd" with the lines above left in, and THEN comment them
out. Since "sendmail -bd" only checks /etc/sendmail.cf when it starts,
this change won't affect incoming email. However, outgoing email sent via:

/usr/lib/sendmail -v -fxyz@l41.us -t < filename

WILL be affected, since this checks the /etc/sendmail.cf file each time.
This is really ugly, because it means I have to remember to tweak
/etc/sendmail.cf each time the machine reboots or whenever I restart
sendmail [this is the method I was inadvertantly using until just now-- I
commented out the above lines from sendmail.cf but didn't restart
sendmail]

% Keep the lines above in sendmail.cf, but send email using:

/usr/lib/sendmail -C/etc/sendmail.cf.sending -v -fxyz@l41.us -t < filename

where /etc/sendmail.cf.sending is a copy of /etc/sendmail.cf with the
lines in question commented out. Unfortunately, as "man sendmail" clearly
states, sendmail won't run as root w/ an alternate config file. This leads
to all sorts of permission problems (eg, outgoing email can't be queued
because non-root users can't write to /var/spool/mqueue, etc). I can work
around these (using "O DontBlameSendmail=..."), but this gets ugly fast.

Is there a better way of doing this?

--
Sincerely, Sarang (_sarang_@sarangworld.com)
AOL Instant Messenger ID: JavaMath
Backup Email: saranghome@softhome.net
<html><img src='http://noproxy.sarangworld.com/EXP/rr.php?20050223.191824'></html>




Please send sugestions and comments to webmaster@nmlug.org.
Valid XHTML 1.1! Valid CSS! Powered by Debian Powered by Apache