How can I send mails from multiple domains?

Hello Yunohost Community :slight_smile:

My YunoHost server

Hardware: VPS
YunoHost version: 11.0.10.2
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 ? : no

Description of my issue

How can I use multiple domains for mailing? I can only send mail from my main-domain which is mgmt.deckplosion.de so sending from @mgmt.deckplosion.de works but If I want to send mails from @deckplosion.de it brings the follow error:

Jan 02 12:53:06 postfix/smtpd[69494]: NOQUEUE: reject: RCPT from localhost[::1]: 553 5.7.1 <jsterr@deckplosion.de>: Sender address rejected: not logged in; from=<jsterr@deckplosion.de> to=<jonas.sterr@gmx.net> proto=ESMTP helo=<mgmt.deckplosion.de>
Jan 02 12:53:06 postfix/smtpd[69494]: disconnect from localhost[::1] ehlo=1 mail=1 rcpt=0/1 quit=1 commands=3/4

Seems like I need to tell yunohost that it is allowed to send mails from users @deckplosion.de or at any other domain I have in my yunohost-domain-list?

This is how my records look like:

The goal is to use one MX entry for all domains, and sending mails from all domains should be allowed.

My mailscore from mail-tester.com for jsterr@mgmt.deckplosion.de is 10/10 Spam Test Result but as I said, I cant get it working with @deckplosion.de

Thanks for your help!

How exactly did you try to send the email with this address

I tried it via snappymail - when my Account Mail is set to jsterr@mgmt.deckplosion.de everything works fine. I can send and receive mails. But when I change it in the account settings to jsterr@deckplosion.de (I also have this domain configured in “Domains”) sending mail fails with the mentioned error from above.

I guess it has something to do with certificates:

If I add my account to thunderbird, I get a Certificate Error, when I Import it I can send mails. So theres something wrong how certificates are set up?

You know howto set the server up so you can use one subdomain for mx for all domains? like use mail.deckplosion.de for all my domains (or mgmt. it doesnt matter)? Thats how it is typícally done, because you can also set one ptr per server usually. I really love yunohost, but the mail thing is kinda hard to understand whats going on on the server.

Yes, mail is hell

I believe there’s nothing special to do apart from following the recommended DNS conf / what the Diagnosis tells you about DNS records. Your current issue doesnt seem to be related to DNS records anyway.

That’s probably a different issue, something related to SNI which you need to force-regen due to a bug fixed in 11.1 … the workaround is somewhere on the forum but i’m in the middle of something else and don’t have time to look it up :confused:

Can you confirm that this address is defined as an alias for your yunohost account ?

Thats how my account looks like. Maybe theres something wrong? I changed my mail from @mgmt.deckplosion.de to jsterr@deckplosion.de. When it is jsterr@mgmt.deckplosion.de it works otherwise not. Strange thing is if i accept certificate in thunderbird with jsterr@deckplosion.de it works.

Yeah no problem I have a month to migrate my old server to a new one, that best would run via yunohost :slight_smile: Its 5-6 different domains with mailing + wordpress so nothing big but would be nice to have it up and running with this beautíful software. Looking forward for the bug your mentioned, maybe you can post it in the next days.

Regarding dns records: Its kinda strange that it says I should set a mx record to each of my domain to itself, when the server could and should (?) only send from one mail-srv? Usually I would set the mx record for a second domain to the same value as on my first domain as they use the same mailserver.

Just add the other mail addresse as an alias with the appropriate domain, just like “webmaster”, “postmaster” etc

1 Like

Thanks I tried this, but as soon as I put jsterr@deckplosion.de as an alias to jsterr@mgmt.deckplosion.de I cant send a mail. Tried it with a new account and it does not work. As soon as I remove the @deckplosion.de Alias I can send the mail again. But I cant reply to the mail I send from jsterr@mgmt.deckplosion.de because It says user jsterr@deckplosion.de unknown

SMTP error from remote server for RCPT TO command, host: deckplosion.de (37.120.176.230) reason: 550 5.1.1 <jsterr@deckplosion.de>: Recipient address rejected: User unkno
wn in virtual mailbox table

Why doesnt it work … what happens when you try …

Its the same error from the beginning:

Jan  2 22:08:23 mgmt postfix/smtpd[29305]: NOQUEUE: reject: RCPT from localhost[::1]: 553 5.7.1 <jsterr@deckplosion.de>: Sender address rejected: not logged in; from=<jsterr@deckplosion.de> to=<jonas.sterr@gmx.net> proto=ESMTP helo=<mgmt.deckplosion.de>
Jan  2 22:08:23 mgmt postfix/smtpd[29305]: disconnect from localhost[::1] ehlo=1 mail=1 rcpt=0/1 quit=1 commands=3/4

If I remove the alias jsterr@deckplosion.de and just use jsterr@mgmt.deckplosion.de I cant reply to the mail because this happens:

Jan  2 22:08:52 mgmt postfix/smtpd[29305]: Anonymous TLS connection established from mout.gmx.net[212.227.17.21] to deckplosion.de: TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256
Jan  2 22:08:52 mgmt postfix/smtpd[29305]: NOQUEUE: reject: RCPT from mout.gmx.net[212.227.17.21]: 550 5.1.1 <jsterr@deckplosion.de>: Recipient address rejected: User unknown in virtual mailbox table; from=<jonas.sterr@gmx.net> to=<jsterr@deckplosion.de> proto=ESMTP helo=<mout.gmx.net>
Jan  2 22:08:52 mgmt postfix/smtpd[29305]: disconnect from mout.gmx.net[212.227.17.21] ehlo=2 starttls=1 mail=1 rcpt=0/1 data=0/1 quit=1 commands=5/7

Can you confirm that in Snappymail you’ve set it up as an additional identity and not just an additional account:

I tried both it still doesnt work. I setup mailcow just to try out if something is wrong with my dns or I dont know just to know and … mailing works out of the box there with simplified dns records. Problem is it takes all of my ram from my server guess there wont be enough ram for the websites left as it runs as a docker container. So I would like to stick with yunohost it feels way more light then mailcow (and its only mailserver not like yunohost a complete solution for all your needs)

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.