Operating System - HP-UX
1834354 Members
1770 Online
110066 Solutions
New Discussion

sendmail not sending or receiving email

 
Andrew Kaplan
Super Advisor

sendmail not sending or receiving email

Hi there --

We have Sendmail 8.13.1 running on an HP-UX 10.20 secure system. The daemon appears to be running but e-mails are not being send or received on the server. I did a check of the /var/adm/syslog/mail.log file and discovered the following entry:

unable to write pid to /etc/mail/sendmail.pid: Permission denied

How would I go about correcting this issue? Thanks.
A Journey In The Quest Of Knowledge
21 REPLIES 21
Geoff Wild
Honored Contributor

Re: sendmail not sending or receiving email

Check the permissions of /etc/mail and does the user that runs the sendmail daemon have permission to write?

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Christine Hartman
Valued Contributor

Re: sendmail not sending or receiving email

here are the permissions we have set....
-r--r--r-- 1 bin bin 64302 Aug 24 15:03 sendmail.cf
-r--r--r-- 1 bin bin 1047 Jun 13 2005 sendmail.cw
-rw------- 1 root mail 34 Dec 18 14:02 sendmail.pid

check the pid in the sendmail.pid file and do a ps -ef |grep on it....make sure that pid is actually running and owned by root. It should return something like:

root 1960 1 0 14:02:04 ? 0:54 sendmail: accepting connections on port 25

also try running sendmail -q to see if it will flush out the queue.

Darrel Louis
Honored Contributor

Re: sendmail not sending or receiving email

Andrew,

Please check if the Sticky Bit is still set on sendmail (I think it is in /usr/bin)

If this is a hardened system it is possible that is set to 555 instead od 4555.

GoodLuck

Darrel
Andrew Kaplan
Super Advisor

Re: sendmail not sending or receiving email

Hi there --

I ran through the checks that had been suggested, and here are the results:

The root user, which runs mail, has full permission to the /etc/mail folder, while the bin group has read/execute permissions, as do do others.

The permissions on the sendmail.pid file are the following: root is the owner while smmsp is the group. The permissions on the file are rw for root and nothing for group and others.

I did a ps -ef |grep sendmail.pid command, and there was no listing of the file. I also did an /usr/sbin/sendmail -q command and simply got a shell prompt.

The permissions on the /usr/sbin/sendmail file are as follows:
-r-xr-sr-s 1 root smmsp 820492 ... sendmail
A Journey In The Quest Of Knowledge
Geoff Wild
Honored Contributor

Re: sendmail not sending or receiving email

sendmail should be:

-r-sr-sr-t 1 root mail 1019904 Oct 29 2003 /usr/contrib/sendmail/usr/sbin/sendmail


chmod +t your sendmail binary

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Andrew Kaplan
Super Advisor

Re: sendmail not sending or receiving email

Hi there --

What does the t permission do?
A Journey In The Quest Of Knowledge
Geoff Wild
Honored Contributor

Re: sendmail not sending or receiving email

sticky bit:

t Add or delete the save-text-image-on-file-
execution (sticky bit) permission. Useful
only if u is expressed or implied in who.

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Darrel Louis
Honored Contributor

Re: sendmail not sending or receiving email


sendmail checks if it has write access to the directory in which it wants to create a file without granting special privileges to 'root'.
To have sendmail run properly, the directories /etc, /etc/mail, and/or /var/run should be owned by root and be writable by its owner.

can you test the following:
cd /etc/mail
touch test

check permissions
drwxr-xr-x root sys /etc
drwxr-xr-x bin mail /etc/mail

Darrel
Christine Hartman
Valued Contributor

Re: sendmail not sending or receiving email

Andrew....cat the sendmail.pid file
in it you should see the process id for the sendmail daemon along with maybe some options that sendmail is running with. This pid in this file is what you should be looking for in your ps -ef command....to make sure that the sendmail daemon is running with this pid and not some other pid.
Andrew Kaplan
Super Advisor

