Manual talk:UserMailer.php

About this board

email address is misinterpreted

1
DonPaolo (talkcontribs)

Mediawiki 1.31.1

Hi! I'm using this class in a custom extension, i'm invoking the command

UserMailer::send( $targetAddress, $submitterAddress, $subject, $this->text, $options );

The parameters has their correct object type, and the email is sent via php's mail() function.

But the mail is sent in a wrong way, because I get a return mail saying:


This is the mail system at host provider.org.

I'm sorry to have to inform you that your message could not be delivered to one or more recipients. It's attached below.

For further assistance, please send mail to postmaster.

If you do so, please include this problem report. You can delete your own text from the attached returned message.

                   The mail system

<"<user"@provider.org>>: bad address syntax

<WikiSysop@provider.org> (expanded from <WikiSysop>): unknown user:     "wikisysop"

- - - - - - - - - - Forwarded message - - - - - - - - - -

From: "my message to user"@provider.org, ">" <"<user"@provider.org>

To: WikiSysop@provider.org, ">" <"<user"@provider.org>

Cc: ecc.


The parameters passed to UserMailer::send have not any double quotes.

Why is the email address misinterpreted? it didn't happen in mediawiki 17

Reply to "email address is misinterpreted"

How do I set the Return-Path header?

3
DonPaolo (talkcontribs)
87.123.5.103 (talkcontribs)
87.123.5.103 (talkcontribs)

Another option is the modify it in the AlternateUserMailer hook, where it is inside the $header variable as $headers['Return-Path'] . Ayway, the UserMailerChangeReturnPath hook was added especially for adjusting the return path, so I'd recommend using that one!

Reply to "How do I set the Return-Path header?"
There are no older topics