Edgewall Software
Modify

Opened 9 years ago

Closed 8 years ago

Last modified 8 years ago

#8699 closed defect (fixed)

Space in the end of e-mail address prevents sending notification

Reported by: Sadman Owned by: mark.m.mcmahon@…
Priority: low Milestone: 0.12
Component: notification Version: 0.11.1
Severity: normal Keywords: verify bitesized
Cc: mark.m.mcmahon@…
Release Notes:
API Changes:

Description

In preferences you can add a space by accident in the end of e-mail address (due to copy-pasting it for exapmle), after this you'll get no notifications from trac. Not a big problem, but: you have no check/warning at input, also in admin tab e-mail looks ok, without spaces.

In mail logs you see notification mailed ok for everybody except "spaced" e-mail, which is confusing as well.

Attachments (3)

prefs_ui.patch (558 bytes ) - added by Guy Rozendorn <guy@…> 8 years ago.
patch proposal: doing strip() on the email address in submission
rename_with_page_save.diff (139.5 KB ) - added by mark.m.mcmahon@… 8 years ago.
Patch to work around spaces in email addresses (only at the start or end)
prefs_web_ui_and_notification.patch (1.7 KB ) - added by mark.m.mcmahon@… 8 years ago.
Patch to work around spaces in email addresses (only at the start or end) (the right one!)

Download all attachments as: .zip

Change History (14)

comment:1 Changed 9 years ago by Christian Boos

Keywords: verify added
Milestone: 0.12.1

comment:2 Changed 8 years ago by Remy Blank

Keywords: bitesized added

Changed 8 years ago by Guy Rozendorn <guy@…>

Attachment: prefs_ui.patch added

patch proposal: doing strip() on the email address in submission

comment:3 Changed 8 years ago by Remy Blank

That patch probably won't work, as you can't have an elif: after an else:.

Stripping in the preferences is a good idea. However, there may already be addresses with spaces in the session table. Could you also add stripping in the notification code, where the addresses are used?

Changed 8 years ago by mark.m.mcmahon@…

Attachment: rename_with_page_save.diff added

Patch to work around spaces in email addresses (only at the start or end)

comment:4 Changed 8 years ago by mark.m.mcmahon@…

I tried my hand at updating this as requested. I updated the regular expressions in notification.py to include \s* (no extra strip()s were required)

Please review the patch prefs_web_ui_and_notification.patch

Changed 8 years ago by mark.m.mcmahon@…

Patch to work around spaces in email addresses (only at the start or end) (the right one!)

comment:5 Changed 8 years ago by mark.m.mcmahon@…

Sorry - attached the wrong file :(

Correct patch uploaded (attachment:prefs_web_ui_and_notification.patch)

comment:6 Changed 8 years ago by mark.m.mcmahon@…

Cc: mark.m.mcmahon@… added

comment:7 Changed 8 years ago by Remy Blank

Milestone: next-minor-0.12.x0.12
Owner: changed from Emmanuel Blot to Remy Blank

Patch looks good, I'll test and apply.

comment:8 Changed 8 years ago by Remy Blank

Resolution: fixed
Status: newclosed

Patch works great, applied (slightly changed, to generally strip all fields in the preferences) in [9346], together with some tweaks to the tests to check that the stripping is actually done. Thanks!

comment:9 Changed 8 years ago by Remy Blank

Owner: changed from Remy Blank to mark.m.mcmahon@…

comment:10 Changed 8 years ago by mark.m.mcmahon@…

Hard to validate now as it is working :).

I updated, but was not able to add an email address with a space (I don't have Twill installed).

I did the following:

c:\> sqlite3.exe trac.db

sqlite> update ticket set cc = ' mark.xxxxx@xxxx.com , marky < mxxxxxx@xxx.com  > ' where id=1;

Then I modified the ticket in Trac, and received correctly emails to the two email addresses specified.

comment:11 Changed 8 years ago by Remy Blank

Thanks for checking!

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain mark.m.mcmahon@….
The resolution will be deleted.
to The owner will be changed from mark.m.mcmahon@… to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.