# ssmtp hates apache [SOLVED]

## KWhat

So I have always used ssmtp with php and apache because its simple and it worked.  Recently I have run into a very cute problem.  SSMTP is complaining that "Could not find password entry for UID 81".  Well uid 81 is apache right, and of course it doesnt have a password or a login shell for obvious reasons.  (apache:x:81:81:added by portage for apache:/var/www:/bin/false)

So I dug through some code found the following in ssmtp.c thats been there for a very long time but this use to work.

```

int ssmtp(char *argv[])

{

   char buf[(BUF_SZ + 1)], *p, *q;

#ifdef MD5AUTH

   char challenge[(BUF_SZ + 1)];

#endif

   struct passwd *pw;

   int i, sock;

   uid_t uid;

   uid = getuid();

   if((pw = getpwuid(uid)) == (struct passwd *)NULL) {

      die("Could not find password entry for UID %d", uid);

   }

   get_arpadate(arpadate);

   if(read_config() == False) {

      log_event(LOG_INFO, "%s/ssmtp.conf not found", SSMTPCONFDIR);

   }

```

So my question is what happend that is causeing  getpwuid(getuid()) == (struct passwd *)NULL  for apache now?  Is anyone else having this issue?  I guess maybe getpwuid could be returning an issue and ssmtp forgot to check what it was? Ideas would be helpful.  Thanks.Last edited by KWhat on Tue Feb 24, 2009 11:59 pm; edited 1 time in total

----------

## KWhat

For some reason my permissions were messed up on the /etc/passwd file.

Solution:  chmod 644 /etc/passwd

----------

