[Smaug] Fixing sendmail to reach SMAUG

lmckusic at tsoft.com lmckusic at tsoft.com
Tue May 20 11:13:05 PDT 2003


Hello SMAUG readers,

Here is how I fixed my mailer to reach SMAUG.

I have had a problem reaching the SMAUG mailing list because of a misconfigured sendmail program.

For about a year and a half, the Smaug administrator's advice was to study the email RFC 882 and fix my own mailer. Unfortunately, I am not a super guru and I never came up with a working plan to do and test the fix.

Here is how I fixed it, and perhaps other people out there can use this information.
So this is a workaround for those on SMAUG, if it works, speak up and maybe with some communication we can
get everybody more fluent in mail configuration and testing.

I run Red Hat Linux 8.0 essentially straight out of the box... uhh except for the fact that
I have installed a bunch of different distributions while still keeping my /home partition.

Somewhere along the line, it seems that the sendmail program has quit paying attention to the
/etc/hosts and
/etc/HOSTNAME isn't used to set a hostname at startup time.

So the first line of all my email messages became "From lmckusic at localhost.localdomain"

Well other mail programs on the internet do not like to receive email from localhost.localdomain
For several years, my internet service provider provided a "relay host" that received my email
and sent the stuff out on the internet.

Finally my ISP altered the "relay host" to relay only for From fields specifically in this ISP domain of tsoft.com

So my copy of sendmail had to be fixed so the From field of my email messages had to be fixed.
The task of altering senmail has these steps.

Step 1
Edit /etc/sendmail.cf to contain these three lines.
I added them a few lines down from the top of the file

MASQUERADE_AS(`yourdomain.com')dnl
FEATURE(masquerade_entire_domain)dnl
FEATURE(`masquerade_envelope')dnl

Step 2 
Rebuild the cf file using the m4 macro compiler.
I had to move the three lines to bypass a precedence error message
m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf

Step 3
Restart sendmail (it causes configuration to be re read)
kill -HUP `head -1 /var/run/sendmail.pid`

Step 4
Test if the changes have altered line 1 of your messages.
Send an email to yourself. Turn headers on (if needed) and inspect line 1 for
>From yourusername at yourdomain.com

Step 5
Note: You can't originate internet email messages as " root" with this setup.
      ---In other words: do not send internet mail when logged in as root.---
      ---Masquerading is a hack---
      ---The problem is your mail will hammer the ISP's root address.
Local messages like logfiles to your local root user are OK



More information about the Smaug mailing list