• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Issue Plesk Postfix resolving external address as local

antonio.abansys

New Pleskian
Server operating system version
CentOS7
Plesk version and microupdate number
obsidian 18.0.48
Hi to all,

I have a problem with postfix on plesk, Im trying to send a email to [email protected] from [email protected] and when I check the logs I can see that is trying to resolv as a local address.
I paste the log (I reemplace the real hosted address to local.com and external as external.com)

Code:
Dec 15 15:35:17 h0220 psa-pc-remote[16562]: 3335D10782FC1: from=<[email protected]> to=<[email protected]>
Dec 15 15:35:17 h0220 postfix/cleanup[26782]: 3335D10782FC1: filter: header Received: from webmail.local.com (localhost.localdomain [127.0.0.1])??by h0220 (Postfix) with ESMTPSA id 3335D10782FC1??for <[email protected]>; Thu, 15 Dec 2022 15:35:17 +010 from localhost.localdomain[127.0.0.1]; from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<webmail.local.com>: plesk_virtual:[127.0.0.1]:12346
Dec 15 15:35:17 h0220 postfix/cleanup[26782]: 3335D10782FC1: filter: header To: [email protected] from localhost.localdomain[127.0.0.1]; from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<webmail.local.com>: plesk_virtual:[127.0.0.1]:12346
Dec 15 15:35:17 h0220 postfix/cleanup[26782]: 3335D10782FC1: message-id=<[email protected]>
Dec 15 15:35:17 h0220 psa-pc-remote[16562]: 3335D10782FC1: py-limit-out: stderr: INFO:__main__:Setting 'X-PPP-Vhost' header to 'local.com'
Dec 15 15:35:17 h0220 psa-pc-remote[16562]: 3335D10782FC1: py-limit-out: stderr: PASS
Dec 15 15:35:17 h0220 psa-pc-remote[16562]: 3335D10782FC1: check-quota: stderr: SKIP
Dec 15 15:35:17 h0220 psa-pc-remote[16562]: 3335D10782FC1: spf: stderr: PASS
Dec 15 15:35:17 h0220 postfix/qmgr[23032]: 3335D10782FC1: from=<[email protected]>, size=1368, nrcpt=1 (queue active)
Dec 15 15:35:17 h0220 postfix/smtpd[27432]: disconnect from localhost.localdomain[127.0.0.1] ehlo=1 auth=1 mail=1 rcpt=1 data=1 quit=1 commands=6
Dec 15 15:35:17 h0220 postfix-local[28630]: 3335D10782FC1: from=<[email protected]>, to=<[email protected]>, dirname=/var/qmail/mailnames
Dec 15 15:35:17 h0220 dovecot: imap-login: Login: user=<[email protected]>, method=PLAIN, rip=::1, lip=::1, mpid=28631, TLS, session=<RygOw97vOMgAAAAAAAAAAAAAAAAAAAAB>
Dec 15 15:35:17 h0220 postfix-local[28630]: cannot chdir to domain dir external.com: No such file or directory
Dec 15 15:35:17 h0220 postfix-local[28630]: 3335D10782FC1: Unknown user: [email protected]
Dec 15 15:35:17 h0220 postfix/pipe[28628]: 3335D10782FC1: to=<[email protected]>, relay=plesk_virtual, delay=0.63, delays=0.6/0.01/0/0.02, dsn=2.0.0, status=sent (delivered via plesk_virtual service)
Dec 15 15:35:17 h0220 postfix/qmgr[23032]: 3335D10782FC1: removed

I saw a KB that said to comment the postfix/main.cf lines and restart postfix and apache but nothing happend
Code:
virtual_mailbox_domains = $virtual_mailbox_maps, hash:/var/spool/postfix/plesk/virtual_domains
virtual_alias_maps = $virtual_maps, hash:/var/spool/postfix/plesk/virtual
virtual_mailbox_maps = hash:/var/spool/postfix/plesk/vmailbox
I never have hosted the external address any idea?
 
If the domain external.com is also set up on plesk then it will make the decision that the domains mail is also hosted on the server, unless you disable Mail for the domain under Mail Settings.
 
You didn't fully answer my question yet.
I answered, sorry if my explanation was incorrect.
The domain is external, is not present on the server. No web, no DNS, no mail, fully external client, and my server is resolving that locally.
This are breaking my mind, If I do a dig to the external domain are resolving successful, dig A, dig MX, dig NS. But when I goint to mail to this domain in the logs trying to resolve locally o_O
 
I suspect that the external.com domain is present in the Postfix database. Which you can check with # postmap -s /var/spool/postfix/plesk/virtual_domains | grep external.com and # postmap -s /var/spool/postfix/plesk/virtual | grep external.com.

Do those commands return anything? If these commands return nothing, does postconf | grep mydomain return mydomain = external.com?
 
I suspect that the external.com domain is present in the Postfix database. Which you can check with # postmap -s /var/spool/postfix/plesk/virtual_domains | grep external.com and # postmap -s /var/spool/postfix/plesk/virtual | grep external.com.

Do those commands return anything? If these commands return nothing, does postconf | grep mydomain return mydomain = external.com?
Thank Kaspar.

The commands
Code:
# postmap -s /var/spool/postfix/plesk/virtual_domains | grep external.com and # postmap -s /var/spool/postfix/plesk/virtual | grep external.com.
return nothing.

about the
Code:
postconf | grep mydomain
return the domain of my company (is a shared server where have different subscription from clients)
If this can help, in mydestination I have this
Code:
mydestination = localhost.$mydomain, localhost, localhost.localdomain
 
That is strange. I am out of suggestions. Unless someone else has any additional suggestions I think your best bed would be to contact Plesk support. They can investigate the issue directly on your server.

 
Back
Top