A sendmail problem

I have two forums and I wanted to allow them to be able to contact users. I installed Sendmail. Nothing fancy it only SENDS mail. I have my regular mail server running on a different machine.

I aliased root@localhost to send mail to my external mail server. It works perfectly with the forums and it sends me the Logwatch every morning.

I have fail2ban working. It also works fine BUT…
I cannot get it to send mail from fail2ban or from a command line like mailto=root@localhost or myname@myserver
I set
destemail=root@localhost
sender=root@localhost
sendername=Fail2Ban
mta=sendmail (I’ve also tried mta and mail)
action=%(action_mwl)s

Everything works except the mail

Also, if I try to use mailto, that doesn’t work either.

I’m sure this is something I’m going to kick myself about, but I give up

Have you checked the maillog in /var/log, at the exact time of the failure?
What exact command line did you use to test it?
When you say “I set”, where did you set this?

1 Like

I set it in fail2ban. Mailog has many entries. I’m just off to bed. Will get back tomorow.

Jun 12 03:20:16 centos-73 sendmail[20697]: 25C1KG3Q020697: from=root@centos-73.myDomain, size=1196, class=0, nrcpts=1, msgid=202206120120.25C1KGHt020683@centos-73myDomain, proto=ESMTP, daemon=MTA, relay=localhost [127.0.0.1]
Jun 12 03:20:16 centos-73 sendmail[20696]: 25C1KGNS020696: from=root@centos-73.myDomain, size=6829, class=0, nrcpts=1, msgid=202206120120.25C1KG6o020685@centos-73myDomain, proto=ESMTP, daemon=MTA, relay=localhost [127.0.0.1]
Jun 12 03:20:16 centos-73 sendmail[20700]: 25C1KGFO020700: from=root@centos-73.myDomain, size=16208, class=0, nrcpts=1, msgid=202206120120.25C1KG6Y020689@centos-73myDomain, proto=ESMTP, daemon=MTA, relay=localhost [127.0.0.1]
Jun 12 03:20:16 centos-73 sendmail[20698]: 25C1KGi6020698: from=root@centos-73.myDomain, size=594, class=0, nrcpts=1, msgid=202206120120.25C1KGvn020681@centos-73myDomain, proto=ESMTP, daemon=MTA, relay=localhost [127.0.0.1]
Jun 12 03:20:16 centos-73 sendmail[20683]: 25C1KGHt020683: to=myEmail address, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30868, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (25C1KG3Q020697 Message accepted for delivery)
Jun 12 03:20:16 centos-73 sendmail[20685]: 25C1KG6o020685: to=myEmail address, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=36501, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (25C1KGNS020696 Message accepted for delivery)
Jun 12 03:20:16 centos-73 sendmail[20689]: 25C1KG6Y020689: to=myEmail address, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=45880, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (25C1KGFO020700 Message accepted for delivery)
Jun 12 03:20:16 centos-73 sendmail[20699]: 25C1KGfI020699:

But nothing gets delivered and the mailbox and the queue are empty!

I’ve just noticed. I have jail.conf and jail.local.conf. I see references to jail.local but if I try to change the name from jail.local.conf to jail.local, fail2ban won’t start.

Hi,

Have you seen the example provided by fail2ban:

https://www.fail2ban.org/wiki/index.php/Sendmail

Regards Tom.

I tried it but fail2ban doesn’t start. I got this:

Process: 14652 ExecStop=/usr/bin/fail2ban-client stop (code=exited, status=255)

You would need to look in /var/log/fail2ban.log for clues on why it errors out on restart.

Normally the preferred method from instructions I have read in the past related to fail2ban are:

cd /etc/fail2ban
cp jail.conf jail.local

all changes are then made to jail.local rather than jail.conf. But the logs should give a hint as to why it’s not starting after the changes have been made.

1 Like