Ive got a small server running on a linux box. Im using Apache2 to serve HT docs. Ive also got some perl 5 scripts with which im using sendmail to send various emails. Ive got a problem which surfaced recently - possibly coinsiding with rebooting the server (complete power down).
The problem is that now its not sending any mail at all.
Im still learning linux, so not knowing exactly how to troubleshoot - im having problems fixing this.
I did notice that there was no init script for sendmail in the /etc/rc.d/init.d folder. So, I added one:
#!/bin/sh
#
# 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/sendmail.cf
# pidfile: /var/run/sendmail.pid
# Source function library.
. /etc/rc.d/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0
[ -f /usr/sbin/sendmail ] || exit 0
# See how we were called.
case "$1" in
start)
# Start daemons.
echo -n "Starting sendmail: "
daemon /usr/sbin/sendmail -bd -q1h
echo
touch /var/lock/subsys/sendmail
;;
stop)
# Stop daemons.
echo -n "Shutting down sendmail: "
killproc sendmail
echo
rm -f /var/lock/subsys/sendmail
;;
restart)
$0 stop
$0 start
;;
status)
status sendmail
;;
*)
echo "Usage: sendmail {start|stop|restart|status}"
exit 1
esac
exit 0
I then used this to start sendmail (but how was it running prior to this script?) it started - at least it said [ OK ]...
I then checked the sendmail service status using:
[root@a500 root]# service sendmail status
sendmail dead but subsys locked
and thats what I got...
I then did a netstat:
[root@a500 root]# netstat -l
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 *:32768 *:* LISTEN
tcp 0 0 localhost:32769 *:* LISTEN
tcp 0 0 *:32770 *:* LISTEN
tcp 0 0 *:mysql *:* LISTEN
tcp 0 0 *:netbios-ssn *:* LISTEN
tcp 0 0 *:sunrpc *:* LISTEN
tcp 0 0 *:http *:* LISTEN
tcp 0 0 *:10000 *:* LISTEN
tcp 0 0 *:ftp *:* LISTEN
tcp 0 0 *:ssh *:* LISTEN
tcp 0 0 *:squid *:* LISTEN
tcp 0 0 localhost.localdom:smtp *:* LISTEN
tcp 0 0 *:894 *:* LISTEN
udp 0 0 *:32768 *:*
udp 0 0 *:nfs *:*
udp 0 0 *:32770 *:*
udp 0 0 *:32771 *:*
udp 0 0 IP:netbios-ns *:*
udp 0 0 localhost.lo:netbios-ns *:*
udp 0 0 *:netbios-ns *:*
udp 0 0 IP:netbios-dgm *:*
udp 0 0 localhost.l:netbios-dgm *:*
udp 0 0 *:netbios-dgm *:*
udp 0 0 *:10000 *:*
udp 0 0 *:icpv2 *:*
udp 63936 0 *:bootpc *:*
udp 0 0 *:3401 *:*
udp 0 0 *:4827 *:*
udp 0 0 *:sunrpc *:*
udp 0 0 *:891 *:*
udp 0 0 localhost.localdoma:ntp *:*
udp 0 0 IP.client:ntp *:*
udp 0 0 localhost:ntp *:*
udp 0 0 *:ntp *:*
Active UNIX domain sockets (only servers)
Proto RefCnt Flags Type State I-Node Path
unix 2 [ ACC ] STREAM LISTENING 3567 public/showq
unix 2 [ ACC ] STREAM LISTENING 5053 /tmp/.s.PGSQL.5432
unix 2 [ ACC ] STREAM LISTENING 7833 /tmp/mysql.sock
unix 2 [ ACC ] STREAM LISTENING 3547 private/rewrite
unix 2 [ ACC ] STREAM LISTENING 3551 private/bounce
unix 2 [ ACC ] STREAM LISTENING 3555 private/defer
unix 2 [ ACC ] STREAM LISTENING 3563 private/smtp
unix 2 [ ACC ] STREAM LISTENING 3571 private/error
unix 2 [ ACC ] STREAM LISTENING 3575 private/local
unix 2 [ ACC ] STREAM LISTENING 3579 private/virtual
unix 2 [ ACC ] STREAM LISTENING 3583 private/lmtp
unix 2 [ ACC ] STREAM LISTENING 3587 private/cyrus
unix 2 [ ACC ] STREAM LISTENING 3591 private/uucp
unix 2 [ ACC ] STREAM LISTENING 3595 private/ifmail
unix 2 [ ACC ] STREAM LISTENING 3599 private/bsmtp
unix 2 [ ACC ] STREAM LISTENING 3659 /var/prelude/socket
unix 2 [ ACC ] STREAM LISTENING 2988 /dev/gpmctl
unix 2 [ ACC ] STREAM LISTENING 3069 /tmp/.font-unix/fs-1
unix 2 [ ACC ] STREAM LISTENING 3161 /var/lib/sasl/mux
unix 2 [ ACC ] STREAM LISTENING 3540 public/cleanup
unix 2 [ ACC ] STREAM LISTENING 3559 public/flush
I see nothing on port 25, so im assuming that sendmail is still not running. Any help here would be wonderful...
also if I try to stop sendmail with this script - it fails...
sendmail WAS working at one point. Ive made no changes in code. I have only rebooted. perhaps sendmail is just not restarting during bootup???
The script was just a try - it worked before I installed that...
Im not sure where to go exactly which log files to look at to get clues for this. Ill be happy to post the logs that pertain here if someone is interested in helping - or perhaps has heard of something like this...
Thanks
perhaps my problem is with postfix (which is running) ??
here is a small chunk of my /var/log/mail/warnings file:
incase this helps...
Feb 25 17:16:30 a500 postfix/nqmgr[1327]: warning: private/smtp socket: malformed response
Feb 25 17:16:30 a500 postfix/nqmgr[1327]: warning: transport smtp failure -- see a previous warning/fatal/panic logfile record for the problem description
Feb 25 14:16:30 a500 postfix/master[1312]: warning: process /usr/lib/postfix/smtp pid 4904 killed by signal 15
Feb 25 17:16:30 a500 postfix/nqmgr[1327]: warning: premature end-of-input from private/smtp socket while reading input attribute name
Feb 25 17:16:30 a500 postfix/nqmgr[1327]: warning: private/smtp socket: malformed response
Feb 25 17:16:30 a500 postfix/nqmgr[1327]: warning: transport smtp failure -- see a previous warning/fatal/panic logfile record for the problem description
Feb 25 14:16:30 a500 postfix/master[1312]: warning: process /usr/lib/postfix/smtp pid 4943 killed by signal 15
Feb 25 17:16:30 a500 postfix/nqmgr[1327]: warning: premature end-of-input from private/smtp socket while reading input attribute name
Feb 25 17:16:30 a500 postfix/nqmgr[1327]: warning: private/smtp socket: malformed response
Feb 25 17:16:30 a500 postfix/nqmgr[1327]: warning: transport smtp failure -- see a previous warning/fatal/panic logfile record for the problem description
Feb 25 14:18:06 a500 postfix/postfix-script: warning: /var/spool/postfix/etc/localtime and /etc/localtime differ
Feb 25 14:18:06 a500 postfix/postfix-script: warning: /var/spool/postfix/etc/hosts and /etc/hosts differ
Feb 25 14:18:23 a500 postfix/postfix-script: warning: /var/spool/postfix/etc/localtime and /etc/localtime differ
Feb 25 14:18:23 a500 postfix/postfix-script: warning: /var/spool/postfix/etc/hosts and /etc/hosts differ
The problem is that now its not sending any mail at all.
Im still learning linux, so not knowing exactly how to troubleshoot - im having problems fixing this.
I did notice that there was no init script for sendmail in the /etc/rc.d/init.d folder. So, I added one:
#!/bin/sh
#
# 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/sendmail.cf
# pidfile: /var/run/sendmail.pid
# Source function library.
. /etc/rc.d/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0
[ -f /usr/sbin/sendmail ] || exit 0
# See how we were called.
case "$1" in
start)
# Start daemons.
echo -n "Starting sendmail: "
daemon /usr/sbin/sendmail -bd -q1h
echo
touch /var/lock/subsys/sendmail
;;
stop)
# Stop daemons.
echo -n "Shutting down sendmail: "
killproc sendmail
echo
rm -f /var/lock/subsys/sendmail
;;
restart)
$0 stop
$0 start
;;
status)
status sendmail
;;
*)
echo "Usage: sendmail {start|stop|restart|status}"
exit 1
esac
exit 0
I then used this to start sendmail (but how was it running prior to this script?) it started - at least it said [ OK ]...
I then checked the sendmail service status using:
[root@a500 root]# service sendmail status
sendmail dead but subsys locked
and thats what I got...
I then did a netstat:
[root@a500 root]# netstat -l
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 *:32768 *:* LISTEN
tcp 0 0 localhost:32769 *:* LISTEN
tcp 0 0 *:32770 *:* LISTEN
tcp 0 0 *:mysql *:* LISTEN
tcp 0 0 *:netbios-ssn *:* LISTEN
tcp 0 0 *:sunrpc *:* LISTEN
tcp 0 0 *:http *:* LISTEN
tcp 0 0 *:10000 *:* LISTEN
tcp 0 0 *:ftp *:* LISTEN
tcp 0 0 *:ssh *:* LISTEN
tcp 0 0 *:squid *:* LISTEN
tcp 0 0 localhost.localdom:smtp *:* LISTEN
tcp 0 0 *:894 *:* LISTEN
udp 0 0 *:32768 *:*
udp 0 0 *:nfs *:*
udp 0 0 *:32770 *:*
udp 0 0 *:32771 *:*
udp 0 0 IP:netbios-ns *:*
udp 0 0 localhost.lo:netbios-ns *:*
udp 0 0 *:netbios-ns *:*
udp 0 0 IP:netbios-dgm *:*
udp 0 0 localhost.l:netbios-dgm *:*
udp 0 0 *:netbios-dgm *:*
udp 0 0 *:10000 *:*
udp 0 0 *:icpv2 *:*
udp 63936 0 *:bootpc *:*
udp 0 0 *:3401 *:*
udp 0 0 *:4827 *:*
udp 0 0 *:sunrpc *:*
udp 0 0 *:891 *:*
udp 0 0 localhost.localdoma:ntp *:*
udp 0 0 IP.client:ntp *:*
udp 0 0 localhost:ntp *:*
udp 0 0 *:ntp *:*
Active UNIX domain sockets (only servers)
Proto RefCnt Flags Type State I-Node Path
unix 2 [ ACC ] STREAM LISTENING 3567 public/showq
unix 2 [ ACC ] STREAM LISTENING 5053 /tmp/.s.PGSQL.5432
unix 2 [ ACC ] STREAM LISTENING 7833 /tmp/mysql.sock
unix 2 [ ACC ] STREAM LISTENING 3547 private/rewrite
unix 2 [ ACC ] STREAM LISTENING 3551 private/bounce
unix 2 [ ACC ] STREAM LISTENING 3555 private/defer
unix 2 [ ACC ] STREAM LISTENING 3563 private/smtp
unix 2 [ ACC ] STREAM LISTENING 3571 private/error
unix 2 [ ACC ] STREAM LISTENING 3575 private/local
unix 2 [ ACC ] STREAM LISTENING 3579 private/virtual
unix 2 [ ACC ] STREAM LISTENING 3583 private/lmtp
unix 2 [ ACC ] STREAM LISTENING 3587 private/cyrus
unix 2 [ ACC ] STREAM LISTENING 3591 private/uucp
unix 2 [ ACC ] STREAM LISTENING 3595 private/ifmail
unix 2 [ ACC ] STREAM LISTENING 3599 private/bsmtp
unix 2 [ ACC ] STREAM LISTENING 3659 /var/prelude/socket
unix 2 [ ACC ] STREAM LISTENING 2988 /dev/gpmctl
unix 2 [ ACC ] STREAM LISTENING 3069 /tmp/.font-unix/fs-1
unix 2 [ ACC ] STREAM LISTENING 3161 /var/lib/sasl/mux
unix 2 [ ACC ] STREAM LISTENING 3540 public/cleanup
unix 2 [ ACC ] STREAM LISTENING 3559 public/flush
I see nothing on port 25, so im assuming that sendmail is still not running. Any help here would be wonderful...
also if I try to stop sendmail with this script - it fails...
sendmail WAS working at one point. Ive made no changes in code. I have only rebooted. perhaps sendmail is just not restarting during bootup???
The script was just a try - it worked before I installed that...
Im not sure where to go exactly which log files to look at to get clues for this. Ill be happy to post the logs that pertain here if someone is interested in helping - or perhaps has heard of something like this...
Thanks
perhaps my problem is with postfix (which is running) ??
here is a small chunk of my /var/log/mail/warnings file:
incase this helps...
Feb 25 17:16:30 a500 postfix/nqmgr[1327]: warning: private/smtp socket: malformed response
Feb 25 17:16:30 a500 postfix/nqmgr[1327]: warning: transport smtp failure -- see a previous warning/fatal/panic logfile record for the problem description
Feb 25 14:16:30 a500 postfix/master[1312]: warning: process /usr/lib/postfix/smtp pid 4904 killed by signal 15
Feb 25 17:16:30 a500 postfix/nqmgr[1327]: warning: premature end-of-input from private/smtp socket while reading input attribute name
Feb 25 17:16:30 a500 postfix/nqmgr[1327]: warning: private/smtp socket: malformed response
Feb 25 17:16:30 a500 postfix/nqmgr[1327]: warning: transport smtp failure -- see a previous warning/fatal/panic logfile record for the problem description
Feb 25 14:16:30 a500 postfix/master[1312]: warning: process /usr/lib/postfix/smtp pid 4943 killed by signal 15
Feb 25 17:16:30 a500 postfix/nqmgr[1327]: warning: premature end-of-input from private/smtp socket while reading input attribute name
Feb 25 17:16:30 a500 postfix/nqmgr[1327]: warning: private/smtp socket: malformed response
Feb 25 17:16:30 a500 postfix/nqmgr[1327]: warning: transport smtp failure -- see a previous warning/fatal/panic logfile record for the problem description
Feb 25 14:18:06 a500 postfix/postfix-script: warning: /var/spool/postfix/etc/localtime and /etc/localtime differ
Feb 25 14:18:06 a500 postfix/postfix-script: warning: /var/spool/postfix/etc/hosts and /etc/hosts differ
Feb 25 14:18:23 a500 postfix/postfix-script: warning: /var/spool/postfix/etc/localtime and /etc/localtime differ
Feb 25 14:18:23 a500 postfix/postfix-script: warning: /var/spool/postfix/etc/hosts and /etc/hosts differ