Hello,
I am unable to send emails from my server to adresses @mydomain.com. I have this postfix message :
status=bounced (mail for mydomain.com loops back to myself)
/etc/hostname → mydomain.com
I don’t have any domain configured with “mail for domain”
And in postfix configuration I set What domains to receive mail for → localhost
I thought that would be enough
What is wrong ?
Thanks
I don’t want to receive mail on my server. I just want to send mail, no receiving. So postfix should deliver externally.
I can send to other emails adresses without error, even to adresses with domain name belonging to virtualmin domains without “mail for domain”.
Just this one domainname fails because this is my hostname.
How to tell postfix to not deliver locally ?
you’ve got me confused. you’re sending from your domain (local) to your domain (local), without it being enabled for “mail”… so bounce is normal.
did you try to send externally to “externaldomain.com” ?
Yes I can send to any domain, except my hostname domain.
So there should be a setting in postfix to force it to send mail externally even for local domain…
Your MX record is, I guess, wrong? MX record decides where mail is supposed to be delivered. Postfix believes the server itself is supposed to receive mail for your domain.
If you have DNS enabled on the system, but it’s not actually authoritative for your zone, that could lead to the server itself thinking the MX record is itself…so, disable the DNS feature if you’re not actually hosting DNS locally.
But, also, don’t name your server the same thing as a name you’re hosting in Virtualmin. This wouldn’t usually matter if you’re not receiving mail, but you have something else wrong…so Postfix is trying to deliver locally.
I thought the DNS system on Virtualmin servers was not setup to do Local lookups and performed all lookups externally. I appreciate that at some point the authoritative DNS request chain comes back to the server (when appropriate) and that DNS requests can be cached.
I know cpanel does internal lookups for email by default. It enumerates all of the domains on the server and if the target domain is listed it will get delivered there unless you change the option as below.
Ok I disabled DNS completely on my server. I don’t know if this is because of other changes I made, or because I disabled DNS? but now I get this error when I try to send mail to mydomain :
Ok, so now I have “server.mydomain.eu” as my hostname but I still cannot send mail to logs@mydomain.eu externally from my own server. This adress works fine otherwise.
I still have this postfix error :
"Dec 13 09:27:01 mydomain.eu postfix/local[1638819]: AB3C96894B: to=<logs@mydomain.eu>, relay=local, delay=0.08, delays=0.07/0.01/0/0.01, dsn=5.1.1, status=bounced (unknown user: "logs")
Postfix still believes it is the mail server for your domain. So, find why that is and change it. /etc/mailname (this is a dumb misfeature of Debian/Ubuntu, but you picked an OS, so you’ve gotta live by its rules), maybe?
Actually, changing my hostname to server.mydomain.eu is really not what I want.
This means changing the reverse DNS of my server, and now antispams complain my server does not have MX record, and I don’t want to handle mail on server.mydomain.eu.
I already have everything setup with mydomain.eu
This was working perfectly fine on my previous server (also with debian/webmin).
And everything else is working perfectly fine like that.
The only remaining issue is this postfix error I am trying to fix since the begining. ( Mail for “domain” loops back to myself ) How to tell postfix not to handle mails for my hostname ? Or how to tell postfix to not handle mail locally at all ?
This really should not be that complicated !
Thanks to anyone who can point me in the right direction without changing my entire server configuration.
But, also, why does the system hostname need to be something you’re virtually hosting? That doesn’t make sense. You can name the system literally anything other than things you’re virtually hosting, and avoid a wide variety of problems that come from having two things with the same name.
Because the system needs a domain name, and I chose the same one than one of my website.
And now that I’ve set everything up around this, including my emails which are quite a pain to configure to get good anti-spam scores, I’d rather not have to start all over again.