mailcow / mailcow-dockerized

mailcow: dockerized - 🐮 + 🐋 = 💕
https://mailcow.email
GNU General Public License v3.0
8.87k stars 1.18k forks source link

Mailrelay Error "User unknown in relay recipient table" #2817

Closed root-couture closed 5 years ago

root-couture commented 5 years ago

Hi Ho.

i try to setup Mailcow as Mailrelay for some Servers but i get always the Error-Message "550 Sender address rejected: User unknown in relay recipient table" when i try to send from a server through mailcow

Jul 29 13:36:47 og postfix/smtp[32598]: 852826006F: to=<hosting-support@tutanota.com relay=mailrelay.example.com:25, delay=0.24, delays=0.09/0/0.06/0.08, dsn=5.1.1, status=bounced (host mailrelay.example.com said: 550 5.1.1 **hosting-support@tutanota.com**: Recipient address rejected: User unknown in virtual mailbox table (in reply to RCPT TO command))

I have performed the following steps:

Version: mailcow/postfix:1.35 Version: mailcow/dovecot:1.83

Did i fucked up with some special kung-fu settings? Thx for trying to helping

PS: I tried to read the documentary very well but i can feel im still in trouble ;)

andryyy commented 5 years ago

Did you setup tutanota.com as domain in mailcow?

If you want to relay over mailcow, you need to create a user and relay authenticated.

root-couture commented 5 years ago

Howdi andryyy. Thx for your highspeed answer

No i dont setup tutanota.com as domain. i want to send a logwatch-mail from "server1" through "Mailcow" to an extern Mailaccount. in this example to a tutanota mailaccount

Example: server1 - > mailcow relayhost -> tutanota user server1.example.de -> mailcow.example.com = user@tutanota.com = <3

server1 should be able to send mails throug mailcow to all users with all the different providers out there.

salute

root-couture commented 5 years ago

Hm when i put the IP from server1 to mynetworks in "/opt/mailcow-dockerized/data/conf/postfix/main.cf" than relaying works. Is there a GUI-Settings for that? Is this solution update-proved?

andryyy commented 5 years ago

You need to relay as authenticated user. :)

Am 29.07.2019 um 17:41 schrieb Open-Source-Gigolo notifications@github.com:

Hm when i put the IP from server1 to mynetworks in "/opt/mailcow-dockerized/data/conf/postfix/main.cf" than relaying works. Is there a GUI-Settings for that?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

Clevero commented 5 years ago

I recently was able to solve this.

Relaying from domains like sender=alice@otherdomain.com to recipient=bob@mydomain.com was done correctly. No authenticated relaying.

Mails from sender=alice@server1.mydomain.com to recipient=bob@mydomain.com were rejected with 550 5.1.0 <alice@server1.mydomain.com>: Sender address rejected: User unknown in relay recipient table

The solution was to add server1.mydomain.com to mailcow that is fully relayed. Completly through GUI

I think this behaviour is not intended since server1 is a sender, not a recipient.

andryyy commented 5 years ago

If it's a relay domain, it will be relayed. It is intended. Perhaps someone can explain it in detail, but enotime on my side.

Clevero commented 5 years ago

server1.mydomain.com is the sender domain

mydomain.com is always the recipient domain.

As far as I can see, if it would be inteded I would also need to configure gmail.com if I want to receive mails from user@gmail.com

andryyy commented 5 years ago

There are many steps that were wrong or not plausible for what you tried to archive. The forward host was not necessary (could be, depends on a missing info about the relay construct). You created a relay user, but your remote server uses port 25, which cannot be used for authenticated relaying, which means it was never authenticating. "Recipient address rejected: User unknown in virtual mailbox table" indicates you either tried sending from an unknown user (while the domain exists!) or you created the remote domain (not yours) in mailcow. That way it sees the domain as a mailcow domain and searches the recipient in the local database. This will not work.

Your server using your relay could also be on a trusted subnet and therefore be allowed to relay anyway. Only those domains, that were incorrectly setup would fail then.

It would never allow unauthed relaying if you didn't mess up the configuration.

I have no idea what your setup looks like now or did previously. But I can guarantee we are not offering open relays with mailcow. :)

Sadly I don't have time to investigate this in my free time anymore. Time is rare. :(

Clevero commented 5 years ago

The Mailcow instance is not an open relay, it just accepts domains that are configured and has the standard config besides the configured domains that should be relayed.

Mailcow is relaying mails unauthenticated to the actual mail server, in a private local network. Not over the internet

root-couture commented 5 years ago

I run multiple servers (60+) with a lot of different domains (100+) and a lot of Contao-CMS instances. The Contao emails are sent directly from the servers postfix instance -> through a Zimbra mailrelay out in the wild. At the Zimbra mailrelay, i was able to preconfig a network and did not have to worry about the dynamic switching domains anymore but with Mailcow I would have to put in a lot of work and readjust as soon as new domains arravied. This has nothing to do with an open relay.

All servers are in the same Network server.example.de (30 Domains) - > mailcow relayhost -> Ext Mailadress server1.example.de (20 Domains) - > mailcow relayhost -> Ext Mailadress server2.example.de (50 Domains) - > mailcow relayhost -> Ext Mailadress server3.example.de (10 Domains)- > mailcow relayhost -> Ext Mailadress .... server60.example.de - > mailcow relayhost -> Ext Mailadress

root-couture commented 5 years ago

I recently was able to solve this.

Relaying from domains like sender=alice@otherdomain.com to recipient=bob@mydomain.com was done correctly. No authenticated relaying.

Mails from sender=alice@server1.mydomain.com to recipient=bob@mydomain.com were rejected with 550 5.1.0 <alice@server1.mydomain.com>: Sender address rejected: User unknown in relay recipient table

The solution was to add server1.mydomain.com to mailcow that is fully relayed. Completly through GUI

I think this behaviour is not intended since server1 is a sender, not a recipient.

Thanks for help bro!

stale[bot] commented 5 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.