Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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/ line 432: readcf: option RunAsUser: unknown user smmsp: Permission denied

Nov 8 09:13:15 jbrunton sendmail[31494]: NOQUEUE: SYSERR(UID48): /etc/mail/ 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 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

This question was marked as an exact duplicate of an existing question.

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

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

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

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.