In simple way - what email settings should be in config.inc.php?

Describe the issue or problem
There are complaints that users are not geting emails. One example is email ending with @ukr.net I do not know if user is really not getting it, maybe he just does not see it in spam.

But another test was with my personal gmail and I got it to spam.

Steps I took leading up to the issue
For example:

  1. Go to forgot password link http://localhost:8080/index/lt/login/lostPassword
  2. Enter email
  3. Submt
  4. See mailbox

What application are you using?
OJS 3.3.0-5

Additional information

Colleague noticed that emails differe nad DMARC fails. In some UI he showed screenshot where to fields differ: “Sender mail from address” and “Sender address”.

I debugged - “Sender mail from address” is from config.inc.php while “Sender address” is from site_settings table contactEmail .

config.inc.php email uncommented settings:

sendmail_path = “/usr/sbin/sendmail -bs”

allow_envelope_sender = On

default_envelope_sender = address@one.lt

force_default_envelope_sender = On

require_validation = Off

validation_timeout = 14

Claude suggests add those:

force_dmarc_compliant_from = On
dmarc_compliant_from_displayname = “%n via %s”

I see see lot of posts related to this topic but its like lot to read for such simple thing. I think there should be quicker safe solution.

Is setting those 2 claude setuggested settings safe, nothing bad will happen? If so why are they not used by default?

Or if you know the link with exactly same situation, then please give me.

Analizing this more.

Found the example in docs which says to set force_dmarc_compliant_from = On

https://docs.pkp.sfu.ca/admin-guide/en/deploy#email-server

And no words for when it has to be off. And default is off.

Claude says something like off by default so that legacy installations would not change something.

On the other hand as docs state:

Most email will be blocked by spam filters unless you use an SMTP server with correctly configured SPF and DMARC records.

so correct is the example from the docs and

force_dmarc_compliant_from = Off

is incorrect? Incorrect but still possible, thats what is confusing. It looks like in some cases it has to be Off , in other cases it has to be On.

Set those values, so DMARC passes. For few hours nobody reported complaints.