After upgrading to webform 4.3, the reply-to header is no longer working.
Even if I disable the webform reply-to module (version 7.x-1.0+3-dev) and use the new setting of the webform, the mails are replied to with the default site email address (set in the new webform settings page) instead of the component of the webform.

Any idea what I'm doing wrong or what I'm missing?

Comments

DanChadwick’s picture

Priority: Major » Normal
Status: Active » Postponed (maintainer needs more info)

The Reply-To address comes from the individual e-mail setting in the webform (node/NID/webform/emails) , not from the global admin default From address set at admin/config/content/webform

Post the actual header received, redacted as needed, if you are still having a problem.

Max2505’s picture

Hi Dan,

Thanks for the feedback. I've send you a pm containing the redacted email headers. Hope it can help you (and hence, me :) ).

Best regards,
Max

DanChadwick’s picture

Status: Postponed (maintainer needs more info) » Active

The headers you sent contained these odd things:
To:
Reply-To: name_from_form via webmaster@my.domain

I don't know why the "To" header is empty, unless you redacted it. Or maybe Mandrill is doing that?
The "name_from_form" should be preceded by the e-mail address. Exactly how is the e-mail in the webform configured?

Is the mail being delievered properly? (I don't use Mandrill.)

Max2505’s picture

Hi Dan,

Yes, sorry, I redacted too much. The "To:" is indeed followed by the email adress where the mail is sent too.
The mail is delivered properly, but when I want to reply, I'm replying to the webmaster@my.domain.

The email in the webform is not really configured in a specific way... it's an email component with the user email as default setting checked.

DanChadwick’s picture

Status: Active » Postponed (maintainer needs more info)

Are you sure that the webform_reply_to modules is actually disabled?

Your "Reply-To" header is formatted a "From" header. The "From" header was missing; perhaps you redacted it.

Here's the code:

    if (webform_variable_get('webform_email_replyto') &&
        empty($email['headers']['Reply-To']) &&
        ($default_from_name = webform_variable_get('webform_default_from_name')) &&
        ($default_from_address = webform_variable_get('webform_default_from_address')) &&
        ($default_from_parts = explode('@', $default_from_address)) &&
        count($default_from_parts) == 2 &&
        $default_from_parts[1] &&
        stripos($email['from'], '@' . $default_from_parts[1]) === FALSE) {
      // Message is not already being sent from the domain of the default webform from address.
      $email['headers']['Reply-To'] = $email['from'];
      // Match e-mails of the form 'My Name <email@domain.com>' as follows:
      // ^          = beginning of string
      // "?         = optional quote
      // ([^<]*?)   = match optional characters that aren't a < (non-greedy)
      // "?         = optional quote
      // SPACE*     = optional spaces
      // (?:<(.*)>) = < matching stuff > (without the angle brakets)
      // $          = end of string
      preg_match('/^"?([^<]*?)"? *(?:<(.*)>)?$/', $email['from'], $matches);
      $email['from'] = $matches && webform_variable_get('webform_email_address_format') == 'long'
                          ? t('"!name via !site_name" <!site_mail>',
                              array('!name' => empty($matches[1]) ? $matches[2] : $matches[1],
                                    '!site_name' => $default_from_name,
                                    '!site_mail' => $default_from_address))
                          : $default_from_address;
    }

You can see that the Reply-To is set to the From address, and then the From address is set to either the site address or the 'X via SITE_NAME' type address.

So for the Reply-To address to contain the "via" format, it must have been processed twice -- once by this code perhaps and then again by presumably another module.

If this isn't the case, please e-mail me the complete un-redacted headers, and the EXACT configuration of the From address, and the EXACT data in the component used for the FROM address in the webform definition.

Max2505’s picture

Hi Dan,

Thanks for the help. I've removed the webform reply-to module but it's still not ok.
I've forwarded the actual headers and the correct details on the setup.

Hope it can help you.

DanChadwick’s picture

Status: Postponed (maintainer needs more info) » Closed (works as designed)

I see 'X-Drupal-From' in your headers. This appears (from googling) to be from the Mail Headers module. I don't see that header anywhere in core or any of the contrib modules I use. That's your problem.

Also, you may be using the PHPMailer module to set the From address. That may also be a problem.

If you still have trouble, you'll have to debug this yourself. Or start with a completely clean installation with just, say, PHPMailer and start adding modules one at a time to see where the incompatibility is.

DanChadwick’s picture

Category: Bug report » Support request
philsward’s picture

I just disabled the Reply-To module on a 4.7 install, and I have no "reply-to" option any more. Am I missing something? The From is manually set to no-reply@domain.com, however upon disabling the reply-to module, the reply-to header goes away.

Checking the global webform settings, the reply-to header option is checked, but the site doesn't seem to be sending them anymore without the old separate module :-/

DanChadwick’s picture

In each mail setting, set the From address to be the address you want the reply to go to. Enable the global Reply To headers options. The From address will be used as the Reply To address and, if needed, the actual From address will be replaced with your default site address if it isn't already from the same domain.

philsward’s picture

@DanChadwick Ok, so per your description, I've tested it again and it is working more like I would expect. My "issue" was that I did not change the "E-mail from address" back to the "Email Address" component and instead left it as a custom "no-reply@..."

With the whole third party module doing one thing and core doing it another in a more "automatic" format, coming from the webform_reply_to module, hasn't been very straight forward since I expected core to work the same way. I see now that core works in a way that is far less obtrusive to the end-user and it "should" just work out of the box provided the default email address is setup.

Unfortunately, the documentation that is available on the migration, doesn't seem to outline the difference between the two and the "for dummy" steps that need to be taken to migrate.

On the same page. Thanks for the info and giving me the courage to test it again.

DanChadwick’s picture

Unfortunately, the documentation that is available on the migration, doesn't seem to outline the difference between the two and the "for dummy" steps that need to be taken to migrate.

Adding to the community documentation pages for webform would be a good way to help others. Hint, hint. :)

philsward’s picture

@DanChadwick Well, I thought about it, but the documentation issue is migrating from Webform Reply To -> Webform 4.3+. On a new install from someone who doesn't even know they NEED to setup the Reply To, there really isn't much to explain. Everything is done extremely well in the background.

As long as the default email is set, a name is set and the reply-to header option is checked in the global settings (checked by default?), everything else will work without the user ever knowing about it.

*sigh* I wrote up some instruction on the Webform Reply To module issue queue... I suppose I could add it to the docs over here... tdl;

:P