Edgewall Software
Modify

Ticket #7385 (closed enhancement: fixed)

Opened 4 years ago

Last modified 4 years ago

Error with local email addresses

Reported by: koch@… Owned by: cboos
Priority: normal Milestone: 0.11.1
Component: notification Version: 0.11-stable
Severity: normal Keywords: domain
Cc:
Release Notes:
API Changes:

Description

When the email address for user yy is taken from the email_map and result in

yy@xx.local

notification will not work. Because

File notification.py
EMAIL_LOOKALIKE_PATTERN = (r"[a-zA-Z0-9.'=+_-]+" '@'
                            '(?:[a-zA-Z0-9_-]+\.)+[a-zA-Z]{2,4}')

refuse this email address to be a valid email address.

Better would be {2,5}

EMAIL_LOOKALIKE_PATTERN = (r"[a-zA-Z0-9.'=+_-]+" '@'
                            '(?:[a-zA-Z0-9_-]+\.)+[a-zA-Z]{2,5}')

Attachments

Change History

comment:1 Changed 4 years ago by eblot

  • Resolution set to worksforme
  • Status changed from new to closed

You have not specified a Trac version, so I assume you're using the last one (0.11)

Use admit_domains in the [notification] section of trac.ini to tell Trac to accept the "xx.local" domain.

comment:2 Changed 4 years ago by anonymous

  • Resolution worksforme deleted
  • Status changed from closed to reopened
  • Version set to 0.11-stable

OK, thought admit_domains was a bool and not a string

comment:3 Changed 4 years ago by anonymous

  • Type changed from defect to enhancement

The trouble came up while upgrading from Trac 0.10.4 to 0.11. I was expecting that trac will work in the same manner as before (with yy.local for notifications).
When notifactions did not work it take me about an hour to isolate the problem was the yy.local domain.

May be a small remark during setup or in the upgrade hints would be helpfull.

comment:4 Changed 4 years ago by novalis@…

Actually, the code also doesn't work for <a href="http://www.museum/">.museum</a> addresses.

comment:5 in reply to: ↑ description Changed 4 years ago by info@…

I had the very same problem today when I upgraded our trac installation from 0.10.4 to 0.11. It took me about an hour including trying different mail servers to find out, what the real problem was. What made it worse was the lack of messages in the browser window.

No notifications is a bad situation, but trac-0.11 requires verified mail addresses to work. So users with a .local address could not use trac until this problem was fixed. That's worse. Not to mention an unusable webadmin plugin.

comment:6 Changed 4 years ago by cboos

  • Keywords domain added
  • Milestone set to 0.11.1
  • Owner changed from eblot to cboos
  • Status changed from reopened to new

Ok, the limit to 4 characters for the toplevel domain name (TLD) is plain wrong, see for example rfc:3696#section-2.

I've come up with a more correct regexp for the TLD part: [a-zA-Z](?:[-a-zA-Z\d]*[a-zA-Z\d])? (this matches a label according to rfc:1035#section-2.3.1).

I think we should nevertheless keep the more lax regexp for the host name, as having '_' in the name is probably a common error in intranets.

The above is in the context of ascii TLDs. An even more interesting refinement would be to support internationalized e-mail addresses, and it looks like Python has all what's needed to handle that conveniently (encodings.idna).

comment:7 Changed 4 years ago by cboos

  • Resolution set to fixed
  • Status changed from new to closed

New regexp added in [7400].

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
to The owner will be changed from cboos. Next status will be 'closed'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.