1748128 Members
4211 Online
108758 Solutions
New Discussion юеВ

Not receiving emails

 
SOLVED
Go to solution
C_V
Frequent Advisor

Not receiving emails

Hey guys there is a script in our server that emails the logs of a backup if completed successfully or not, but now it doesnt work its not sending any emails. But when i try doing this "cat logname |sendmail -v my_email" the email is delivered successfully. What could be wrong...
20 REPLIES 20
TTr
Honored Contributor
Solution

Re: Not receiving emails

First check the mail.log in your local server to see if the email is submitted to the sendmail service. It it is submited, check if it is sent out and if so check on the receiving end to see what happened to the email. It could be trapped by a spam filter or a delivery rule and it is deposited to some folder.

If the mail is not submitted to the local sendmail, check your script for errors. There could be a variable in your script that got set wrong or changed and it threw off the script syntax.
C_V
Frequent Advisor

Re: Not receiving emails

Hi i checked the mail log and found this... please see attached file
Dennis Handly
Acclaimed Contributor

Re: Not receiving emails

>But when i try doing this "cat logname | sendmail -v my_email" the email is delivered successfully.

And you are using the same "my_email" for both?

This info from your log doesn't tell you the reason it failed:
Final-Recipient: RFC822; email1
Action: failed
Status: 5.0.0
Last-Attempt-Date: Sat, 21 Mar 2009 02:17:37 +1100 (EDT)

I would expect that if my_email matched one of the email1 it would work the same.
C_V
Frequent Advisor

Re: Not receiving emails

yes email1 and my_email are the same and yet no email is received.

Also i found something strange for me, i ps of sendmail and its not running.
Patrick Wallek
Honored Contributor

Re: Not receiving emails

>>i ps of sendmail and its not running.

That is fine. E-mail CAN be sent without the sendmail process running.

The only reason for a sendmail process to run is if the server it is running on is supposed to **receive** e-mail messages from **other** servers.
TTr
Honored Contributor

Re: Not receiving emails

> there is a script in our server that emails the logs of a backup

What email address is the script using? What server is that email address ? Is it the same server or another server.

Your attachement is not the mail.log, it is probably the root's mailbox. You need to look in /var/adm/syslog/mail.log, at the bottom to see what happens to the emails.

Does your script give any errors? Post the part of the script that sends the email.
C_V
Frequent Advisor

Re: Not receiving emails

They are using same server.

here is the part of the script that sends mail

echo "\n# Full Backup of `/usr/bin/hostname` completed at `/usr/bin/date +'%d %b %Y - %H:%M:%S'`\n" >> $LOGFILE 2>&1
/usr/bin/grep "\#" $LOGFILE | mailx -s "`/usr/bin/hostname` Backup log for `/usr/bin/date +'%d %b %Y'`" $MAIL
exit $?

I also tried to send a test email using mailx
and i got this result:

server1[crontabs]# echo "TESTING" | mailx -s "TESTING" email1
server1[crontabs]# Who are you?: Not a typewriter
syslog failed: Resource temporarily unavailable, syslog output to stderr
Sendmail: CAA27433: SYSERR(UID0): Who are you?: Not a typewriter
cannot open /no/such/directory/dead.letter: No such file or directory

Looks like that it hangs it stays there forever.

TTr
Honored Contributor

Re: Not receiving emails

I found this reference for this error
"...This error occurs due to the user ID associated with the user 'nobody'. Verify the UID is a non-negative value..."

Do you have a "nobody" user in /etc/passwd and does it have a negative value?

I do not have a "nobody" user in my server and even after I created the "nobody" user, I could not reproduce the error.

See if you can install any sendmail patches.

Also check if the user $MAIL that the script uses, exists as a user or an alias.

Check the aliases file if there is anything unusual in there and rebuild the aliases database by running "newaliases".

Check all the file permissions and ownership in /etc/mail

Is there anything else at the bottom of /var/adm/syslog/mail.log when you try to send a test email?
C_V
Frequent Advisor

Re: Not receiving emails

Yes i found a nobody user with a negative value

$ grep -i nobody /etc/passwd
nobody:*:-2:-2::/: