Description
Martin Renvoize (ashimema)
2019-05-01 15:31:48 UTC
I am more than happy to mentor someone who might like to work on this, just reach out here or on IRC (I'm ashimema there) I think our library is experiencing this bug. When a patron submits a note on an item through the OPAC, Koha sends the email to make it look like it came from the patron's email address. We are able to receive these emails if it is a patron email with the same domain (lancasterseminary.edu). A patron from a different domain (e.g., yahoo.com) had their OPAC note email returned to them because it couldn't be authenticated as coming from their domain. OPAC note emails need to come from the email address set in Koha admin instead of trying to look like they came from the patron. Are we on the same page, Martin? Or do I need to submit this as a separate bug? Thanks, Myka Hi Myka, I think you are indeed experiencing this bug.. well.. half of it at least, I appear to explain two issues I suspect to be happening. I must admit, I had hoped someone would pick this up nearer the time I reported it.. I did try to encourage a few people to take a look. I'll try and put a quick patch together myself if you're willing to test it. Created attachment 99559 [details] [review] Bug 22821: Add reply_address field to message_queue table Created attachment 99560 [details] [review] Bug 22821: Schema Update Created attachment 99561 [details] [review] Bug 22821: Use 'reply-to' address in issue notes This patch updates the issue notices to not pass from_address and so default to the branch email of the user for from_address. We now pass the patrons email (cascading through email, emailpro, B_email) into the reply_address field so mail servers are less likely to report emails as spam and mail clients still have access to the patron address via the reply-to header when staff want to hit 'reply' and have the email go to the user. Created attachment 99562 [details] [review] Bug 22821: Correct to_address for issue notes This patch updates the controller and service code to use the newly introduced 'get_effective_email' routine from bug 22823 to obtain the branches most appropriate email address. Created attachment 99563 [details] [review] Bug 22821: Add reply_address field to message_queue table Created attachment 99564 [details] [review] Bug 22821: Schema Update Created attachment 99565 [details] [review] Bug 22821: Use 'reply-to' address in issue notes This patch updates the issue notices to not pass from_address and so default to the branch email of the user for from_address. We now pass the patrons email (cascading through email, emailpro, B_email) into the reply_address field so mail servers are less likely to report emails as spam and mail clients still have access to the patron address via the reply-to header when staff want to hit 'reply' and have the email go to the user. Created attachment 99566 [details] [review] Bug 22821: Correct to_address for issue notes This patch updates the controller and service code to use the newly introduced 'get_effective_email' routine from bug 22823 to obtain the branches most appropriate email address. Created attachment 99732 [details] [review] Bug 22821: Add reply_address field to message_queue table Signed-off-by: Myka Kennedy Stephens <mkstephens@lancasterseminary.edu> Created attachment 99733 [details] [review] Bug 22821: Schema Update Signed-off-by: Myka Kennedy Stephens <mkstephens@lancasterseminary.edu> Created attachment 99734 [details] [review] Bug 22821: Use 'reply-to' address in issue notes This patch updates the issue notices to not pass from_address and so default to the branch email of the user for from_address. We now pass the patrons email (cascading through email, emailpro, B_email) into the reply_address field so mail servers are less likely to report emails as spam and mail clients still have access to the patron address via the reply-to header when staff want to hit 'reply' and have the email go to the user. Signed-off-by: Myka Kennedy Stephens <mkstephens@lancasterseminary.edu> Created attachment 99735 [details] [review] Bug 22821: Correct to_address for issue notes This patch updates the controller and service code to use the newly introduced 'get_effective_email' routine from bug 22823 to obtain the branches most appropriate email address. Signed-off-by: Myka Kennedy Stephens <mkstephens@lancasterseminary.edu> These patches seem to fix the problem. Here was my test plan: 1. Created a simple SQL report (SELECT * FROM message_queue) 2. Ran report - results empty, no reply_address field 3. Applied patches 4. Restarted everything, updatedatabase, dbic 5. Ran report - results empty, new reply_address field appeared 6. Enabled AllowCheckoutNotes 7. Checked out an item to user with email address 8. Logged into OPAC as user 9. Entered a note for checked out item 10. Ran report - note email in results with user's email address appearing in reply_address field Thank you, Martin! Excellent testing Myka, thankyou :) I'm going to move the reply-to handling into a submission for bug 10269 as that way it can then be a simple dependency for a bunch of other bugs that want it. Created attachment 99908 [details] [review] Bug 22821: Use 'reply-to' address in issue notes This patch updates the issue notices to not pass from_address and so default to the branch email of the user for from_address. We now pass the patrons email (cascading through email, emailpro, B_email) into the reply_address field so mail servers are less likely to report emails as spam and mail clients still have access to the patron address via the reply-to header when staff want to hit 'reply' and have the email go to the user. Signed-off-by: Myka Kennedy Stephens <mkstephens@lancasterseminary.edu> Created attachment 99909 [details] [review] Bug 22821: Correct to_address for issue notes This patch updates the controller and service code to use the newly introduced 'get_effective_email' routine from bug 22823 to obtain the branches most appropriate email address. Signed-off-by: Myka Kennedy Stephens <mkstephens@lancasterseminary.edu> 84 my $to_address = $branch->branchemail || $branch->branchreplyto || C4::Context->ReplytoDefault || C4::Context->preference('KohaAdminEmailAddress'); The C4::Context->ReplytoDefault was super wrong! Created attachment 100938 [details] [review] Bug 22821: Use 'reply-to' address in issue notes This patch updates the issue notices to not pass from_address and so default to the branch email of the user for from_address. We now pass the patrons email (cascading through email, emailpro, B_email) into the reply_address field so mail servers are less likely to report emails as spam and mail clients still have access to the patron address via the reply-to header when staff want to hit 'reply' and have the email go to the user. Signed-off-by: Myka Kennedy Stephens <mkstephens@lancasterseminary.edu> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Created attachment 100939 [details] [review] Bug 22821: Correct to_address for issue notes This patch updates the controller and service code to use the newly introduced 'get_effective_email' routine from bug 22823 to obtain the branches most appropriate email address. Signed-off-by: Myka Kennedy Stephens <mkstephens@lancasterseminary.edu> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Created attachment 100940 [details] [review] Bug 22821: Rename method with ->inbound_email_address The method has been renamed in the previous bug report. Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Created attachment 100944 [details] [review] Bug 24722: reserves.priority must default to 1 at DB level Nice work everyone! Pushed to master for 20.05 Nice work everyone! Pushed to master for 20.05 I feel the description of the bug is not correct on this one, but not sure what it should be changed to - Martin, could you have a look? Given it a go with what I think it does - feel free to correct :) not backported to 19.11.x due to dependencies |