Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sympa does not like "`" chars in email addresses within include file #1217

Closed
agouaux opened this issue Jul 28, 2021 · 1 comment · Fixed by #1218
Closed

Sympa does not like "`" chars in email addresses within include file #1217

agouaux opened this issue Jul 28, 2021 · 1 comment · Fixed by #1218
Labels
Milestone

Comments

@agouaux
Copy link

agouaux commented Jul 28, 2021

I noticed error messages like this when sympa tried to sync an include file that had a "`" in the local part of the address. At first I was surprised that Office365 (location of our mailboxes) allowed it, but then I discovered that it was technically OK with the RFCs. (I can re-dig up the references I found if necessary.)

Jun 25 23:20:14 sympa01 sympa[53065]: err main::#849 > Sympa::Spindle::spin#95 > Sympa::Request::Handler::include::_twist#201 > Sympa::Request::Handler::include::_update_users#372 > Sympa::DataSource::next#149 > Sympa::DataSource::File::_next#75 Skip badly formed line: "first1`[email protected] First1` Last1"

Version

6.2.60

Installation method

Source (that locally build into our own rpm)

Expected behavior

I think so long as the "`" is in the local part, it should be considered ok, despite it being a bit odd.

Actual behavior

The sync of the include file never completes successfully.

Additional information

@ikedas ikedas added the bug label Jul 29, 2021
@ikedas
Copy link
Member

ikedas commented Jul 29, 2021

FYI.

Sympa

Currently, Sympa allows the local part of e-mail to include either:
0-9, a-z (case-insensitive), _, -, ., /, +, =, ' or &

or to match:
".*"

And it doesn't allow to include either:
|, $, *, ? nor !

sub valid_email {
my $email = shift;
my $email_re = Sympa::Regexps::email();
return undef unless $email =~ /^${email_re}$/;
# Forbidden characters.
return undef if $email =~ /[\|\$\*\?\!]/;
return 1;
}

# This is the same as email below except that it does never give any groups.
use constant addrspec => qr{(?:[-&+'./\w=]+|".*")\@[-\w]+(?:[.][-\w]+)+};
# Caution: If this regexp changes (more/less parenthesis), then regexp using
# it should also be changed. By this reason it would be obsoleted.
use constant email => qr'([\w\-\_\.\/\+\=\'\&]+|\".*\")\@[\w\-]+(\.[\w\-]+)+';

RFC

OTOH, RFC 5322 allows "dot-atom-text" below in local part (except when it is enclosed in "...") [1]:

   atext           =   ALPHA / DIGIT /    ; Printable US-ASCII
                       "!" / "#" /        ;  characters not including
                       "$" / "%" /        ;  specials.  Used for atoms.
                       "&" / "'" /
                       "*" / "+" /
                       "-" / "/" /
                       "=" / "?" /
                       "^" / "_" /
                       "`" / "{" /
                       "|" / "}" /
                       "~"

   atom            =   [CFWS] 1*atext [CFWS]

   dot-atom-text   =   1*atext *("." 1*atext)

   dot-atom        =   [CFWS] dot-atom-text [CFWS]

   specials        =   "(" / ")" /        ; Special characters that do
                       "<" / ">" /        ;  not appear in atext
                       "[" / "]" /
                       ":" / ";" /
                       "@" / "\" /
                       "," / "." /
                       DQUOTE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants