nextcloud / activity

:zap: Activity app for Nextcloud
115 stars 65 forks source link

Activity E-Mail has no unsubscribe information leading to spam trap and blacklisting risks #485

Open lpoujoulat opened 4 years ago

lpoujoulat commented 4 years ago

Hello Guys,

we had some trouble with the mail sent by Activity on some events, like administrators broadcasts: a very large number of e-mails is emitted and regularly, some ISP detect them has spam or some user mark them has spam not knowing how to stop them. This leads to some risks of blacklisting of our servers.

The activity E-mails should include a text in the footer saying for instance "Choose how to be notified" and pointing back to https:///settings/user/activity

The mail should also include a List-Unsubscribe header pointing at the same location.

This would solve the issue and make the mail more MTA/Clients friendly

Best regards

joshtrichards commented 3 months ago

I guess we could do it exactly the same as the Notifications app does:

https://github.com/nextcloud/notifications/blob/658e4dce745432b6372e1dbdb1f15e174758974e/lib/MailNotifications.php#L298-L303

It would go right around here:

https://github.com/nextcloud/activity/blob/3b40547bed28c97b30cff383879c84d32a52a4ad/lib/MailQueueHandler.php#L332

Though I wonder if maybe we should really handle at least part of this in Server, by adjusting the addFooter():

https://github.com/nextcloud/server/blob/609fa7d5db69c7724ad42615e2146bef4f714c76/lib/private/Mail/EMailTemplate.php#L581-L586