Configuring FreeBSD to Relay Email Through Your ISP

by Benson Wong

With the increase of blocking of spam from dynamic hosts, this is for the FreeBSD users who need to relay all email through their ISP.

  1. Go to /etc/mail
  2. Edit `hostname`.mc
  3. Uncomment the: define(`SMART_HOST', `your.isp.mail.server') line
  4. Replace `your.isp.mail.server’ with the correct value
  5. sudo make install
  6. sudo sh /etc/rc.sendmail restart
  7. done!

To test this:

  1. mail youremail@address.com
  2. tail /var/log/maillog
  3. you should see something like… Feb 6 15:51:38 www2 sm-mta[68105]: l16NpbNr068103: to=<youremail@address.com>, ctladdr=<username@server.com> (1001/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30362, relay=your.isp.mail.server. [10.10.10.13], dsn=2.0.0, stat=Sent (Ok.)

That’s it. I decided to figure out how to do this after my own spam firewall blocked emails coming from my email servers due to PTR filtering. Now all emails from my server are properly delivered through my ISP.

[tags]email, spam, freebsd, smtp[/tags]

{ 1 comment… read it below or add one }

1 Casey Woods February 9, 2007 at 1:37 am

And that would be why the first thing I do when I install FreeBSD is install Postfix and disable Sendmail! :-)

Reply

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Previous post:

Next post: