?

Log in

No account? Create an account

Battling the sendmail beast! - Nothing to See Here

Jul. 23rd, 2006

12:15 am - Battling the sendmail beast!

Previous Entry Share Next Entry

So, I have a domain bloop.com (ok, so that's not the real name :) and I wanted to do forwarding such that I point an MX record for bloop.com at a box, and make sendmail on that box forward user1@bloop.com -> foobie@gmail.com, user2@bloop.com -> bletch@blah.com, and *@bloop.com -> whee@blah.com.

Through a process of searching the web, fiddling with config files, restarting sendmail many times, and sending a passel of test e-mails, I finally got it. Since I will never remember all the crazy junk I had to do, I had better relate it here (oh, and this is on Fedora Core 4)...

  1. Add lines to /etc/mail/virtusertable, e.g.:
            user1@bloop.com      foobie@gmail.com
            user2@bloop.com      bletch@blah.com
            @bloop.com           whee@blah.com
    
  2. Make sendmail actually listen on more than loopback, by editing /etc/mail/sendmail.mc to remove the loopback address restriction:
            dnl #ORIGINAL# DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
            DAEMON_OPTIONS(`Port=smtp, Name=MTA')dnl
    
  3. Open a hole in the firewall for SMTP!

      (Fedora: system-config-firewall, and check "SMTP", then save)

  4. Add the file /etc/mail/local-host-names with a line (or add the line):
            bloop.com
    
  5. Restart sendmail:
            > sudo service sendmail restart
    
You don't have to do any manual step to generate the .db versions of any of the files mentioned above, as they will be regenerated when you restart sendmail.

So, well, hopefully I haven't done anything stupid and turned my machine into an open relay or any such denseness!

Tags: ,
Current Location: home
Current Mood: tiredtired