How to control From, Reply-to and Return-path (envelope from) addresses in form mails and personal messages?

How to control From, Reply-to and Return-path (envelope from) addresses in form mails and personal messages?

by Visvanath Ratnaweera -
Number of replies: 3
Picture of Particularly helpful Moodlers Picture of Translators
Can somebody explain the logic how the following three addresses in forum mails and personal messages (sent as mail) are decided?
a) From
b) Return-path (envelope from)
c) optionally, Reply-to

AFAICS there are a couple of parameters involved
- Site administration > Server > Support contact > Support email = <supportemail>

- Site administration > Plugins > Activity modules > Forum > Use email address in reply = forum_replytouse (Y or N)

- Site administration > Plugins > Message outputs > Email > No-reply address = <noreplyaddress>

- dito > Always send email from the no-reply address? = emailonlyfromnoreplyaddress (Y or N)

- In the personal profile > Email display = "Hide my email address from everyone" or "Allow only other course members to see my email address" or "Allow everyone to see my email address"

- settings I haven't noticed!

May be all that is in Moodle Docs. The only clue I found was https://docs.moodle.org/27/en/Messaging_FAQ#How_can_I_change_the_.27From.27_address_for_forum_notifications_sent_via_email.3F.
Moodle version 2.7.3. localhost accepts mail without authentication and forward them to a mail relay.
Average of ratings: Useful (1)
In reply to Visvanath Ratnaweera

Re: How to control From, Reply-to and Return-path (envelope from) addresses in form mails and personal messages?

by Pascal Maury -
Picture of Plugin developers

Hello,

I discovered that the <supportemail> (Site administration > Server > Support contact > Support email) is used in Return-Path field in the mail and the <noreplyaddress> (Site administration > Plugins > Message outputs > Email > No-reply address) is used in the From field as you can see :

Return-Path: <supportemailadress@net.fr>
Received: from server.net.fr (server.net.fr [1.5.51.12])
X-Sieve: CMU Sieve 2.3
To: "Pascal Maury" <maury@net.fr>
Subject: =?utf-8?B?dGVzdMKgOiB0ZXN0Nw==?=
X-PHP-Originating-Script: 1000:class.phpmailer.php
Date: Thu, 12 Feb 2015 17:31:40 +0100
From: "Admin" <noreplyaddress@net.fr>
Reply-To: "=?utf-8?B?TWVyY2kgZGUgbmUgcGFzIHLDqXBvbmRyZSDDoCBjZSBjb3VycmllbA==?="

Can somebody explain the logic as well ?


Average of ratings: Useful (1)
In reply to Visvanath Ratnaweera

Re: How to control From, Reply-to and Return-path (envelope from) addresses in form mails and personal messages?

by jason everling -

I am not sure about the logic but you can control how they are used,

If you setup Postfix locally on the server and setup some rewrite rules to modify each message so that they are sent out exactly how you want them. We do this actually, just make sure you have valid SPF records and DKIM setup.

JASON

In reply to jason everling

Re: How to control From, Reply-to and Return-path (envelope from) addresses in form mails and personal messages?

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Hi

I know that with a proper mail server anything is possible. No, the question is: What is the logic in Moodle for those settings mentioned in the OP.
Average of ratings: Useful (1)