Page MenuHomePhabricator

Dot in user name prevents email through SMTP
Closed, ResolvedPublic

Description

Author: jen.parga

Description:
When a user is created that has a dot in the user name, such as jennifer.parga,
e-mails cannot be delivered through authenticated SMTP. I was able to locate
several instances of this.

  1. On Special:Userlogin, when creating a new account, it is possible to create a

user name with a dot when submitting through the "Create account" button.
However, when creating through the "by e-mail" button, the account is created in
the database, but the folowing error is displayed, and the e-mail is not delivered:

Login error:
Error sending mail: Failed to send data [SMTP: Invalid response code received
from server (code: 554, response: Error: no valid recipients)]

  1. On Special:UserLogin, when entering the username of a previously created

user with a dot in the name, and submitting the form through the "e-mail
password" button, no e-mail is delivered and the following error is displayed:

Login error:
Error sending mail: Failed to send data [SMTP: Invalid response code received
from server (code: 554, response: Error: no valid recipients)]

  1. After logging in as a user with a dot in the username, go to

Special:Preferences and click on the "Confirm your email address" link. Click
on the "Mail a confirmation code" button. No e-mail is delivered and the
following error is displayed:

Could not send confirmation mail. Check address for invalid characters.

Testing method:
I created two accounts. One had a user name with a dot, like jennifer.parga.
The other had no dot, like jparga. I used identical real name and e-mail
address information in both accounts. I confirmed that my SMTP setup is
correct, since I was able to receive e-mail with the jparga account. I also
tested several other pairs of accounts to ensure that there were no unprintable
characters in the user with the dot.


Version: 1.6.x
Severity: normal
OS: Linux
Platform: PC

Details

Reference
bz6243

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 9:18 PM
bzimport set Reference to bz6243.

Can you provide:

  • The package name & version of the e-mail server
  • The mail configuration you specified in LocalSettings.php if any
  • any other information about this setup which sounds relevant

jen.parga wrote:

The mail server is running on gentoo linux with postfix and cyrus-sasl providing
authenticated SMTP. The portage package of postfix that is installed is 2.2.5.
The version of cyrus-sasl is 2.1.20.

Here's the mail configuration in LocalSettings.php. Sorry, but I had to change
the actual values due to corporate privacy issues. We host our mail and provide
SMTP through the machine.subdomain.domain.edu address. Our email addresses are
the example.com addresses.

$wgEnableEmail = true;
$wgEnableUserEmail = true;

$wgEmergencyContact = "name@example.com";
$wgPasswordSender = "name@example.com";

$wgSMTP = array(

'host'          => "machine.subdomain.domain.edu",
'IDHost'        => "example.com",
'port'          => 25,
'auth'          => true,
'username'      => "login",
'password'      => "secret"

);

The smtpd.conf for sasl is:

pwcheck_method: saslauthd
mech_list: plain login

The relevant section in main.cnf for postfix is:

smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
smtpd_sasl_local_domain =
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions = permit_sasl_authenticated, reject_unauth_destination

Fixed on trunk in r14676. The changes to UserMailer.php should
apply cleanly to the 1.6 release (follow the link to the change
list).