Hi all,
I have some questions about mail identities and Postfix, and look forward to some guidance.
My YunoHost server
Hardware: laptop or computer at home
YunoHost version:
- yunohost version: 11.2.8.2 (stable)
- yunohost-admin version: 11.2.3 (stable)
- moulinette version: 11.2 (stable)
- ssowat version: 11.2 (stable)
I have access to my server : Through SSH | through the webadmin | direct access via keyboard / screen
Are you in a special context or did you perform some particular tweaking on your YunoHost instance ? : maybe
If yes, please explain: I switched mail sending of for one domain and on for another
Description of my issue
I just moved my last (most heavily used) mail account to my Yunohost.
For sending mail from Yunohost, I used to use a sub.domain.tld ; even though Yunohost (also) managed domain.tld, the mailserver + mailbox for domain.tld was over at my registrar.
Now that I moved the mailbox from the registrar to Yunohost
- I updated the MX records for domain.tld to point to my Yunohost (at the nameserver)
- I updated the reverse DNS for my Yunohost to say âdomain.tldâ instead of âsub.domain.tldâ (at my ISP)
- I created an account for the mailbox on Yunohost (in Yunohost)
- I copied aliases from registar to the new account on Yunohost (export to CSV, copy/paste in account in Yunohost)
- I exported identities from the registrarâs webmail (save webmayl options page as HTML)
- I copied existing mail from registrarâs mailserver to Yunohost (isync/mbsync)
- I started experimenting âseriouslyâ with Yunohostâs webmail options (Snappymail, at first)
Two problems
- Diagnosis warns about an incorrect rDNS:
- expected : sub.domain.tld
- found: domain.tld
- possible explanation:
- sub.domain.tld was the first ever domain on my Yunohost
/etc/postfix/main.cf
hasmyhostname = sub.domain.tld
(the hostname is actually still âsubâ , so I guess thatâs fine)/etc/postfix/main.cf
hasmydomain = sub.domain.tld
(I think have to change this tomydomain = domain.tld
, but am somewhat loathsome to take the dive)
- Snappymail unable to send mail when chosing an identity
- sending mail as âmymailbox@domain.tldâ works, but is not what I want (I do not want to expose the mailaddress of the mailbox)
- sendig mail as âmymailaddressforyou@domain.tldâ does not work
- mymailaddressforyou@domain.tld is a mailalias in the account mymailbox
- I added an identity in Snappymail using mymailaddressforyou@domain.tld as email and reply-to
- when using this identity, Snappymail says âthe mail could not be sentâ;
/var/log/mail.log
prints this lineNOQUEUE: reject: RCPT from localhost[::1]: 553 5.7.1 <cmymailaddressforyou@domain.tld>: Sender address rejected: not owned by user mymailbox; from=<mymailaddressforyou@domain.tld> to=<test@domain.tld> proto=ESMTP helo=<domain.tld>
- This error is luckily encountered more often, and a solution is suggested:
- smtpd_sender_login_maps need to be set to the same value as virtual_mailbox_maps
- my (untouched)
/etc/postfix/main.cf
has
smtpd_sender_login_maps=
# Regular Yunohost accounts
ldap:/etc/postfix/ldap-accounts.cf,
# Extra maps for app system users who need to send emails
hash:/etc/postfix/app_senders_login_maps
-
-
- Should I add a line there, as such:
-
smtpd_sender_login_maps=
# Regular Yunohost accounts
ldap:/etc/postfix/ldap-accounts.cf,
# Aliases of Yunohost accounts, to allow mail being sent by identity = alias
ldap:/etc/postfix/ldap-aliases.cf,
# Extra maps for app system users who need to send emails
hash:/etc/postfix/app_senders_login_maps
Guessed solutions
So, in short, I think I need to make two changes to /etc/postfix/main.cf
(and maybe execute some postfix-db-update?):
- change the Postfix domain to match rDNS:
mydomain = sub.domain.tld
tomydomain = domain.tld
; - add LDAP aliases as allowed senders
ldap:/etc/postfix/ldap-aliases.cf
undersmtpd_sender_login_maps=
- run
postmap app_senders_login_maps
- restart postfix ,
systemctl restart postfix
Any suggestions or confirmations?