0

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

JamieB
  • 101
  • 4
  • 1
    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.) –  Nov 08 '11 at 09:12

2 Answers2

0

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.

liquorvicar
  • 161
  • 1
  • 4
  • It has been recovered already, issue still remains. – JamieB Nov 08 '11 at 09: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 08 '11 at 09: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 08 '11 at 09: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 08 '11 at 09:23
  • I've updated the original question to include the error found in the mailog. – JamieB Nov 08 '11 at 09:27
0

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

Farhan
  • 4,269
  • 11
  • 49
  • 80