-
Notifications
You must be signed in to change notification settings - Fork 263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement Reply-To header support when replying #8880
Implement Reply-To header support when replying #8880
Conversation
Thanks for opening your first pull request in this repository! ✌️ |
This has been tested based upon a production instance dataset with both Tested on Nextcloud 25.0.9, the commit being directly on top of Mail 2.2.7. This would need to be forward-ported to newer stables and main if accepted. |
6d5d225
to
e1d75c0
Compare
Rebased on top of |
Thanks a lot Please rebase to main. We will backport the fix to stable branches. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good so far
e1d75c0
to
e66871c
Compare
@ChristophWurst Thanks for the info, rebased on top of I don't have a dev setup for latest Nextcloud set up so cannot test if there are behaviour changes that influence this, do you have a way to check? Here is patch for Cheers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested ✅
@ChristophWurst @GretaD Is there anything that still needs checking or that I need to change? Just checking in case it's stuck somewhere, no particular rush to get this merged. Though I would appreciate it if it could be in the next release version as I'm currently patching in production as a workaround. |
@ChristophWurst @GretaD I took some time to check the failing test, which is:
I am not sure if this is easily fixable in the template. Possibly it is just an empty
This means that when passing data around, Horde will automagically populate the I see some options:
Your thoughts on this? I'm not too familiar with the test framework so feel free to push any changes directly. Could also fix this specific test for now and leave the above for another day? Thanks! |
@ChristophWurst Revisiting this after a while, I'm thinking it might be best to update the test to exclude The actual implementation now has been tested and does work correctly, I'd like to ship this to more users asap. Your thoughts? Thanks! |
Any help would be really appreciated, I'd love to see this merged so that other users can use the fix as well. Again it's purely the way works tests work I'm not sure how to make it ignore the |
diff --git a/tests/Unit/Model/IMAPMessageTest.php b/tests/Unit/Model/IMAPMessageTest.php
index 29f9c7ecd..1390a3831 100644
--- a/tests/Unit/Model/IMAPMessageTest.php
+++ b/tests/Unit/Model/IMAPMessageTest.php
@@ -147,6 +147,7 @@ class IMAPMessageTest extends TestCase {
'to' => [ [ 'label' => '[email protected]', 'email' => '[email protected]' ] ],
'cc' => [ [ 'label' => '[email protected]', 'email' => '[email protected]' ] ],
'bcc' => [ [ 'label' => '[email protected]', 'email' => '[email protected]' ] ],
+ 'replyTo' => [ [ 'label' => '[email protected]', 'email' => '[email protected]' ] ],
'subject' => 'subject',
'dateInt' => 1451606400,
'flags' => [ that will satisfy the tests |
07b78f4
to
318124f
Compare
The Reply-To header, if present, will take precedence over the From header. If the Reply-To data is undefined old behaviour is used. Note that Horde libraries appear to internally determine reply_to property in the Horde_Imap_Client_Data_Envelope (unless Dovecot does it, but doubt). It was observed that reply_to property had the same value as from property in a mail that contained no Reply-To header. It is assumed that the Horde implementation makes sense, so just use the value as-is. This notably fixes replying to mail from software reliant on the Reply-To header such as GitLab and GitHub notifications and many types of mail based ticketing (support) systems. Signed-off-by: Melvin Vermeeren <[email protected]>
318124f
to
f197df2
Compare
@ChristophWurst Many thanks for the test fix, seems so obvious in hindsight I must have overlooked this somehow. Cheers! |
Hello there, We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process. Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6 Thank you for contributing to Nextcloud and we hope to hear from you soon! |
The Reply-To header, if present, will take precedence over the From header. If the Reply-To data is undefined old behaviour is used.
Note that Horde libraries appear to internally determine reply_to property in the Horde_Imap_Client_Data_Envelope (unless Dovecot does it, but doubt). It was observed that reply_to property had the same value as from property in a mail that contained no Reply-To header. It is assumed that the Horde implementation makes sense, so just use the value as-is.
This notably fixes replying to mail from software reliant on the Reply-To header such as GitLab and GitHub notifications and many types of mail based ticketing (support) systems.
Closes #4075
Closes #7538