sendmail - was: clamdscan

Paul Scott sales at edenusa.com
Thu Jan 23 22:39:42 UTC 2020


Hello Mark,

I don't know what you mean by "Hijack Threads", but okay, no problem.

I just don't know what the email address is to start a new discussion.

Would that be "mailscanner at lists.mailscanner.info?"

I rarely use this mailing list to ask a question, and only when I am asbolutely against the wall, or I have some (what I think to be anyway) useful information for you guys, especially when the documentation on the website is incorrect.  I spend dozens of hours doing my own research first.

I did manage to finally find a script that a gentleman online wrote, but can only use it from the command line.  There were
Instructions with it that explained how to make it a service that can be started/stopped, etc. from anywhere, but the instructions did not work.  

My primary gig is doing live sound and lighting engineering for events, so pardon my not being the brightest bulb when it comes to this stuff that you guys do often.

Appreciate your pointing out that I did not post correctly.

Thank you very much!

Paul Scott
Engineer, Eden USA, Incorporated 
866.501.3336 | 951.505.6967 | sales at edenusa.com 
https://www.edenusa.com 





-----Original Message-----
From: MailScanner <mailscanner-bounces+sales=edenusa.com at lists.mailscanner.info> On Behalf Of Mark Sapiro
Sent: Monday, January 20, 2020 8:14 PM
To: mailscanner at lists.mailscanner.info
Subject: Re: sendmail - was: clamdscan

Please don't hijack threads. I.e., start a new topic by creating a new
message rather than a reply to an unrelated message.

On 1/19/20 1:25 PM, Paul Scott wrote:
> I am trying to bring up MailScanner on a CentOS 6 machine with Sendmail, and the instructions on the mailscanner website are confusing, as this is what is written:
> 
> <START>
> Change Commands That Start Sendmail
> 
> Currently, your copy of sendmail will be started by a script such as /etc/init.d/mail or /etc/rc.d/init.d/sendmail. Somewhere in this script will be the command to start sendmail itself. This should look like this:
> 
> sendmail -bd -q15m
> 
> You should change this to the following two lines:
> 
> sendmail -bd -OPrivacyOptions=noetrn -ODeliveryMode=queueonly -OQueueDirectory=/var/spool/mqueue.in
> sendmail -q15m
> 
> This first starts the copy of sendmail that provides SMTP service, building the work queue for MailScanner. It then starts the copy of sendmail that delivers the output from MailScanner.
> 
> You also might need to change the commands used to shut down sendmail as it now needs to find 2 copies and kill them both. However, this is not critical and the system will work without it.
> <END>
> 
> However, the contents of the /etc/init.d/sendmail file are MUCH more complex, as follows:


It's basically a shell script. Somewhere in this file and/or in an
included file there are things like

DAEMON="yes"
QUEUE="15m"

and maybe

SENDMAIL_OPTARG="additional args"


> start() {
>     # Start daemons.
>     ret=0
>     updateconf
>     echo -n $"Starting $prog: "
>     daemon /usr/sbin/sendmail $([ "x$DAEMON" = xyes ] && echo -bd) \
>         $([ -n "$QUEUE" ] && echo -q$QUEUE) $SENDMAIL_OPTARG

Settings like those above make this become

    daemon /usr/sbin/sendmail -bd -q15m additional args


>     RETVAL=$?
>     echo
>     [ $RETVAL -eq 0 ] && touch /var/lock/subsys/sendmail
>     let ret+=$RETVAL

Then the above says if the return from `daemon /usr/sbin/sendmail -bd
-q15m` is 0, create the lock file /var/lock/subsys/sendmail, otherwise
increment 'ret' for testing later.


>     if [ ! -f /var/run/sm-client.pid ]; then
>         echo -n $"Starting sm-client: "
>         touch /var/run/sm-client.pid
>         chown smmsp:smmsp /var/run/sm-client.pid
>         if [ -x /usr/sbin/selinuxenabled ] && /usr/sbin/selinuxenabled; then
>             /sbin/restorecon /var/run/sm-client.pid
>         fi
>         daemon --check sm-client /usr/sbin/sendmail -L sm-msp-queue -Ac \
>             -q$SMQUEUE $SENDMAIL_OPTARG
>         RETVAL=$?
>         echo
>         [ $RETVAL -eq 0 ] && touch /var/lock/subsys/sm-client
>         let ret+=$RETVAL
>     fi


The stuff immediately above starts sm-client which is a separate process
that MailScanner is not concerned with.


>     [ $ret -eq 0 ] && return 0 || return 1
> }


And finally the above decides whether to return success or failure


> So my question is, how do I modify this startup script so that the mqueue.in is used, along with the other required parameters as described on the website?


I do not use sendmail and am not familiar with all the nuances here, but
I would say replace these lines:

    daemon /usr/sbin/sendmail $([ "x$DAEMON" = xyes ] && echo -bd) \
        $([ -n "$QUEUE" ] && echo -q$QUEUE) $SENDMAIL_OPTARG
    RETVAL=$?
    echo
    [ $RETVAL -eq 0 ] && touch /var/lock/subsys/sendmail
    let ret+=$RETVAL

with

    daemon /usr/sbin/sendmail -bd -OPrivacyOptions=noetrn \
        -ODeliveryMode=queueonly -OQueueDirectory=/var/spool/mqueue.in
    RETVAL=$?
    echo
    let ret+=$RETVAL
    daemon /usr/sbin/sendmail -q15m
    RETVAL=$?
    let ret+=$RETVAL
    [ $ret -eq 0 ] && touch /var/lock/subsys/sendmail


This will start both daemons and create the lock if they both succeed.


-- 
Mark Sapiro <mark at msapiro.net>        The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan


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



More information about the MailScanner mailing list