0

I send mail using PHP. Everything works good until I send mail to domain (@example.com) which I have in /etc/rc.conf >> hostname="box.example.com".

I guess sendmail catches mail for this domain (even when I use its subdomain in rc.conf) before sending it to world. So, how can I make sendmail to ignore local domain(s) other than localhost?

Martin
  • 109

2 Answers2

2

This is a recurring question, but it is the first time I've seen it for FreeBSD. See this answer on how to edit your freebsd.mc file. Because the above link answers the question for Debian, here is what you need to do in FreeBSD:

# cd /etc/mail
# cp freebsd.mc box.example.com.mc
# vi box.example.mc (and follow the instructions of the link above)
# make all install restart

You can now test the solution.

Since you write that /etc/mail/local-host-names does not exist, run sendmail in test mode with sendmail -bt and then at the > prompt type $=w. This will list you all the names that sendmail considers local. You will see box.example.com in this list.

adamo
  • 7,045
0

Find out which file holds your local host names with grep -i '^fw' sendmail.cf. Remove example.com from the file so named.

MadHatter
  • 81,580