Take the 2-minute tour ×

Possible Duplicate:
I deleted /etc/passwd yesterday and I am having problems with SendMail today

So yesterday Webmin deleted my /etc/passwd and although it looks like everything is working, I can't get sendmail to work when used in a PHP script.

Using mail() returns false, using PHPMailer results in "Mailer cannot execute sendmail".

I am 100% sure that this problem has happened because of the passwd file, I just can't figure out how to fix it.

I noticed a few users got corrupt and I had to replace them.

EDIT: I should probably mention, if I try and send it through sendmail itself it works perfectly.

For people saying restore the /etc/passwd, I have already done this and the issue still remains.

Nov 8 09:13:15 jbrunton sendmail[31494]: NOQUEUE: SYSERR(UID48): /etc/mail/submit.cf: line 432: readcf: option RunAsUser: unknown user smmsp: Permission denied

Nov 8 09:13:15 jbrunton sendmail[31494]: NOQUEUE: SYSERR(UID48): /etc/mail/submit.cf: line 451: readcf: option TrustedUser: unknown user smmsp: Permission denied

Nov 8 09:13:15 jbrunton sendmail[31494]: NOQUEUE: SYSERR(UID48): can not write to queue directory /var/spool/clientmqueue/ (RunAsGid=0, required=51): Permission denied

share|improve this question

migrated from stackoverflow.com Nov 8 '11 at 10:39

This question came from our site for professional and enthusiast programmers.

marked as duplicate by Iain, Scott Pack, Ward, quanta, Shane Madden Nov 8 '11 at 19:02


You do know that /etc/passwd contains all users on the computer? It's an essential file that should never be deleted or bad stuff will happen (like not being able to login.) –  Joachim Pileborg Nov 8 '11 at 9:12
add comment

2 Answers

Can you recover your old /etc/passwd file from backup? If so, I would do that and compare them. Chances are the user running your PHP script doesn't exist anymore and the OS (or even sendmail) are trying to look the user up to check whether it can run Sendmail.

share|improve this answer
It has been recovered already, issue still remains. –  JamieB Nov 8 '11 at 9:14
How did you replace the users that got corrupted? Did you create them from scratch? If so their UID is probably different from your original /etc/passwd file. –  liquorvicar Nov 8 '11 at 9:17
Surely if the system has been rebooted and then the new /etc/passwd has been loaded it won't matter what the old UID is? Apache user wasn't replaced and no user that had any relation to sendmail was lost as far as I can see. –  JamieB Nov 8 '11 at 9:20
Of course the UID matters. The files on disk all have their owners in form of UIDs. If there is a change, it won't fit any longer... –  glglgl Nov 8 '11 at 9:23
I've updated the original question to include the error found in the mailog. –  JamieB Nov 8 '11 at 9:27
add comment

change the UID of the smmsp from 48 to 51, in the passwd file and it will work.

share|improve this answer
add comment
