I want to use sendmail so that fail2ban can send me notifications. I have read multiple guides on how to set it up, but I cannot get it to work.
What I have done so far:
apt-get install sendmail- Modified
/etc/hosts: "127.0.0.1 localhost" => "127.0.0.1 localhost localhost.localdomain MYHOSTNAME". I think the error could be here. Since I do not have a domainname, the output ofhostnameis the IP-Adress the wrong way round. So if my IP-Adress was1.2.3.4,hostnameoutputs4-3-2-1. That's what I entered for "MYHOSTNAME". - Reboot
sudo sendmailconfig.
Still, sendmail is not sending and /var/log/mail.log is empty.
Output of var/log/syslog (everything in upper-letters has been modified by me):
Jan 17 11:58:11 MY-I-P-ADRESS sendmail[1814]: v0HBwBK4001814: from=fail2ban, size=100100, class=0, nrcpts=1, msgid=<201701171158.v0HBwBK4001814@localhost.localdomain>, relay=root@localhost
Jan 17 11:58:11 MY-I-P-ADRESS sendmail[1814]: v0HBwBK4001814: to=MY.MAIL@ADRESS.COM, delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=130100, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (v0HBwB0U001819 Message accepted for delivery)
Jan 17 11:58:12 MY-I-P-ADRESS sendmail[1799]: v0HBtjwr001799: from=root, size=0, class=0, nrcpts=2, relay=root@localhost
Jan 17 11:58:12 MY-I-P-ADRESS sm-mta[1821]: STARTTLS=client, relay=mx3.hotmail.com, version=TLSv1/SSLv3, verify=FAIL, cipher=ECDHE-RSA-AES256-SHA384, bits=256/256
Jan 17 11:58:13 MY-I-P-ADRESS sm-mta[1821]: v0HBwB0U001819: to=<MY.EMAIL@ADRESS.COM>, delay=00:00:02, xdelay=00:00:02, mailer=esmtp, pri=220357, relay=mx3.hotmail.com. [65.55.37.120], dsn=5.0.0, stat=Service unavailable
Jan 17 11:58:13 MY-I-P-ADRESS sm-mta[1821]: v0HBwB0U001819: to=<fail2ban@localhost.localdomain>, delay=00:00:02, mailer=local, pri=220357, dsn=5.1.1, stat=User unknown
Jan 17 11:58:13 MY-I-P-ADRESS sm-mta[1821]: v0HBwB0U001819: to=postmaster, delay=00:00:02, mailer=local, pri=220357, dsn=5.1.1, stat=User unknown
Jan 17 11:58:13 MY-I-P-ADRESS sm-mta[1821]: v0HBwD0U001821: to=MAILER-DAEMON, delay=00:00:00, mailer=local, pri=0, dsn=5.1.1, stat=User unknown
Jan 17 11:58:13 MY-I-P-ADRESS sm-mta[1821]: v0HBwD0U001821: to=postmaster, delay=00:00:00, mailer=local, pri=0, dsn=5.1.1, stat=User unknown
Jan 17 11:58:13 MY-I-P-ADRESS sm-mta[1821]: v0HBwD0V001821: to=MAILER-DAEMON, delay=00:00:00, mailer=local, pri=0, dsn=5.1.1, stat=User unknown
Jan 17 11:58:13 MY-I-P-ADRESS sm-mta[1821]: v0HBwD0U001821: Saved message in /var/lib/sendmail/dead.letter