I am using the following setup.
The client's DNS is pointing to Hostgator, but the client wants to test if his site runs faster on DigitalOcean. So the only DNS records I am pointing to DigitalOcean are:
site.com A xxx.xxx.xxx.xxx
www.site.com CNAME site.com
site.com AAAA abcd:abcd::::::0001 (example ip6)
The rest of the DNS records are pointed to the hostgator server.
I configured sendmail
for mail sending from the site and everything works fine, until the destination address is ...@site.com
.
I am pretty sure it's considering the delivery as a local delivery and it's never sent outside of the server.
Here's my sendmail.mc
file just the parts I've modified:
...
FEATURE(`no_default_msa')dnl
dnl DAEMON_OPTIONS(`Family=inet6, Name=MTA-v6, Port=smtp, Addr=::1')dnl
dnl DAEMON_OPTIONS(`Family=inet, Name=MTA-v4, Port=smtp, Addr=127.0.0.1')dnl
dnl DAEMON_OPTIONS(`Family=inet6, Name=MSP-v6, Port=submission, M=Ea, Addr=::1')dnl
dnl DAEMON_OPTIONS(`Family=inet, Name=MSP-v4, Port=submission, M=Ea, Addr=127.0.0.1')dnl
...
...
MAILER_DEFINITIONS -- I haven't touched these three lines
MAILER(`local')dnl
MAILER(`smtp')dnl
dnl define(`MAIL_HUB', `site.com.')dnl
dnl define(`LOCAL_RELAY', `site.com.')dnl
LOCAL_RULESETS
LOCAL_RULE_0
define(`confDONT_PROBE_INTERFACES', `true')dnl
R$* < @site.com. > $* $#esmtp $@ mail.site.com $: $1<@site.com.>$2
My local-host-names
was originally:
site.com
localhost
Changed it to:
localhost
Also, my /etc/hosts
file has this line:
127.0.0.1 site.com {servername} localhost.localdomain localhost
In this case {servername}
is my server's local name.
Relevant mail.log
entries:
Mar 23 01:36:13 servername sendmail[15492]: 02N1aD4f015492: from=www-data, size=5902, class=0, nrcpts=2, msgid=<9c87adbbbcf9915930b16972d7b17b7e@site.com>, relay=www-data@localhost
Mar 23 01:36:13 servername sm-mta[15493]: 02N1aDOf015493: <receiver@site.com>... User unknown
I think this log entry basically describes the situation. The user unknown part. The rest of the log entries are fine, this is the one that fails where the domain is @site.com
.
I followed these tutorials, but it seems it's still not working:
- https://tecadmin.net/install-sendmail-on-ubuntu/
- http://biostall.com/how-i-resolved-my-ubuntu-sendmail-woes/
What should I modify in sendmail's config in order to indicate that the reception of e-mails is not done on that server?