View Issue Details

IDProjectCategoryView StatusLast Update
0012171mantisbtadministrationpublic2013-08-09 13:50
Reporterfman Assigned Todregad  
PriorityhighSeveritymajorReproducibilityalways
Status closedResolutionno change required 
Product Version1.2.1 
Summary0012171: User Create - user mail like : john.doe@partners.mydomain.com are not accepted
Description

When creating/updating an user with mail like:
john.doe@partners.mydomain.com

Mantis always complain saying email is not valid

TagsNo tags attached.

Relationships

related to 0014543 closeddregad Emails are not sent to addresses with single subdomain 

Activities

atrol

atrol

2013-05-30 16:34

developer   ~0037011

This issue is not reproducible with the current version of MantisBT.

We recommend that you upgrade to the latest stable version [1]; if after doing so the problem persists, do not hesitate to reopen the issue, with additional relevant information.

[1] https://sourceforge.net/projects/mantisbt/files/mantis-stable/

fman

fman

2013-05-31 01:23

reporter   ~0037015

I've done following tests (on 1.2.15) and seems there is something weird

Create a new user

  1. a.c@ccc.ccc.com => this mail does not exists => mantis said OK

Update it

  1. a.c@ccc.gmail.com => this mail does not exists => KO

I do not know if mantis tries to do some checks on mail domain trying to contact the server, and because in situation 2 gmail.com exists but ccc.gmail.com NO it fails.

I've tried with my real existent domain partners.gruppotesi.com, but got KO

I'm going to do some checks with sysadmin

thanks

Lapinkiller

Lapinkiller

2013-05-31 03:14

reporter   ~0037017

tested on mantisbt.org/demo :

TEST 1
login : test12171
email test12171@ccc.mantisbt.org
=> OK

TEST 2
login : test12171-2
email test12171-2@ccc.gmail.com
=> NOK
=> I got during 2secs error message "Invalid email" and i had been automatically redirected on error message "invalid form token"

atrol

atrol

2013-05-31 05:13

developer   ~0037018

fman, lapinkiller
please run this script and provide the results


<?php
echo PHP_VERSION, '
';
var_dump( filter_var( 'a.c@ccc.ccc.com', FILTER_VALIDATE_EMAIL ) ); echo '
';
var_dump( filter_var( 'a.c@ccc.gmail.com', FILTER_VALIDATE_EMAIL ) ); echo '
';
var_dump( filter_var( 'test12171@ccc.mantisbt.org', FILTER_VALIDATE_EMAIL ) ); echo '
';
var_dump( filter_var( 'test12171-2@ccc.gmail.com', FILTER_VALIDATE_EMAIL ) ); echo '
';
var_dump( filter_var( 'root@localhost', FILTER_VALIDATE_EMAIL ) );

dregad

dregad

2013-05-31 11:03

developer   ~0037019

@Lapinkiller

I think your 'TEST 2' fails because http://mantisbt.org/demo performs both an MX record and a DNS check as part of the email validation. ccc.gmail.com not having any valid MX records and not being a valid domain, that fails, while for some reason the getmxrr() call for 'ccc.mantisbt.org' returns true

Not sure about the invalid token error though, I would expect Mantis to stop at the first error, but I have no time to investigate atm.

fman

fman

2013-07-29 03:26

reporter   ~0037544

I'm sorry for the delay, here i results

5.4.7

string(15) "a.c@ccc.ccc.com"
string(17) "a.c@ccc.gmail.com"
string(26) "test12171@ccc.mantisbt.org"
string(25) "test12171-2@ccc.gmail.com"
bool(false)

fman

fman

2013-07-29 03:50

reporter   ~0037545

I've set $g_check_mx_record = OFF; on my installation to make things work.

dregad

dregad

2013-07-29 04:37

developer   ~0037546

I've set $g_check_mx_record = OFF; on my installation to make things work.

Does that mean we can resolve this issue ?

fman

fman

2013-07-29 08:01

reporter   ~0037551

I do not know if you can set it to solved, because It would be great if possible to understand why MX is failing.

I will be also interested in understand if results I've posted on note 37544 has providing you some clues. i.e. results are ok ?

best regards

atrol

atrol

2013-07-29 09:03

developer   ~0037552

I asked for the results because the PHPMailer version which is bundled with MantisBT 1.2.15 uses PHP function filter_var to validate the address.
This PHP function delivers questionable results (e.g. see your own result that root@localhost is not considered to be a valid e-mail address [1])
Your results show, that filter_var was not the reason for your validation problem.

The newer version of PHPMailer which will be part of MantisBT 1.2.16 does no longer use filter_var.

[1] https://bugs.php.net/bug.php?id=49576

dregad

dregad

2013-07-29 10:00

developer   ~0037553

See 0014543 for the resolution of single domains emails

It would be great if possible to understand why MX is failing

MX is not 'failing'. The getmxrr() return value depends on how the domains' servers are setup, this has nothing to do with MantisBT itself. So your options are either

  • fix your domain's DNS settings so that partners.mydomain.com is registered as a valid MX record
  • ignore this check by setting $g_check_mx_record = OFF as you have done.