Skip to content
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

[XWIKI-20109] Notification headers for autoreplies #1907

Closed
wants to merge 1 commit into from

Conversation

the-glu
Copy link
Contributor

@the-glu the-glu commented Aug 30, 2022

Hello,

We do have an issue with people in vacations and their autoreply email responding to xwiki automatic notifications.

This PR fixes that by adding common email headers ( RFC 5436, 2.7.1 for 'Auto-Submitted', 'X-Auto-Response-Suppress' used by Exchange servers ) to prevent automatic replies.

It's only set in the notification system. It may be set by default in xwiki since everything is probably generated emails - but I'm not sure to I did it only there :)

@the-glu the-glu changed the title Add common headers to notification emails Add common "please don't reply" headers to notification emails Aug 30, 2022
@surli
Copy link
Member

surli commented Aug 30, 2022

Hi, thanks for the contribution. It looks like an interesting fix but it needs a proper improvment ticket so that we can follow it up. Could you create that on https://jira.xwiki.org please?

    Added common headers to notification emails to prevent autoresponses from various emails autoreply
@@ -364,6 +364,8 @@ public MimeMessage next()

updateFactoryParameters(templateDocumentReference);
message = this.factory.createMessage(templateDocumentReference, this.factoryParameters);
message.setHeader("Auto-Submitted", "auto-generated");
message.setHeader("X-Auto-Response-Suppress", "All");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great to see this feature exist in the protocol.

However, I'm not sure this is the best location, I would expect something like that to be more somewhere in createMessage itself but looks like we don't really have any common code between message factories so that would mean adding it to each of them.

I guess another possibility would be to make it the default in ExtendedMimeMessage constructor, but it might be a bit too much.

WDYT @vmassol ?

Copy link
Member

@surli surli Aug 30, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAICS only Auto-Submitted is defined in the RFC (https://www.rfc-editor.org/rfc/rfc5436.html#section-2.7.1) the other one is defined by Microsoft according to https://www.arp242.net/autoreply.html.

Would be good to maybe add some comments to at least explain that. Also reading a bit more the RFC it sounds like the Auto-Submitted field should include the owner-email:

The header field "Auto-Submitted: auto-notified" MUST include one or
both of the following parameters: [owner-email or owner-token]

[EDIT: actually it's only for auto-notified value, here the proposal is to use auto-generated which does not have any parameter]

I guess another possibility would be to make it the default in ExtendedMimeMessage constructor, but it might be a bit too much.

According to the RFC the header could contain auto-generated or auto-notified. IMO it makes to always have the header in the emails sent by XWiki, now it's not necessarly always auto-generated: it would makes sense to use auto-notified for notification system.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it would makes sense to use auto-notified for notification system.

the RFC actually says:

Keyword value: auto-notified
Description: Indicates that a message was generated by a Sieve
notification system.

we're not in that case since it's not a Sieve notification system. So I guess we can just commit to keep auto-generated. I'm not yet entirely sure about putting that to ExtendedMimeMessage: what if some extensions / scripts reuse that to send mails that are not generated?
We could maybe go at least for a first version to keep it there only. WDYT?

@the-glu the-glu changed the title Add common "please don't reply" headers to notification emails [XWIKI-20109] Notification headers for autoreplies Aug 30, 2022
@the-glu
Copy link
Contributor Author

the-glu commented Aug 30, 2022

Hi, thanks for the contribution. It looks like an interesting fix but it needs a proper improvment ticket so that we can follow it up. Could you create that on https://jira.xwiki.org please?

Sure, it's there: https://jira.xwiki.org/browse/XWIKI-20109

I updated name / commit messages accordingly

@surli
Copy link
Member

surli commented Jan 16, 2025

Closing in favor of #3802 since I don't have write access on original branch.

@surli surli closed this Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants