Edgewall Software
Modify

Opened 15 years ago

Closed 15 years ago

Last modified 15 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@… Branch:
Release Notes:
API Changes:
Internal 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@…> 15 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@… 15 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@… 15 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 by Christian Boos, 15 years ago

Keywords: verify added
Milestone: 0.12.1

comment:2 by Remy Blank, 15 years ago

Keywords: bitesized added

by Guy Rozendorn <guy@…>, 15 years ago

Attachment: prefs_ui.patch added

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

comment:3 by Remy Blank, 15 years ago

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?

by mark.m.mcmahon@…, 15 years ago

Attachment: rename_with_page_save.diff added

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

comment:4 by mark.m.mcmahon@…, 15 years ago

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

by mark.m.mcmahon@…, 15 years ago

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

comment:5 by mark.m.mcmahon@…, 15 years ago

Sorry - attached the wrong file :(

Correct patch uploaded (attachment:prefs_web_ui_and_notification.patch)

comment:6 by mark.m.mcmahon@…, 15 years ago

Cc: mark.m.mcmahon@… added

comment:7 by Remy Blank, 15 years ago

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 by Remy Blank, 15 years ago

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 by Remy Blank, 15 years ago

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

comment:10 by mark.m.mcmahon@…, 15 years ago

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 by Remy Blank, 15 years ago

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. Next status will be 'reopened'.
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.