Re: sendmail not sending or receiving email

Hi there --

I checked the permissions on the /etc directory, and they were the following:

drwxr-xr-x 26 root bin ... etc

The permissions for the /etc/mail directory were as follows:

drwxr-xr-x 3 root bin ... mail

I then did a cat command on the sendmail.pid file, and here is the output:

1825
/usr/sbin/sendmail -bd
-OPrivacyOptions=noetrn
-ODeliveryMode=queueonly
-OQueueDirectory=/var/spool/mqueue.in

When I ran a ps -ef |grep sendmail command, the results came back as:

root 1825 1...sendmail:accepting connections
root 1035 1...sendmail:Queue runner@00:30:00
for /var/spool/mqueue
root 1827 1...sendmail:Queue runner@00:30:00
for /var/spool/mqueue

I have not set the t sticky bit as of yet. Shall I proceed with setting it up?






A Journey In The Quest Of Knowledge
Darrel Louis
Honored Contributor

Re: sendmail not sending or receiving email

As I can see from the output it seems to be oke now. You can continue

Check how sendmail is started within the /sbin/init.d/sendmail?
with -bd or just -q30m

GoodLuck

Darrel
Christine Hartman
Valued Contributor

Re: sendmail not sending or receiving email

Andrew...also after your ran your sendmail -q command....did you run mailq to see if there was still mail sitting in the queue? sendmail -q just flushes the mailq out....run mailq to see if any mail is still stuck in the queue
Andrew Kaplan
Super Advisor

Re: sendmail not sending or receiving email

Hi there --

I checked the /sbin/init.d/sendmail script and the following two lines appeared in it:

/usr/sbin/sendmail -bd
-OPrivacyOptions=noetrn
-ODeliveryMode=queueonly
-OQueueDirectory=/var/spool/mqueue.in

/usr/sbin/sendmail -q30m && echo "sendmail


A Journey In The Quest Of Knowledge
Andrew Kaplan
Super Advisor

Re: sendmail not sending or receiving email

I just ran the /usr/bin/mailq command and the result was:

/var/spool/mqueue is empty.
total requests: 0
A Journey In The Quest Of Knowledge
Christine Hartman
Valued Contributor

Re: sendmail not sending or receiving email

then no mail is waiting in your mail queue...when you run this command and see mail sitting there waiting...then run sendmail -q to flush it out. You might check the /var/adm/syslog/mail.log file to see if any entries were logged.
Andrew Kaplan
Super Advisor

Re: sendmail not sending or receiving email

Hi there --

I checked the mail.log file and there are entries as recent as 16:38 EST.
A Journey In The Quest Of Knowledge
Christine Hartman
Valued Contributor

Re: sendmail not sending or receiving email

I think you're good then. In the past when we've had issues with sendmail flushing out the mail from the queue we've put in a crontab entry to just run sendmail -q every 45 min. That way if something is stuck it forces it out.
Cheers!
Andrew Kaplan
Super Advisor

Re: sendmail not sending or receiving email

I'm sorry but I don't think the situation has been solved. I just sent an e-mail to my account on the sendmail server, and it does not appear to have gone through.
A Journey In The Quest Of Knowledge
Darrel Louis
Honored Contributor

Re: sendmail not sending or receiving email

Hi,

Try the following and check the message:
sendmail -v @domain.com
test
.

Don't forget the "."

Darrel
Darrel Louis
Honored Contributor

Re: sendmail not sending or receiving email

What does your mail.log say?

Darrel
Andrew Kaplan
Super Advisor

Re: sendmail not sending or receiving email

There is some improvement. When I sent the test message to the account the same computer, the message did appear. When I repeated the process to an account on another computer, that worked as well.

However, when I sent a reply from the other computer to the account on the sendmail server, it did not go through.

The mail.log file did show the messages being sent.
A Journey In The Quest Of Knowledge