Edgewall Software

Ticket #7385 (closed enhancement: fixed)

Opened 2 months ago

Last modified 6 weeks 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:

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

  Changed 2 months ago by eblot

  • status changed from new to closed
  • resolution set to worksforme

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.

  Changed 2 months ago by anonymous

  • status changed from closed to reopened
  • version set to 0.11-stable
  • resolution worksforme deleted

OK, thought admit_domains was a bool and not a string

  Changed 2 months 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.

  Changed 6 weeks ago by novalis@…

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

in reply to: ↑ description   Changed 6 weeks 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.

  Changed 6 weeks ago by cboos

  • keywords domain added
  • owner changed from eblot to cboos
  • status changed from reopened to new
  • milestone set to 0.11.1

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).

  Changed 6 weeks ago by cboos

  • status changed from new to closed
  • resolution set to fixed

New regexp added in [7400].

Add/Change #7385 (Error with local email addresses)

Author



Change Properties
<Author field>
Action
as closed
Next status will be 'reopened'
 
Note: See TracTickets for help on using tickets.