Recently, I've been setting up an SMTP mail server for my website (ironfi.st) on a server titled "ironfist-droplet". I'm using the WP-SMTP-MAIL plugin. I have the apache2 server setup up and everything correctly configured. Using: echo "Subject: sendmail test" | sendmail -v [email protected]
and the email will send to mine from the server perfectly fine. However, when sending a test email using my WP-MAIL-SMTP plugin it does not send.
This has led me to believe there may be an issue with the hosts file in /etc/hosts
Below is what I have typed into my hosts file:
127.0.0.1 localhost localhost.localdomain
192.168.1.10 ironfist-droplet ironfist-droplet.ironfi.st ironfi.st
Below is my mail log file:
Feb 17 10:59:18 ironfist-droplet sendmail[3223]: v1HFxI2U003223: from=root, size=196, class=0, nrcpts=1, msgid=<201702171559.v1HFxI2U003223@ironfist-droplet>, relay=root@localhost
Feb 17 10:59:18 ironfist-droplet sm-mta[3225]: v1HFxIYv003225: from=<root@ironfist-droplet>, size=455, class=0, nrcpts=1, msgid=<201702171559.v1HFxI2U003223@ironfist-droplet>, proto=ESMTP, daemon=MTA-v4, relay=localhost [127.0.0.1]
Feb 17 10:59:18 ironfist-droplet sendmail[3223]: v1HFxI2U003223: to=root, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30196, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (v1HFxIYv003225 Message accepted for delivery)
Feb 17 10:59:18 ironfist-droplet sm-mta[3226]: v1HFxIYv003225: to=<root@ironfist-droplet>, ctladdr=<root@ironfist-droplet> (0/0), delay=00:00:00, xdelay=00:00:00, mailer=local, pri=30682, dsn=2.0.0, stat=Sent
Feb 17 11:04:35 ironfist-droplet sendmail[3261]: v1HG4ZrO003261: from=root, size=196, class=0, nrcpts=1, msgid=<201702171604.v1HG4ZrO003261@ironfist-droplet>, relay=root@localhost
Feb 17 11:04:35 ironfist-droplet sm-mta[3263]: v1HG4ZWL003263: from=<root@ironfist-droplet>, size=455, class=0, nrcpts=1, msgid=<201702171604.v1HG4ZrO003261@ironfist-droplet>, proto=ESMTP, daemon=MTA-v4, relay=localhost [127.0.0.1]
Feb 17 11:04:35 ironfist-droplet sendmail[3261]: v1HG4ZrO003261: to=root, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30196, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (v1HG4ZWL003263 Message accepted for delivery)
Feb 17 11:04:35 ironfist-droplet sm-mta[3264]: v1HG4ZWL003263: to=<root@ironfist-droplet>, ctladdr=<root@ironfist-droplet> (0/0), delay=00:00:00, xdelay=00:00:00, mailer=local, pri=30682, dsn=2.0.0, stat=Sent
Feb 17 11:04:48 ironfist-droplet sendmail[3269]: v1HG4mAm003269: from=root, size=196, class=0, nrcpts=1, msgid=<201702171604.v1HG4mAm003269@ironfist-droplet>, relay=root@localhost
Feb 17 11:04:48 ironfist-droplet sm-mta[3271]: v1HG4muh003271: from=<root@ironfist-droplet>, size=455, class=0, nrcpts=1, msgid=<201702171604.v1HG4mAm003269@ironfist-droplet>, proto=ESMTP, daemon=MTA-v4, relay=localhost [127.0.0.1]
Feb 17 11:04:48 ironfist-droplet sendmail[3269]: v1HG4mAm003269: to=root, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30196, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (v1HG4muh003271 Message accepted for delivery)
Feb 17 11:04:48 ironfist-droplet sm-mta[3272]: v1HG4muh003271: to=<root@ironfist-droplet>, ctladdr=<root@ironfist-droplet> (0/0), delay=00:00:00, xdelay=00:00:00, mailer=local, pri=30682, dsn=2.0.0, stat=Sent
Feb 18 09:39:26 ironfist-droplet sendmail[9396]: v1IEdQfV009396: from=root, size=14, class=0, nrcpts=2, msgid=<[email protected]>, relay=root@localhost
Feb 18 09:39:26 ironfist-droplet sm-mta[9397]: v1IEdQrA009397: from=<[email protected]>, size=305, class=0, nrcpts=2, msgid=<[email protected]>, proto=ESMTP, daemon=MTA-v4, relay=localhost [127.0.0.1]
Feb 18 09:39:26 ironfist-droplet sm-mta[9397]: STARTTLS=client, relay=gmail-smtp-in.l.google.com., version=TLSv1/SSLv3, verify=FAIL, cipher=ECDHE-RSA-AES128-GCM-SHA256, bits=128/128
Feb 18 09:39:27 ironfist-droplet sm-mta[9397]: v1IEdQrA009397: to=<[email protected]>, delay=00:00:01, xdelay=00:00:01, mailer=esmtp, pri=60305, relay=gmail-smtp-in.l.google.com. [173.194.204.26], dsn=2.0.0, stat=Sent (OK 1487428767 a63si3981733qkb.149 - gsmtp)
Feb 18 09:43:27 ironfist-droplet sm-mta[9397]: v1IEdQrA009397: to=<[email protected]>, delay=00:04:01, xdelay=00:04:00, mailer=esmtp, pri=60305, relay=ironfist-droplet.ironfi.st. [192.168.1.10], dsn=4.0.0, stat=Deferred: Connection timed out with ironfist-droplet.ironfi.st.
Feb 18 09:43:27 ironfist-droplet sendmail[9396]: v1IEdQfV009396: to=Example,[email protected], ctladdr=root (0/0), delay=00:04:01, xdelay=00:04:01, mailer=relay, pri=60014, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (v1IEdQrA009397 Message accepted for delivery)
Feb 18 09:55:23 ironfist-droplet sm-mta[9426]: v1IEdQrA009397: to=<[email protected]>, delay=00:15:57, xdelay=00:04:15, mailer=esmtp, pri=150305, relay=ironfist-droplet.ironfi.st. [192.168.1.10], dsn=4.0.0, stat=Deferred: Connection timed out with ironfist-droplet.ironfi.st.
As you can see, it's trying to connect to ironfist-droplet.ironfi.st
which is what I have put into my /etc/hosts
and timing out.
Below is an attachment of my mail error logs:
Jan 24 23:21:47 ironfist-droplet sendmail[2417]: My unqualified host name (ironfist-droplet) unknown; sleeping for retry
Jan 24 23:22:47 ironfist-droplet sendmail[2417]: unable to qualify my own domain name (ironfist-droplet) -- using short name
Jan 24 23:22:47 ironfist-droplet sm-mta[2486]: My unqualified host name (ironfist-droplet) unknown; sleeping for retry
Jan 24 23:22:50 ironfist-droplet sm-msp-queue[2491]: My unqualified host name (ironfist-droplet) unknown; sleeping for retry
Jan 24 23:23:47 ironfist-droplet sm-mta[2486]: unable to qualify my own domain name (ironfist-droplet) -- using short name
Jan 24 23:23:50 ironfist-droplet sm-msp-queue[2491]: unable to qualify my own domain name (ironfist-droplet) -- using short name
As seen above it's having trouble qualifying the host name and domain name under ironfist-droplet. I'm very new to this, and took the task of setting up an SMTP server as a way to challenge myself and get experience. I'm very new to all this. However, based on this evidence I've been lead to conclude that something is wrong with how I put the information in the hosts file. There are two pieces of info I am positive about though:
the hostname is ironfist-droplet as hostname -f
returns ironfist-droplet and the private ip in the second line is correct as hostname -i
returns 192.168.1.10. I've looked online and haven't been able to find a good comparison of someone's host file to compare to mine.
If any sees any errors in how I've put in my hosts file or a solution to my issue, please do not hesitate to tell me. All help is appreciated.
Full hosts file:
# Your system has configured 'manage_etc_hosts' as True.
# As a result, if you wish for changes to this file to persist
# then you will need to either
# a.) make changes to the master file in /etc/cloud/templates/hosts.tmpl
# b.) change or remove the value of 'manage_etc_hosts' in
# /etc/cloud/cloud.cfg or cloud-config from user-data
127.0.0.1 localhost localhost.localdomain
192.168.1.10 ironfist-droplet ironfist-droplet.ironfi.st ironfi.st
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
Domain name information:
Version 8.14.4
Compiled with: DNSMAP LDAPMAP LDAP_REFERRALS LOG MAP_REGEX MATCHGECOS
MILTER MIME7TO8 MIME8TO7 NAMED_BIND NETINET NETINET6 NETUNIX
NEWDB NIS NISPLUS PIPELINING SASLv2 SCANF SOCKETMAP STARTTLS
TCPWRAPPERS USERDB USE_LDAP_INIT XDEBUG
============ SYSTEM IDENTITY (after readcf) ============
(short domain name) $w = ironfist-droplet
(canonical domain name) $j = ironfist-droplet.ironfi.st
(subdomain name) $m = ironfi.st
(node name) $k = ironfist-droplet
========================================================