server icon indicating copy to clipboard operation
server copied to clipboard

Adding option to set Auto-Submitted email header

Open bennet0496 opened this issue 3 years ago • 1 comments

Related to issue #16538 and PR #27200

As previously discussed an proposed in the issue and PR, this PR add the option Auto-Submitted, which has the main purpose of stopping properly configured mail server from sending OOO-Auto-Replys in response to fully automatic Nextcloud notifications. However as @nickvergessen mentioned in https://github.com/nextcloud/server/issues/27200#issuecomment-908904913 it might not be ideal to hard code the header for any email sent by Nextcloud, for this reason I added the method setAutoSubmitted(string $value) to OC\Mail\Message, which allows apps to dynamically set this header if it is deemed appropriate. The current default is to not set the Header which is equivalent to Auto-Submitted: no. The set of valid values is available with OCP\Mail\AutoSubmittedValue.

Additionally I set this Auto-Submitted value for new user welcome mail (NewUserMailHelper in apps/settings) and CalDAV notifications (OCA\DAV\CalDAV\Reminder\NotificationProvider in apps/dav)

The image show the header being adding to the new user mail, but not the test mail. I was not able to trigger a DAV notification in my 5min test installation until now, but as the code is the same I expect similar results. image

Unit tests for the new methods are added as well.

bennet0496 avatar Dec 23 '22 13:12 bennet0496

which of the autoloader changes are ones that need to stay? If any, probably only lib/composer/composer/autoload_static.php and lib/composer/composer/autoload_classmap.php right? I would that completly revert commit 77569ba and just commit that changes to these two files again. However, all the other changes came from running build/autoloaderchecker.sh as well and I committed the result of that like documented. Sorry if I missunderstood that.

bennet0496 avatar Dec 24 '22 14:12 bennet0496

which of the autoloader changes are ones that need to stay?

bash build/autoloaderchecker.sh
git add lib/composer/composer/autoload_*

and then commit it.

nickvergessen avatar Jan 03 '23 11:01 nickvergessen

Thanks for your first pull request and welcome to the community! Feel free to keep them coming! If you are looking for issues to tackle then have a look at this selection: https://github.com/nextcloud/server/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22

welcome[bot] avatar Jan 04 '23 08:01 welcome[bot]

Good stuff @bennet0496

nickvergessen avatar Jan 04 '23 08:01 nickvergessen

thank you @nickvergessen

it's always cool if I can help and contribute, even with the limited amount of coding I usually do :smile:

bennet0496 avatar Jan 04 '23 08:01 bennet0496

hello @bennet0496 Thank you so much for your work on this pull request! This ticket seems to have the tag 'pending documentation'. Is there any chance you could clarify what documentation is missing? Is this for admins or for app developers?

DaphneMuller avatar Feb 21 '23 13:02 DaphneMuller

Short docs were added in https://github.com/nextcloud/server/issues/34692#issuecomment-1375350845

nickvergessen avatar Feb 21 '23 13:02 nickvergessen

All our emailing has no docs. Should be added some time to the developer docs in https://docs.nextcloud.com//server/stable/developer_manual/digging_deeper/index.html

nickvergessen avatar Feb 21 '23 13:02 nickvergessen