MailScanner Ignoring All Emails

Quintin S. Giesbrecht q at snj.ca
Fri Aug 25 21:00:54 UTC 2017


Bam! Got it working! Not sure what I did wrong, obviously something!

Thanks for the step by step – I obviously missed something in the official how-to. Lol

Q

From: MailScanner [mailto:mailscanner-bounces+q=snj.ca at lists.mailscanner.info] On Behalf Of Shawn Iverson
Sent: Friday, August 25, 2017 1:50 PM
To: MailScanner Discussion <mailscanner at lists.mailscanner.info>
Subject: Re: MailScanner Ignoring All Emails

Ok, I have a MailScanner 5.0.6 with sendmail up, operational, and relaying, and mail is correctly flowing through mailscanner.

Steps I took for testing:

1) Install CentOS 7 (I used a minimal install)
2) Install MailScanner 5.0.6 using install.sh with all defaults
3) Enable MailScanner (/etc/MailScanner/defaults)
4) Disable sendmail and sm-client (systemctl disable sendmail, systemctl disable sm-client)
5) Enable ms-sendmail (systemctl enable ms-sendmail)
6) installed sendmail-cf and m4
7) edited /etc/mail/sendmail.mc<http://sendmail.mc> to listen on all interfaces

DAEMON_OPTIONS(`Port=smtp, Name=MTA')dnl

8) built new cf

m4 /etc/mail/sendmail.mc<http://sendmail.mc> > /etc/mail/sendmail.cf<http://sendmail.cf>

9) Added my domain/destination to the /etc/mail/mailertable

example.org<http://example.org>   ESMTP:[x.x.x.x]

10) Built mailertable db

makemap hash /etc/mail/mailertable.db < /etc/mail/mailertable

11) Added domain to /etc/mail/relay-domains

example.org<http://example.org>

12) Rebooted (was having issues with mailscanner starting, but reboot cleared that up, probably self inflicted)

Sent an email to this system, and this is my log (edited).

Aug 25 14:37:36 relay sendmail[3547]: v7PIbaMI003547: from=<shawniverson at example.com<mailto:shawniverson at example.com>>, size=2220, class=0, nrcpts=1, msgid=<CACg3fsYxMmnMcuikD+7T-ya9Bcjwsreo8LsQ4OaRxyg3yapk2A at mail.example.orgm<mailto:CACg3fsYxMmnMcuikD+7T-ya9Bcjwsreo8LsQ4OaRxyg3yapk2A at mail.example.orgm>>, proto=ESMTP, daemon=MTA, relay=mail-yw0-f177.google.com<http://mail-yw0-f177.google.com> [x.x.x.x]
Aug 25 14:37:36 relay sendmail[3547]: v7PIbaMI003547: to=<shawniverson at example.org<mailto:shawniverson at example.org>>, delay=00:00:00, mailer=esmtp, pri=32220, stat=queued
Aug 25 14:37:36 relay MailScanner[2727]: New Batch: Scanning 1 messages, 2755 bytes
Aug 25 14:37:36 relay MailScanner[2727]: Virus and Content Scanning: Starting
Aug 25 14:38:07 relay MailScanner[2727]: Uninfected: Delivered 1 messages
Aug 25 14:38:07 relay MailScanner[2727]: Deleted 1 messages from processing-database
Aug 25 14:38:08 relay sendmail[3566]: v7PIbaMI003547: to=<shawniverson at example.org<mailto:shawniverson at example.org>>, delay=00:00:32, xdelay=00:00:01, mailer=esmtp, pri=122220, relay=[x.x.x.x] [x.x.x.x], dsn=2.0.0, stat=Sent (OK id=1dlJTG-000053-92)

So, let's compare notes.

On Fri, Aug 25, 2017 at 12:27 PM, Quintin S. Giesbrecht <q at snj.ca<mailto:q at snj.ca>> wrote:
Thank you so much!

From: MailScanner [mailto:mailscanner-bounces+q<mailto:mailscanner-bounces%2Bq>=snj.ca at lists.mailscanner.info<mailto:snj.ca at lists.mailscanner.info>] On Behalf Of Shawn Iverson
Sent: Friday, August 25, 2017 11:26 AM
To: MailScanner Discussion <mailscanner at lists.mailscanner.info<mailto:mailscanner at lists.mailscanner.info>>
Subject: Re: MailScanner Ignoring All Emails

I'm going to spin up an instance on CentOS 7 with sendmail to help figure this out with you.

On Fri, Aug 25, 2017 at 12:22 PM, Quintin S. Giesbrecht <q at snj.ca<mailto:q at snj.ca>> wrote:
Here are the 3 ms-sendmail scripts


Ms-sendmail.service

[Service]

Type=forking

PIDFile=/run/sm-client.pid

Environment=SENDMAIL_OPTS=-q1h

ExecStartPre=/bin/touch /run/sm-client.pid ExecStartPre=/bin/chown smmsp:smmsp /run/sm-client.pid ExecStartPre=-/sbin/restorecon /run/sm-client.pid ExecStartPre=-/etc/mail/make ExecStart=/usr/sbin/sendmail -L sm-msp-queue -Ac $SENDMAIL_OPTS



[Install]

WantedBy=multi-user.target

Also=ms-sendmail-in.service ms-sendmail-out.service [root at mailscanner multi-user.target.wants]# [root at mailscanner multi-user.target.wants]# [root at mailscanner multi-user.target.wants]# cat ms-sendmail-in.service [Unit] Description=Sendmail Mail Transport Inbound Agent for MailScanner After=syslog.target network.target Conflicts=postfix.service exim.service sendmail.service sm-client.service Wants=ms-sendmail.service ms-sendmail-out.service BindsTo=ms-sendmail.service ms-sendmail-out.service





Ms-sendmail-in.service

[Service]

Type=forking

PIDFile=/run/sendmail.in.pid

ExecStart=/usr/sbin/sendmail -bd -OPrivacyOptions=noetrn -ODeliveryMode=queueonly -OQueueDirectory=/var/spool/mqueue.in<http://mqueue.in> -OPidFile=/run/sendmail.in.pid



[Install]

WantedBy=multi-user.target

Also=ms-sendmail.service ms-sendmail-out.service [root at mailscanner multi-user.target.wants]# [root at mailscanner multi-user.target.wants]# [root at mailscanner multi-user.target.wants]# cat ms-sendmail-out.service [Unit] Description=Sendmail Mail Transport Outbound Agent for MailScanner After=syslog.target network.target Conflicts=postfix.service exim.service sendmail.service sm-client.service Wants=ms-sendmail.service ms-sendmail-in.service BindsTo=ms-sendmail.service ms-sendmail-in.service





Ms-sendmail-out.service

[Service]

Type=forking

PIDFile=/run/sendmail.out.pid

ExecStart=/usr/sbin/sendmail -q15m -OPidFile=/run/sendmail.out.pid



[Install]

WantedBy=multi-user.target

Also=ms-sendmail.service ms-sendmail-in.service


From: MailScanner [mailto:mailscanner-bounces+q<mailto:mailscanner-bounces%2Bq>=snj.ca at lists.mailscanner.info<mailto:snj.ca at lists.mailscanner.info>] On Behalf Of Shawn Iverson
Sent: Friday, August 25, 2017 11:13 AM
To: MailScanner Discussion <mailscanner at lists.mailscanner.info<mailto:mailscanner at lists.mailscanner.info>>
Subject: Re: MailScanner Ignoring All Emails

Something doesn't jive here...from your earlier thread...

> [root at mailscanner MailWatch-1.2.5]# ps -ef|grep sendmail
> root     17992     1  0 08:08 ?        00:00:00 sendmail: Queue
> runner at 00:15:00 for /var/spool/mqueue

> root     17994     1  0 08:08 ?        00:00:00 sendmail: accepting
> connections

> smmsp    18007     1  0 08:08 ?        00:00:00 sendmail: Queue
> runner at 01:00:00 for /var/spool/clientmqueue

These are not the ones started by ms-sendmail.

It should be watching /var/spool/mqueue.in<http://mqueue.in>, not /var/spool/mqueue...

You don't have a rogue init scirpt, do you?



On Fri, Aug 25, 2017 at 12:03 PM, Quintin S. Giesbrecht <q at snj.ca<mailto:q at snj.ca>> wrote:
Here are the scripts from /etc/systemd/system.... that systemctl enable ms-sendmail created - hopefully that makes sense...:

[root at mailscanner multi-user.target.wants]# cat ms-sendmail.service
[Unit]
Description=Sendmail Mail Transport Client for MailScanner
After=syslog.target network.target
Conflicts=postfix.service exim.service sendmail.service sm-client.service
Wants=ms-sendmail-in.service ms-sendmail-out.service
BindsTo=ms-sendmail-in.service ms-sendmail-out.service

[Service]
Type=forking
PIDFile=/run/sm-client.pid
Environment=SENDMAIL_OPTS=-q1h
ExecStartPre=/bin/touch /run/sm-client.pid
ExecStartPre=/bin/chown smmsp:smmsp /run/sm-client.pid
ExecStartPre=-/sbin/restorecon /run/sm-client.pid
ExecStartPre=-/etc/mail/make
ExecStart=/usr/sbin/sendmail -L sm-msp-queue -Ac $SENDMAIL_OPTS

[Install]
WantedBy=multi-user.target
Also=ms-sendmail-in.service ms-sendmail-out.service
[root at mailscanner multi-user.target.wants]#
[root at mailscanner multi-user.target.wants]#
[root at mailscanner multi-user.target.wants]# cat ms-sendmail-in.service
[Unit]
Description=Sendmail Mail Transport Inbound Agent for MailScanner
After=syslog.target network.target
Conflicts=postfix.service exim.service sendmail.service sm-client.service
Wants=ms-sendmail.service ms-sendmail-out.service
BindsTo=ms-sendmail.service ms-sendmail-out.service

[Service]
Type=forking
PIDFile=/run/sendmail.in.pid
ExecStart=/usr/sbin/sendmail -bd -OPrivacyOptions=noetrn -ODeliveryMode=queueonly -OQueueDirectory=/var/spool/mqueue.in<http://mqueue.in> -OPidFile=/run/sendmail.in.pid

[Install]
WantedBy=multi-user.target
Also=ms-sendmail.service ms-sendmail-out.service
[root at mailscanner multi-user.target.wants]#
[root at mailscanner multi-user.target.wants]#
[root at mailscanner multi-user.target.wants]# cat ms-sendmail-out.service
[Unit]
Description=Sendmail Mail Transport Outbound Agent for MailScanner
After=syslog.target network.target
Conflicts=postfix.service exim.service sendmail.service sm-client.service
Wants=ms-sendmail.service ms-sendmail-in.service
BindsTo=ms-sendmail.service ms-sendmail-in.service

[Service]
Type=forking
PIDFile=/run/sendmail.out.pid
ExecStart=/usr/sbin/sendmail -q15m -OPidFile=/run/sendmail.out.pid

[Install]
WantedBy=multi-user.target
Also=ms-sendmail.service ms-sendmail-in.service



-----Original Message-----
From: MailScanner [mailto:mailscanner-bounces+q<mailto:mailscanner-bounces%2Bq>=snj.ca at lists.mailscanner.info<mailto:snj.ca at lists.mailscanner.info>] On Behalf Of Antony Stone
Sent: Friday, August 25, 2017 8:23 AM
To: MailScanner Discussion <mailscanner at lists.mailscanner.info<mailto:mailscanner at lists.mailscanner.info>>
Subject: Re: MailScanner Ignoring All Emails

On Friday 25 August 2017 at 15:16:48, Quintin S. Giesbrecht wrote:

> I did that, from the instructions at the end of the MS install…also
> confirmed that the directories have the correct permissions.  Mail is
> flowing, so I assume that the queue folders are correct, MS is just
> not jumping in…and it is running ☺

That doesn't sound like a good assumption to me (about the queue folders being correct).

If your listener process is putting received mail into the folder being monitored by the queue runner process, for example, MailScanner will be sitting waiting for emails to appear in another folder altogether, and mail will simply be delivered by the queue runner as soon as it's received.

> [root at mailscanner MailWatch-1.2.5]# ps -ef|grep sendmail
> root     17992     1  0 08:08 ?        00:00:00 sendmail: Queue
> runner at 00:15:00 for /var/spool/mqueue

> root     17994     1  0 08:08 ?        00:00:00 sendmail: accepting
> connections

> smmsp    18007     1  0 08:08 ?        00:00:00 sendmail: Queue
> runner at 01:00:00 for /var/spool/clientmqueue

1. I'm not sure I understand why you have two queue runner processes going, with different timings and monitoring different directories.

2. Which directory is the middle process (PID 17994) delivering into?


Antony.

--
All generalisations are inaccurate.

                                                   Please reply to the list;
                                                         please *don't* CC me.


--
MailScanner mailing list
mailscanner at lists.mailscanner.info<mailto:mailscanner at lists.mailscanner.info>
http://lists.mailscanner.info/mailman/listinfo/mailscanner


________________________________
This communication, including its attachments, if any, is confidential and intended only for the person(s) to whom it is addressed, and may contain proprietary and/or privileged material. Any unauthorized review, disclosure, copying, other distribution of this communication or taking of any action in reliance on its contents is strictly prohibited. If you have received this message in error, please notify SNJ immediately so that we may amend our records. Then, please delete this message, and its attachments, if any, without reading, copying or forwarding it to anyone.


--
MailScanner mailing list
mailscanner at lists.mailscanner.info<mailto:mailscanner at lists.mailscanner.info>
http://lists.mailscanner.info/mailman/listinfo/mailscanner



--
Shawn Iverson, CETL
Director of Technology
Rush County Schools
765-932-3901 x271<tel:(765)%20932-3901>
iversons at rushville.k12.in.us<mailto:iversons at rushville.k12.in.us>

[https://docs.google.com/uc?export=download&id=0Bw5iD0ToYvs_cy1OZFNIZ0drYVU&revid=0Bw5iD0ToYvs_UitIcHVIWkJVVTl2VGpxVUE0d0FQcHBIRXk4PQ][https://docs.google.com/uc?export=download&id=0Bw5iD0ToYvs_Zkh4eEs3R01yWXc&revid=0Bw5iD0ToYvs_QWpBK2Y2ajJtYjhOMDRFekZwK2xOamk5Q3Y0PQ]



--
MailScanner mailing list
mailscanner at lists.mailscanner.info<mailto:mailscanner at lists.mailscanner.info>
http://lists.mailscanner.info/mailman/listinfo/mailscanner



--
Shawn Iverson, CETL
Director of Technology
Rush County Schools
765-932-3901 x271<tel:(765)%20932-3901>
iversons at rushville.k12.in.us<mailto:iversons at rushville.k12.in.us>

[https://docs.google.com/uc?export=download&id=0Bw5iD0ToYvs_cy1OZFNIZ0drYVU&revid=0Bw5iD0ToYvs_UitIcHVIWkJVVTl2VGpxVUE0d0FQcHBIRXk4PQ][https://docs.google.com/uc?export=download&id=0Bw5iD0ToYvs_Zkh4eEs3R01yWXc&revid=0Bw5iD0ToYvs_QWpBK2Y2ajJtYjhOMDRFekZwK2xOamk5Q3Y0PQ]



--
MailScanner mailing list
mailscanner at lists.mailscanner.info<mailto:mailscanner at lists.mailscanner.info>
http://lists.mailscanner.info/mailman/listinfo/mailscanner




--
Shawn Iverson, CETL
Director of Technology
Rush County Schools
765-932-3901 x271
iversons at rushville.k12.in.us<mailto:iversons at rushville.k12.in.us>

[https://docs.google.com/uc?export=download&id=0Bw5iD0ToYvs_cy1OZFNIZ0drYVU&revid=0Bw5iD0ToYvs_UitIcHVIWkJVVTl2VGpxVUE0d0FQcHBIRXk4PQ][https://docs.google.com/uc?export=download&id=0Bw5iD0ToYvs_Zkh4eEs3R01yWXc&revid=0Bw5iD0ToYvs_QWpBK2Y2ajJtYjhOMDRFekZwK2xOamk5Q3Y0PQ]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mailscanner.info/pipermail/mailscanner/attachments/20170825/72cb773a/attachment.html>


More information about the MailScanner mailing list