Friday, August 29, 2008

sendmail problem on RHEL Linux

mail command wasn't sending the mail with following error:

[root@host1]# mail -v -s test tbabar
fprintf.c:50: SM_REQUIRE((fp) != NULL && (fp)->sm_magic == (SmFileMagic)) failed

From the /var/log/maillog it was found that:
sendmail[8698]: m7TB22jG008698: SYSERR(root): queueup: cannot create queue file ./qfm7TB22jG008698, euid=51, fd=-1, fp=0x0: No space
left on device

Made some free space on /var, after which mail started working.

mail command wasn't showing any error but also wasn't sending mail.
/var/log/maillog was showing:

sendmail[8656]: m7TEbgoL008656: SYSERR(root): collect: Cannot write ./dfm7TEbgoL008656 (bfcommit, uid=0, gid=51): No such file or dir

It was found that the problem was due to 'sendmail' binary permission problem, removed 'write' permission of owner & it started working. This is bit strange but....

#which sendmail
# ls -l /usr/sbin/sendmail
lrwxrwxrwx 1 root root 21 Aug 29 14:12 /usr/sbin/sendmail -> /etc/alternatives/mta
# ls -l /etc/alternatives/mta
lrwxrwxrwx 1 root root 27 Aug 29 14:25 /etc/alternatives/mta -> /usr/sbin/sendmail.sendmail
# ls -l /usr/sbin/sendmail.sendmail
-r-xr-sr-x 1 root smmsp 746328 Jan 22 2007 /usr/sbin/sendmail.sendmail

Note: The permissions required for 'sendmail' files can be found in /usr/share/doc/sendmail/SECURITY file.

No comments: