*hostname.domain.com is substituted throughout for my actual subdomain*
My Setup
I have Drupal 7.14 on an OpenVZ VPS running Ubuntu 11.10 (also tested with 10.04). Ubuntu has installed the repository versions of Apache2/php5/mysql, (not the LAMP metapackage) with php5.ini configured to dump all error messages to syslog
.
My Problem
Consistently, when the site is to send an email to any address, it returns:
Unable to send e-mail. Contact the site administrator if the problem persists.
And the Drupal Error in 'Recent log messages' readds:
Error sending e-mail (from [email protected] to [email protected]).
This Error shows in the Drupal logs no matter what address the email is being sent to.
The email does actually end up sending after a short delay. Usually 1 second, but also 6 or more seconds.
Contents of Syslog
Sep 21 13:22:34 hostname sendmail[1648]: q8LDMYe9001648: Authentication-Warning: hostname.domain.com: www-data set sender to [email protected] using -f
Sep 21 13:22:34 hostname sendmail[1648]: q8LDMYe9001648: [email protected], size=649, class=0, nrcpts=1, msgid=<[email protected]>, relay=www-data@localhost
Sep 21 13:22:34 hostname sm-mta[1649]: q8LDMYxB001649: from=<[email protected]>, size=1023, class=0, nrcpts=1, msgid=<[email protected]>, proto=ESMTP, daemon=MTA-v4, relay=localhost [127.0.0.1]
Sep 21 13:22:34 hostname sendmail[1648]: q8LDMYe9001648: [email protected], delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30649, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (q8LDMYxB001649 Message accepted for delivery)
Sep 21 13:22:34 hostname sendmail[1653]: q8LDMYgo001653: Authentication-Warning: hostname.domain.com: www-data set sender to [email protected] using -f
Sep 21 13:22:34 hostname sendmail[1653]: q8LDMYgo001653: [email protected], size=465, class=0, nrcpts=1, msgid=<[email protected]>, relay=www-data@localhost
Sep 21 13:22:34 hostname sm-mta[1654]: q8LDMY0G001654: <[email protected]>... User unknown
Sep 21 13:22:34 hostname sendmail[1653]: q8LDMYgo001653: [email protected], delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30465, relay=[127.0.0.1] [127.0.0.1], dsn=5.1.1, stat=User unknown
Sep 21 13:22:34 hostname sm-mta[1654]: q8LDMY0G001654: from=<[email protected]>, size=465, class=0, nrcpts=0, proto=ESMTP, daemon=MTA-v4, relay=localhost [127.0.0.1]
Sep 21 13:22:34 hostname sendmail[1653]: q8LDMYgo001653: q8LDMYgp001653: DSN: User unknown
Sep 21 13:22:34 hostname sm-mta[1654]: q8LDMY0I001654: <[email protected]>... User unknown
Sep 21 13:22:34 hostname sendmail[1653]: q8LDMYgp001653: [email protected], delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=31489, relay=[127.0.0.1] [127.0.0.1], dsn=5.1.1, stat=User unknown
Sep 21 13:22:34 hostname sm-mta[1654]: q8LDMY0I001654: from=<>, size=1489, class=0, nrcpts=0, proto=ESMTP, daemon=MTA-v4, relay=localhost [127.0.0.1]
Sep 21 13:22:34 hostname sendmail[1653]: q8LDMYgp001653: q8LDMYgq001653: return to sender: User unknown
Sep 21 13:22:34 hostname sm-mta[1654]: q8LDMY0K001654: from=<>, size=4700, class=0, nrcpts=1, msgid=<[email protected]>, proto=ESMTP, daemon=MTA-v4, relay=localhost [127.0.0.1]
Sep 21 13:22:34 hostname sendmail[1653]: q8LDMYgq001653: to=postmaster, delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=32513, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (q8LDMY0K001654 Message accepted for delivery)
Sep 21 13:22:34 hostname sm-mta[1655]: q8LDMY0K001654: to=root, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=34947, dsn=2.0.0, stat=Sent
Sep 21 13:22:40 hostname sm-mta[1651]: q8LDMYxB001649: to=<[email protected]>, delay=00:00:06, xdelay=00:00:06, mailer=esmtp, pri=121023, relay=fakedomain.com. [86.48.74.19], dsn=2.0.0, stat=Sent (Ok)
Not Understood By Me
There are several seeming anomalies I do not understand, such as:
stat=User unknown
DSN: User unknown
Sep 21 13:22:34 hostname sm-mta[1654]: q8LDMY0I001654: <[email protected]>... User unknown
- I can't understand why Drupal's error says
from [email protected] to [email protected]
- I can send mail from the command line using
sendmail
, and it goes through just fine:
Contents of mail.log after sending with the command line on root
Sep 21 16:00:07 hostname sendmail[3283]: q8LFwxIS003283: from=root, size=167, class=0, nrcpts=1, msgid=<[email protected]>, relay=root@localhost
Sep 21 16:00:07 hostname sm-mta[3305]: q8LG07FE003305: from=<[email protected]>, size=487, class=0, nrcpts=1, msgid=<[email protected]>, proto=ESMTP, daemon=MTA-v4, relay=localhost [127.0.0.1]
Sep 21 16:00:07 hostname sendmail[3283]: q8LFwxIS003283: [email protected], ctladdr=root (0/0), delay=00:01:08, xdelay=00:00:00, mailer=relay, pri=30167, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (q8LG07FE003305 Message accepted for delivery)
Sep 21 16:00:08 hostname sm-mta[3307]: STARTTLS=client, relay=gmail-smtp-in.l.google.com., version=TLSv1/SSLv3, verify=FAIL, cipher=ECDHE-RSA-RC4-SHA, bits=128/128
Sep 21 16:00:08 hostname sm-mta[3307]: q8LG07FE003305: to=<[email protected]>, ctladdr=<[email protected]> (0/0), delay=00:00:01, xdelay=00:00:01, mailer=esmtp, pri=120487, relay=gmail-smtp-in.l.google.com. [74.125.142.26], dsn=2.0.0, stat=Sent (OK 1348243208 ut4si13805795igb.1)
sendmail
on the root account. I have updated the post with the mail.log contents when doing that.