I'm trying to add a Reply-To header in a hook_mail_alter(), like so:

/**
 * Implements hook_mail_alter().
 */
function my_module_mail_alter(&$message) {
  $message['headers']['Reply-To'] = $message['from'];
  // $message['from'] = // something else here
}

However, in smtp.mail.inc it's only adding the Reply-To header if it differs from the Return-Path header. This causes problems later, because my SMTP connection is to SendGrid, which adds it's own Return-Path header. Thus, there's no way to add a Reply-To header.

For a good explanation of the difference between these two headers, see here:

https://stackoverflow.com/q/1235534

We should add it unconditionally, if it's defined.

Comments

joelstein created an issue. See original summary.

joelstein’s picture

Status: Active » Needs review
StatusFileSize
new717 bytes
dinesh18’s picture

Status: Needs review » Reviewed & tested by the community

Yes, you are correct. It should be unconditionally.
+1 to RTBC

chris matthews’s picture

wundo’s picture

I agree with @dinished18

wundo’s picture

wundo’s picture

Status: Reviewed & tested by the community » Fixed

  • wundo committed dcd4437 on 7.x-1.x authored by joelstein
    Issue #2886894 by joelstein, wundo: Add Reply-To header even if it's the...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.