Sendmail

...Masquerading and Getting Around Nick's Verification Config...

This applies to RedHat 9.0. Should be similar for other Linuces and Unices.

Background

Nick blocks all email which appears to come from a host/user other than that on his list in order to help prevent use of machines in the umist.ac.uk domain from being hacked and used for spamming. This prevents my machines from emailing such things as cron reports to a central/remote machine. This can be gotten around by using masquerading, as described here.

sendmail.mc and sendmail.cf

Edit /etc/mail/sendmail.mc so that:

  1. the correct smarthost is given;
  2. the root user is not exposed, i.e., is treated as a normal user for masquerading purposes;
  3. sendmail will not accept connections from any host other than localhost --- actually that's not necessary, but a good idea unless you really need it;
  4. the correct masquerading options are set.
    dnl # Uncomment and edit the following line if your outgoing mail needs to
    dnl # be sent out through an external mail server :
    dnl # 
    define(`SMART_HOST',`mailrouter.umist.ac.uk')
    dnl #
    dnl #
    dnl # Uncomment the following if you want email from root to be "exposed"
    dnl # as coming from this host, rather than masquerated as other for 
    dnl # users :
    dnl # 
    dnl EXPOSED_USER(`root')dnl
    dnl #
    dnl #
    dnl # The following causes sendmail to only listen on the IPv4 loopback 
    dnl # address 127.0.0.1 and not on any other network devices. Remove the 
    dnl # loopback address restriction to accept email from the internet or 
    dnl # intranet.
    dnl # 
    DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
    dnl # 
    dnl # 
    MASQUERADE_AS(`umist.ac.uk')dnl
    dnl # 
    dnl #
    dnl # Masquerade not just the headers, but the envelope as well :
    dnl #
    FEATURE(masquerade_envelope)dnl
    dnl #
    dnl # Masquerade not just @mydomainalias.com, but @*.mydomainalias.com 
    dnl # as well :
    dnl #
    FEATURE(masquerade_entire_domain)dnl
    dnl #
    dnl # 
    dnl #
    MASQUERADE_DOMAIN(csu.umist.ac.uk)dnl
    MASQUERADE_DOMAIN(localhost)dnl
    MASQUERADE_DOMAIN(localhost.localdomain)dnl

Then run the Makefile to make sendmail.cf from sendmail.mc.

    cd /etc/mail
    make 
sendmail.cf should be updated (check the datestamp).

Restart the sendmail daemon:

    /etc/init.d/sendmail restart

...previousup (conts)next...



About this document:

Produced from the SGML: /home/isd/public_html/_email/_reml_grp/index.reml
On: 28/7/2003 at 16:24:17
Options: reml2 -i noindex -l long -o html -p multiple