Email notifications have varying From addresses (e.g. the ticket submitter). Notifications should have a Sender:
header specified which refers to the system sending rather than the end-user we're doing it on behalf of.
This should be a stable value so that it can be used in mail filters (e.g. mailman). Perhaps the tool's email address would work well. Test how common clients (e.g. gmail) display it and if it affects replies at all.
The incorrect
From:
address is also causing mail filters (e.g. gmail) to regard it as not verifiably from the sender.Is there a way to configure sandbox to send an emails, so that we could test how gmail and other would display this?
Created #447: [#6249] Use a stable Sender: header in email notifications (2cp)
Related
Tickets:
#6249Closed #447.
je/42cc_6249
Don't sure what you've meant by "tool's email address", I did find only emails for individual tickets in the code, so I'm constructing tool's address similar to that.
For this to work you need to change exim configuration slightly (by default exim strips Sender: header from emails). The following worked for me on a sandbox:
Looks good, but I would like to see a doc string and test for
Application.email_address
. Keep in mind that it's possible (as far as I can tell from reading the code) that the Application's url might not start with a/
(it could be an absolute url).Take a look at
Ticket.email_address
(ForgeTracker/forgetracker/model/ticket.py:def email_address
). It takes similar approach to construct email address, it also assumes that url starts with a/
. Should we add logic to handle absolute url there too?Created #453: [#6249] Add docstring and test for Application.email_address (1cp)
Related
Tickets:
#6249Good point, I didn't realize this logic was already in use. Let's leave the logic as-is, but still add a test and docstring.
I've created [#6756] for removing Neighborhood absolute urls.
Related
Tickets: #6756
Closed #453.
je/42cc_6249
Well the tests all pass, but I'm not seeing a
Sender:
header in any of my notification emails when testing. A couple examples:Not sure if I'm missing something...can you provide instructions for how you tested?
One more thing - I noticed some direct calls to
sendmail.post()
inforgetracker/model/ticket.py
. Seems like those wouldn't ever get the newSender:
header?Did you make changes to exim config, as I pointed out here?
Yep, they wouldn't. We can set
Sender:
to some site-wide address inside mail_util.SMTPClient.sendmail, ifsender
parameter isn't specified, or go ahead and fix all manual calls tosendmail
andsendsimplemail
to include sender parameter. Not sure which way is better.Gah, sorry, I missed the exim config changes - will retest.
I think we should pass
sender
to those directsendmail
calls, since we'll want to usec.app.email_address
and not a generic site address.Created #464: [#6249] Set sender to app's email address in direct sendmail calls (1cp)
Related
Tickets:
#6249Closed #464.
Rebased on master and force pushed
je/42cc_6249
Validation: test replies in prod after push.