Solved

SendMail queue runner

Posted on 2006-10-31
5
2,527 Views
Last Modified: 2013-12-17
Redhat 2.1 ES
sendmail 8.12
MailScanner/Spamassin

sendmail relays to exchange server.

My relay seems to be working. But there is a 5 min delay before it gets to the exchange server.

sendmail/mailscanner/spamassissin then sendmail holds it.

I suspect the queue runner. but i can't figure out how to change the interval without breaking something.

Any ideas?
I have googled to no end and I really just don't grasp the queue runner concept!!

/[root@mail bin]# ps -ef |grep sendmail
root     15166     1  0 10:31 ?        00:00:04 sendmail: accepting connections
smmsp    15167     1  0 10:31 ?        00:00:00 sendmail: Queue runner@01:00:00
root     15168     1  0 10:31 ?        00:00:00 sendmail: Queue runner@00:01:00
smmsp    15170     1  0 10:31 ?        00:00:00 sendmail: Queue runner@00:15:00
root     29375 15166  0 12:21 ?        00:00:00 sendmail: server j153-210.instan
root     30554 15166  0 12:31 ?        00:00:00 sendmail: k9VHV6ab030554 enewsle
root     30658 15166  0 12:32 ?        00:00:00 sendmail: server enewsletter13.r
root     30791 15166  0 12:33 ?        00:00:00 sendmail: server 107.166.219.87.
root     31013 15166  0 12:35 ?        00:00:00 sendmail: startup with [80.237.9
root     31076 15166  0 12:35 ?        00:00:00 sendmail: startup with 72.46.159
root     31117 15166  0 12:35 ?        00:00:00 sendmail: startup with 201781381
root     31119 15166  0 12:35 ?        00:00:00 sendmail: startup with 62-101-12
root     31120 15166  0 12:35 ?        00:00:00 sendmail: startup with [88.241.2
root     31121 15166  0 12:35 ?        00:00:00 sendmail: startup with [88.241.2
root     31125 15166  1 12:35 ?        00:00:00 sendmail: server 38.20.3.213.fix
root     31126 15166  0 12:35 ?        00:00:00 sendmail: startup with lva103.si
root     31128 15166  0 12:35 ?        00:00:00 sendmail: startup with mx2277.cu
root     31130 23722  0 12:35 pts/2    00:00:00 grep sendmail
[root@mail bin]#

Thanks

0
Comment
Question by:speedracer1263
  • 2
5 Comments
 
LVL 34

Expert Comment

by:PsiCop
ID: 17843996
I happen to have a RHEL v2.1 system hanging around, and it doesn't look like the stock sendmail startup invokes a queue-runner instance. So I dunno if what I've found from the v3.0 system has any bearing.

The Queue interval is set, for the "server" instance, in /etc/sysconfig/sendmail. The control script (/etc/rc.d/init.d/sendmail) uses the QUEUE value for the sendmail server instance as the value for the queue-runner instance, or defaults to 1 hour if there is nothing specified.

Personally, I think that's a boneheaded way to do it, but then RedHat should be ashamed of their crappy sendmail setup anyway.
0
 

Author Comment

by:speedracer1263
ID: 17844638
Not sure how to edit.
I was running sendmail 8.9 just fine and upgraded to 8.12 . I just don't understand the sm-client queue runner thing. Or if that;s really the issue. Nothing is in the standard queue. It seems like everything sits in clientmqueue. I don't even understand how to force a flush of the clientmqueue.

Sendmail is accepting email and then hands it off to Mailscanner. MailScanner is done in a few seconds. Then hands it back to sendmail. Which as far as i can tell puts it in the clientmqueue waiting for the queuerunner to process the mail!???????
Thanks
Here is (/etc/rc.d/init.d/sendmail

#!/bin/bash
#
# sendmail      This shell script takes care of starting and stopping
#               sendmail.
#
# chkconfig: 2345 80 30
# description: Sendmail is a Mail Transport Agent, which is the program \
#              that moves mail from one machine to another.
# processname: sendmail
# config: /etc/mail/sendmail.cf
# pidfile: /var/run/sendmail.pid

# Source function library.
. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

# Source sendmail configureation.
if [ -f /etc/sysconfig/sendmail ] ; then
      . /etc/sysconfig/sendmail
else
      DAEMON=no
      QUEUE=1h
fi
[ -z "$SMQUEUE" ] && SMQUEUE="$QUEUE"
[ -z "$SMQUEUE" ] && SMQUEUE=1h

# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0

[ -f /usr/sbin/sendmail ] || exit 0

RETVAL=0
prog="sendmail"

start() {
      # Start daemons.

      echo -n $"Starting $prog: "
      /usr/bin/newaliases > /dev/null 2>&1
      if test -x /usr/bin/make -a -f /etc/mail/Makefile ; then
        make all -C /etc/mail -s
      else
        for i in virtusertable access domaintable mailertable ; do
          if [ -f /etc/mail/$i ] ; then
            makemap hash /etc/mail/$i < /etc/mail/$i
          fi
        done
      fi
      daemon /usr/sbin/sendmail $([ "x$DAEMON" = xyes ] && echo -bd) \
                        $([ -n "$QUEUE" ] && echo -q$QUEUE)
      RETVAL=$?
      echo
      [ $RETVAL -eq 0 ] && touch /var/lock/subsys/sendmail

      if ! test -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
      daemon --check sm-client /usr/sbin/sendmail -L sm-msp-queue -Ac \
                        -q$SMQUEUE
      RETVAL=$?
        echo
        [ $RETVAL -eq 0 ] && touch /var/lock/subsys/sm-client
        fi

      return $RETVAL
}

stop() {
      # Stop daemons.
      echo -n $"Shutting down $prog: "
      killproc sendmail
      RETVAL=$?
      echo
      [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/sendmail
      if test -f /var/run/sm-client.pid ; then
            echo -n $"Shutting down sm-client: "
            killproc sm-client
            RETVAL=$?
            echo
            [ $RETVAL -eq 0 ] && rm -f /var/run/sm-client.pid
            [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/sm-client
      fi
      return $RETVAL
}

# See how we were called.
case "$1" in
  start)
      start
      ;;
  stop)
      stop
      ;;
  restart|reload)
      stop
      start
      RETVAL=$?
      ;;
  condrestart)
      if [ -f /var/lock/subsys/sendmail ]; then
          stop
          start
          RETVAL=$?
      fi
      ;;
  status)
      status sendmail
      RETVAL=$?
      ;;
  *)
      echo $"Usage: $0 {start|stop|restart|condrestart|status}"
      exit 1
esac

exit $RETVAL
0
 
LVL 34

Accepted Solution

by:
PsiCop earned 500 total points
ID: 17844843
This line in the "start" portion of the script is what's starting the queue-runner instance:

     daemon --check sm-client /usr/sbin/sendmail -L sm-msp-queue -Ac \
                    -q$SMQUEUE

You could replace $SMQUEUE with your own value, for example "1m" for 1 minute, like so:

     daemon --check sm-client /usr/sbin/sendmail -L sm-msp-queue -Ac \
                    -q1m

The "-q" parameter is what sets the queue scanning interval.

The appearance of the queue-runner instance in sendmail v8.12 was to address security problems in earlier versions, including v8.9.
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Resolve DNS query failed errors for Exchange
Marketers need statistics and metrics like everybody else needs oxygen. In this article we explain how to enable marketing campaign statistics for Microsoft Exchange mail.
In this video we show how to create an Accepted Domain in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Mail Flow >> Ac…
To show how to create a transport rule in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Mail Flow >> Rules tab.:  To cr…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now