Personal contatct form uses global site email as sender

Created on 24 January 2023, almost 2 years ago
Updated 14 April 2023, over 1 year ago

Problem/Motivation

When a user send a message to another user using the personal contact form, the mail gets the site-wide system email as sender instead of the one of the user-sender.

Steps to reproduce

Actually I don't know: it used to work properly. I cannot guess when it started and I don't know how turn back to the correct behaviour

💬 Support request
Status

Closed: cannot reproduce

Version

9.5

Component
Contact 

Last updated 4 days ago

Created by

🇮🇹Italy Maravizzo

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @Maravizzo
  • Status changed to Postponed: needs info almost 2 years ago
  • 🇦🇺Australia larowlan 🇦🇺🏝.au GMT+10

    Can you provide steps to reproduce on vanilla Drupal?

  • 🇮🇹Italy Maravizzo

    Hi Iarowlan,
    No, actually I cannot. My website had been working fine for almost two years, only few days ago some users pointed out that they were not able any more to reply each-other.
    I tried a vanilla install on the same server and it works fine.
    Then cloned the website and there I got the problem on the clone too.
    On the clone I've then unistalled the mail System module and then the Contact module. Then I've flushed the cache and reinstalled only the Contact module and still the problem is there.
    Furthermore in the last couple of month I think I didn't change anything in the configuration: I just kept everything updated and added some content... I really cannot figure out what could be the origin of the problem.

  • Status changed to Active almost 2 years ago
  • 🇦🇺Australia pameeela

    Hi @Maravizzo are you talking about the reply-to value, or actually sending the email from the user's email address?

  • 🇦🇺Australia pameeela

    I just tested and it does set the reply-to value to the sending user's email, but the 'from' address has to be the site email. Your site cannot send emails from any arbitrary email address, that would be open to abuse and basically make your site a spam farm.

  • 🇮🇳India Manoj Raj.R Chennai

    Yes i agree with @pameela

    ..

    Your site cannot send emails from any arbitrary email address, that would be open to abuse and basically make your site a spam farm.

  • 🇮🇹Italy Maravizzo

    Interesting point, looking at a message source actually I see:

    X-Mailer: Drupal Sender: no-replay@trovarsiora.it
    From: Trovarsi Ora
    Reply-to: the_right_address@gmail.com
    Message-Id:
    From: no-replay@trovarsiora.it

    So the "Replay-to" is set up correctly, but, for some reason, it doesn't shows up any more neither in Gmail nor Thunderbird unless you open the source of the email.
    Then both Gmail and Thuderbird replay to the sender/from address instead of the replay-to address

  • Status changed to Postponed: needs info almost 2 years ago
  • 🇦🇺Australia larowlan 🇦🇺🏝.au GMT+10

    Are you using any other mail delivery modules, e.g. webform, mimemail, swiftwmailer or symfony mailer?

    I've looked back at the codebase and we've been setting the 'Sender' header to match the from header for at least 13 years (e.g. here's the code in D6) https://git.drupalcode.org/project/drupal/-/blame/6.x/includes/mail.inc#...

  • 🇮🇹Italy Maravizzo

    I used to have swiftmailer installed, but things were working ok for about two years.
    After getting this problem I unistalled everything and then reinstalled only the vanilla contact module

  • Status changed to Active almost 2 years ago
  • Status changed to Postponed: needs info almost 2 years ago
  • 🇦🇺Australia pameeela

    @Maravizzo there is no way to assist, let alone fix the issue, without steps to reproduce it.

    I've tried twice now in vanilla Drupal without any mail modifications and it works as expected. So I'm moving this to a support request.

    Here are the headers from my working example, it includes the sender parameter:

    X-Mailer: Drupal
    Sender: info@[redacted - site email]]
    From: Site Name <info@[redacted - site email]]>
    Reply-to: pam@[redacted - email of message sender]
    Message-Id: <20230202004925.5BC18188371F8@[redacted]>

    In your not-working example, there are two 'From' headers, which is not the default behaviour -- so there must be something in your setup causing this.

  • 🇮🇹Italy Maravizzo

    Ok, thank you, at least now I know where the problem is, in the last "From".
    If I find a solution I'll publish it here

  • Status changed to Closed: cannot reproduce over 1 year ago
Production build 0.71.5 2024