#8699 closed defect (fixed)
Space in the end of e-mail address prevents sending notification
| Reported by: | Sadman | Owned by: | |
|---|---|---|---|
| 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)
Change History (14)
comment:1 by , 16 years ago
| Keywords: | verify added |
|---|---|
| Milestone: | → 0.12.1 |
comment:2 by , 16 years ago
| Keywords: | bitesized added |
|---|
by , 16 years ago
| Attachment: | prefs_ui.patch added |
|---|
comment:3 by , 16 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 , 16 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 , 16 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 , 16 years ago
| Attachment: | prefs_web_ui_and_notification.patch added |
|---|
Patch to work around spaces in email addresses (only at the start or end) (the right one!)
comment:5 by , 16 years ago
Sorry - attached the wrong file :(
Correct patch uploaded (attachment:prefs_web_ui_and_notification.patch)
comment:6 by , 16 years ago
| Cc: | added |
|---|
comment:7 by , 16 years ago
| Milestone: | next-minor-0.12.x → 0.12 |
|---|---|
| Owner: | changed from to |
Patch looks good, I'll test and apply.
comment:8 by , 16 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
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 , 16 years ago
| Owner: | changed from to |
|---|
comment:10 by , 16 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.



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