Postfix rejecting emails from gmail because they are unauthorized

SYSTEM INFORMATION
OS type and version Debian 12
Webmin version 2.202

i have a problem using postfix because i can send email to gmail without problem but i cannot receive from them. I see this message in the log every time i try to send an email from gmail to my virtualmin domain which is very weird because is like im trying to send to them, but not.

(host gmail-smtp-in.l.google.com[172.253.62.27] said: 550-5.7.26 Your email has been blocked because the sender is unauthenticated. 550-5.7.26 Gmail requires all senders to authenticate with either SPF or DKIM. 550-5.7.26 550-5.7.26 Authentication results: 550-5.7.26 DKIM = did not pass 550-5.7.26 SPF with ip: [51.xx.xx.xx] = did not pass 550-5.7.26

Also, i tried to receive from outlook and my server responded this: <“borja@hiddendomain.com”@ns569776.ip-.net> (expanded from
borja@hiddendomain.com): mail for ns569776.ip-.net loops back to
myself

Also, dont know from where is getting the “ns56
net” because i already changed the PTR pointer for reverse DNS.

Thanks

PD: Other thing i noticed is my user table in the virtualmin edit users menu is not displaying the quote and used size of the mailbox, maybe is not mapping the users to postfix right. I restored this domain from a backup of other updated virtualmin/webmin system using debian 10.

PD2: I think is related to this:

to=<“borja2@hiddendomain.com”@ns569776.ip-xxxxxx.net>, orig_to=borja2@hiddendomain.com, relay=none, delay=0.62, delays=0.3/0/0.32/0, dsn=5.4.6, status=bounced (mail for ns569776.ip-xxxxx.net loops back to myself)

because i dont why is appending the @ns569776.ip-xxxx.net but i think this is why is finding anything in the virtual servers name that matches the address. Also, dont know from where is copying that hostname. but i think is looking for address@domain@hostnameoldname

My address and masquerading options are like in my old server

PD3: If i do a recheck of the webmin config i get this error message:
Your Postfix configuration is missing the system’s mail hostname ns569776.ip-xxxxxx.net from the mydestination line, which will cause mail to bounce. The current value is 


Where can i change my system’s mail hostname?

Bravo!

It is high time someone began to reject mail from Gmail for a change. Let them get a taste of their own medicine.

1 Like

However it may be better to fix the ‘loops back to myself’ error rather than comending the OP for bouncing email from google

Im pretty sure is because of the system’s mail hostname that is not included on the mydestinations line, but i do not want to include it. i want to change it, but couldn’t find where
 i look for it in all config files even i did a grep -lir over all etc directory and i couldn’t fine anything. I dont know where it is defined.

Change what ? Your hostname or mydestination 
 might be worth running postconf -n to see what modifications have been made to postfix

Also recheck virtualmin configuration might help.

Are you sure? If you look up your IP, does it actually resolve to the name you changed it to?

I think this is the problem. I have set hostname in my main.cf file to right one. But it continued to append the old hostname and it was not present in any file in the system.
I think the DNS change needed more time to propagate. today i recheck the config and the error dissapeared. Now, i have other problems
 but this is for a different thread i think.
The problem now is postfix is not appending the hostname like in here
“borja2@hiddendomain.com”@ns569776.ip-xxxxxx.net)
to the users that have @ in the username and is not finding that user in the virtual domains table. However, for users like “username.domain” it is correctly appending the @hostname like before and it finding the username.

That’s not the right thing. It has very confusing results.

If you want your server to have a different name, change the system hostname and the PTR (assuming your hosting provider allows you to change the PTR or delegate reverse). But, also, it doesn’t matter. It just needs to resolve both directions. No user ever needs to interact with that name.

1 Like

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