We do not want to expose this subdomain to our users. Mailgun recommends the usage of subdomains when sending mails. The idea would be to force the sender headers in discourse. According to our test, it seems to work well.
I’ve been working with all our email systems, both internal and external, and also SPF, DKIM and DMARC setups -
For many of our providers, we are allowed to send through mailgun, as mg.example.com subdomain, but the sender and from fields are set to match @example.com - so there is no “on behalf of” issue.
For dmarc alignment, the really important parameter is the “d=” field when signing the email with dkim. If this is d=example.com, then everything is aligned because the @example.com is matching the top level sender domain (ie, outdomain.com) - so the mechanisms “SPF dmarc alignment” and “DKIM dmarc alignment” both show as “pass”. When eveything shows as pass, the email is accepted as valid.
So, we have a couple issues here. Can we set the “sender” and “from” fields?
Do you properly assign the domain in the “d=” when dkim signing the email?
In your settings, you can setup the domain to point to whatever domain you want.
My site is hosted on board.example.com and the emails come from example.com
here it’s not related to the website url but to the SMTP Domain vs Sender domain.
Our smtp is mg.something.com whereas our sender domain is something.com.
My mailgun is setup as mg.example as well. Still uses example.com as the protocol. edit maybe I’m just not understanding what you’re trying to imply.
Apologies.
c0ry, it seems we are not able to set the “sender” and “from” (and the “return path”) fields to be the same. If they are not the same, you can get emails that say “sent on behalf of”. Then risk of spam classification is higher.
Office 365로 발신 이메일을 통합하는 문제로 고생하고 있습니다.
이메일 관련 문제를 다루는 스레드가 몇 개 있습니다.
참고로:
기본적으로 Office 365는 발신자가 로그인 계정과 일치하지 않으면 554 오류를 반환합니다(그리고 Discourse의 로그는 유용하지 않습니다).
발신자 주소를 다른 곳에서 논의된 대로 다음 명령으로 설정할 수 있습니다.
rails r “SiteSetting.notification_email = 'discourse@yoursite.com’”
하지만 이것은 초기에 전송되는 이메일만 설정하는 것 같다고 생각합니다.
참고로, 제 포럼 URL은 이메일 도메인과 관련이 없습니다…
제 경우, (GUI) 설정에서 다음을 설정해야 했습니다:
1/ 알림 이메일
2/ 사이트 연락처 사용자 이름 - 이는 SMTP로 로그인하는 이메일(즉, 보내고자 하는 이메일)을 가진 사용자가 반드시 있어야 함을 의미합니다.
결론적으로, ‘일반적인’ Office 365 SMTP 연결을 사용하려면 Discourse에서 보내는 모든 이메일의 발신자(from) 필드가 SMTP 로그인 이메일과 동일해야 합니다. 위 방법으로 이것이 달성되길 바라지만, 모든 이메일의 발신자(from) 필드를 보장하되 하드코딩으로 설정할 수 있으면 좋겠습니다.