This may be only for users of certain email server(s) (I use Postfix).

It should fix the sending of email, by setting a header 'To' field.

Patch should apply to the latest released version

(This was previously posted in a PostgreSQL issue)

Comments

greggles’s picture

Title: Patch: Emails not being sent » Patch: Emails not being sent for postfix
StatusFileSize
new818 bytes

I'd like to get more reviews of this since it appears to be MTA dependent.

I re-rolled it given the code cleanup patch and also removed the creation of the $to variable. It felt like it confused as much as it cleaned up to me, but that's pretty stylistic.

greggles’s picture

I'm also not sure whether we need to sanitize the headers or if drupal_mail will do that for us, do you know?

David Goodwin’s picture

No idea :)

From a quick look at the function drupal_mail, it says :

1) $to needs formatting appropriately for mail()
2) $subject - must not contain newlines.
3) $body - drupal will format as appropriate.
4) $from - sets from, reply-to, return-path adn errors-to

aclight’s picture

Status: Needs review » Postponed (maintainer needs more info)

Patch in #1 faild on 5.x-2.x branch, though I realize the version assigned to this issue is 5.x-1.x-dev.

apfel-ethernet /drupal/iex/dev/sites/all/modules/comment_notify: patch -p0 --dry-run < postfix_mail_211682.patch 
patching file comment_notify.module
Hunk #1 FAILED at 290.
1 out of 1 hunk FAILED -- saving rejects to file comment_notify.module.rej

I also don't see how this patch would be necessary. Neither http://api.drupal.org/api/function/contact_mail_page_submit/5 nor http://api.drupal.org/api/function/contact_mail_user_submit/5 even set the headers at all, and those two functions work fine on my site which uses Postfix as the MTA. Do you have any documentation you can point to supporting your claim that Postfix requires setting $headers['To']?

greggles’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)

I think there's nothing to fix here. Nobody else has reported this issue yet.