I want the emails to be sent from the email of the site (e.g info@example.com) but the email is sent from the email the user has entered in the form. This may cause the email services to consider the email spam because the server is not the one to which the email belong.
Topic on Extension talk:ContactPage
It seems this is hardcoded, so it is not allowed to be changed. However you can edit the extension files to make the desired change and maintain it.
Can you point where to change?
I encountered the same issue and spent quite a while trying to figure it out. I just sent a patch to prevent it from happening again, see https://gerrit.wikimedia.org/r/c/mediawiki/extensions/ContactPage/+/637566 and code-review or manually copy the changes to fix it locally for your own case.
I agree that @Sophivorus's change should be merged in, as the current state of the extension makes it impossible to work with SES. When will the merge occur?
After testing @Sophivorus's change, there's only one issue left: the actual sending address is still being sent a copy of the message. This should be removed.
We've implemented this change on our fork of ContactPage, where we've completely removed the option to CC, and removed the email sending to the specified from address. This is because we do not want to take the risk of sending an email to a completely unvetted, unknown email address, which might bounce, and that's problematic for anyone using AWS SES.
- for MediaWiki 1.35: https://github.com/mywikis/ContactPageForMyWikis/commit/d9dfeeb6b3f80288117ed96c0e1e8b9ed41b1145
- for MediaWiki 1.31: https://github.com/mywikis/ContactPageForMyWikis/commit/440a800a6d7dba70475e6c377f50c3e2f7d5f0a4
This solution probably doesn't work for everyone, so the developers of this extension can feel free to implement changes however they wish.
Looks like the extension just wasn't setting the sender back to the site-configured address when $wgUserEmailUseReplyTo is true. I submitted a patch which fixes this:
https://gerrit.wikimedia.org/r/c/mediawiki/extensions/ContactPage/+/679450
This patch is 1.36.x or later only. However one can install the version for 1.36.x on an 1.35.x wiki. Let's see if it works for me.