Hi all

I have an email problem that appears to be isolated to Drupal somehow. I've got sendmail (seemingly) correctly configured - I can send emails from the command line mail client mutt, and I've put together a tiny test script that calls PHP's mail() function, and both these work correctly (i.e., I received the test emails). The only thing that doesn't work correctly is Drupal's own mails. I'm running Drupal 6.2 on Linux (Fedora 7) with PHP 5.2.6 and Apache 2.2.8.

When I save an existing node, the following error message is displayed:

Unable to send e-mail. Please contact the site admin, if the problem persists.

And the associated error message, from /admin/reports/dblog, states:

Error sending e-mail (from no-reply@alastairsmith.me.uk to [CodeBork] moderator notification - Posted Story '<title>').

I also have a related question: how do I disable the moderation emails? I don't really want to receive an email telling me I've posted a new story each time I, well, post a new story.

All help gratefully received.

Alastair

Comments

alastair’s picture

I got the below out of my sendmail log having just updated a post. By the looks of things, there's something funky going on with "who" (i.e., which addresses) Drupal is trying to send to. Is there a setting I'm missing to define the moderator's email address?

Does anyone have any idea on this? Mail is working fine for PHP, and for myself, but not for Drupal.

Many thanks in advance

Alastair

Jun 30 14:55:29 gollum sendmail[7496]: m5UDtTWC007496: from=apache, size=400, class=0, nrcpts=7, msgid=<200806301355.m5UDtTWC007496@localhost.localdomain>, relay=apache@localhost
Jun 30 14:55:29 gollum sendmail[7497]: m5UDtTOY007497: <[CodeBork]@localhost.localdomain>... User unknown
Jun 30 14:55:29 gollum sendmail[7497]: m5UDtTOY007497: <moderator@localhost.localdomain>... User unknown
Jun 30 14:55:29 gollum sendmail[7497]: m5UDtTOY007497: <notification@localhost.localdomain>... User unknown
Jun 30 14:55:29 gollum sendmail[7497]: m5UDtTOY007497: <-@localhost.localdomain>... User unknown
Jun 30 14:55:29 gollum sendmail[7497]: m5UDtTOY007497: <Posted@localhost.localdomain>... User unknown
Jun 30 14:55:29 gollum sendmail[7497]: m5UDtTOY007497: <Story@localhost.localdomain>... User unknown
Jun 30 14:55:29 gollum sendmail[7497]: m5UDtTOY007497: <'PTP/IP'@localhost.localdomain>... User unknown
Jun 30 14:55:29 gollum sendmail[7496]: m5UDtTWC007496: to=[CodeBork], ctladdr=apache (48/48), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=210400, relay=[127.0.0.1] [127.0.0.1], dsn=5.1.1, stat=User unknown
Jun 30 14:55:29 gollum sendmail[7496]: m5UDtTWC007496: to=moderator, ctladdr=apache (48/48), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=210400, relay=[127.0.0.1] [127.0.0.1], dsn=5.1.1, stat=User unknown
Jun 30 14:55:29 gollum sendmail[7496]: m5UDtTWC007496: to=notification, ctladdr=apache (48/48), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=210400, relay=[127.0.0.1] [127.0.0.1], dsn=5.1.1, stat=User unknown
Jun 30 14:55:29 gollum sendmail[7496]: m5UDtTWC007496: to=-, ctladdr=apache (48/48), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=210400, relay=[127.0.0.1] [127.0.0.1], dsn=5.1.1, stat=User unknown
Jun 30 14:55:29 gollum sendmail[7496]: m5UDtTWC007496: to=Posted, ctladdr=apache (48/48), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=210400, relay=[127.0.0.1] [127.0.0.1], dsn=5.1.1, stat=User unknown
Jun 30 14:55:29 gollum sendmail[7496]: m5UDtTWC007496: to=Story, ctladdr=apache (48/48), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=210400, relay=[127.0.0.1] [127.0.0.1], dsn=5.1.1, stat=User unknown
Jun 30 14:55:29 gollum sendmail[7496]: m5UDtTWC007496: to='PTP/IP', ctladdr=apache (48/48), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=210400, relay=[127.0.0.1] [127.0.0.1], dsn=5.1.1, stat=User unknown
Jun 30 14:55:29 gollum sendmail[7497]: m5UDtTOY007497: from=<apache@localhost.localdomain>, size=400, class=0, nrcpts=0, proto=ESMTP, daemon=MTA, relay=gollum [127.0.0.1]
Jun 30 14:55:29 gollum sendmail[7496]: m5UDtTWC007496: m5UDtTWD007496: DSN: User unknown
Jun 30 14:55:29 gollum sendmail[7497]: m5UDtTOa007497: from=<>, size=5051, class=0, nrcpts=1, msgid=<200806301355.m5UDtTWD007496@localhost.localdomain>, proto=ESMTP, daemon=MTA, relay=gollum [127.0.0.1]
Jun 30 14:55:29 gollum sendmail[7496]: m5UDtTWD007496: to=apache, delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=31424, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (m5UDtTOa007497 Message accepted for delivery)
Jun 30 14:55:30 gollum sendmail[7498]: m5UDtTOa007497: to=root, delay=00:00:01, xdelay=00:00:00, mailer=local, pri=35256, dsn=2.0.0, stat=Sent
arhak’s picture

subscribing

rhys’s picture

I think the problem comes from the apache@localhost not being an understood mail alias.
To solve this, I had to modify the apache@localhost, to be redirected from as if it came from a user on the system. (This had to be done while running as root).
For this, I modified the /etc/mail/virtusertable to include:

apache@localhost    my_user_name

After this, I had to compile that table as a hash function using

makemap hash /etc/mail/virtusertable.db < /etc/mail/virtusertable

This then told my sendmail when apache tried to send something, to send it via the username, my_user_name, as a local user from this system.