Edgewall Software

Opened 13 years ago

Last modified 13 years ago

#9898 closed defect

= considered a valid character in email address but causing problems with certificates — at Initial Version

Reported by: Michel Jouvin <jouvin@…> Owned by:
Priority: normal Milestone: 0.12.2
Component: notification Version: 0.12.1
Severity: normal Keywords: patch
Cc: Thijs Triemstra Branch:
Release Notes:
API Changes:
Internal Changes:

Description

Notification module (trac/notification.py) uses a regular expression EMAIL_LOOKALIKE_PATTERN to extract email from connection name, if any is defined. For the email local part, the valid characters include in particular =. This is may be valid from a RFC point of view but I have never seen it used in an email address local part and this is causing problems with certificates whose DN contains the attribute /emailAddress=.... In this case, an email address is found in the connection name (which in principle is fine) but the email address extracted is emailAddress=... instead of the email itself.

For example the DN of my certificate is:

/C=FR/O=CNRS/OU=UMR8607/CN=Michel Jouvin/emailAddress=jouvin@lal.in2p3.fr

and results in notifications to be sent to emailAddress=jouvin@lal.in2p3.fr instead of jouvin@lal.in2p3.fr which obviously results in a failure.

This is a major problem if a user with such a connection name tries to define its email address in the preferences. In this case, he will not be able to connect to the project until the session attributes are removed from the database.

If removal of = from valid characters is considered acceptable an easy fix is:

Index: notification.py
===================================================================
--- notification.py     (revision 10358)
+++ notification.py     (working copy)
@@ -29,7 +29,7 @@
 MAXHEADERLEN = 76
 EMAIL_LOOKALIKE_PATTERN = (
         # the local part
-        r"[a-zA-Z0-9.'=+_-]+" '@'
+        r"[a-zA-Z0-9.'+_-]+" '@'
         # the domain name part (RFC:1035)
         '(?:[a-zA-Z0-9_-]+\.)+' # labels (but also allow '_')
         '[a-zA-Z](?:[-a-zA-Z\d]*[a-zA-Z\d])?' # TLD

Change History (0)

Note: See TracTickets for help on using tickets.