Friday, May 3, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 13703  / 2 Years ago, thu, august 25, 2022, 2:54:24

I have a LAMP webserver configured to serve multiple websites. Each virtual host has various PHP applications, mainly Wordpress.



When users sign up to the Wordpress sites, email is sent by PHP through to postfix, and then on to the receiver. The problem is that postfix is identifying itself to the remote server with the contents of /etc/hostname, which is not a fully qualified domain name. Some mail servers reject this and the mail bounces.



Additionally, the return path is being set to one of the vitual host domains, seemingly at random.



I could set /etc/hostname to one of the website domain names, but then the emails from the other websites would have a wrong server in the headers, and this would not fix the return-path issue.



Possibly related, apache2 says "could not determine the server's fully qualified domain name" on startup.



How do I fix this so that each website can send email without revealing the other websites hosted on the server?



Example error:



Oct 15 20:29:32 Ubuntu-1204-precise-64-minimal postfix/smtp[17214]: CD087E00DF6: to=<*****@*******.**>, relay=spool.mail.gandi.net[217.70.184.6]:25, delay=0.29, delays=0.12/0/0.09/0.07, dsn=5.5.2, status=bounced (host spool.mail.gandi.net[217.70.184.6] said: 504 5.5.2 <Ubuntu-1204-precise-64-minimal>: Helo command rejected: need fully-qualified hostname (in reply to RCPT TO command))


I have now set the FQDN in /etc/hosts and /etc/hostname, and restarted apache2 and postfix, and it still gives this same error. I don't even know where it is still getting the old hostname from as it is no longer stored anywhere on disk.


More From » apache2

 Answers
1

The FQDN should ideally match the reverse DNS entry for your MTA's public IP address.



main.cf:



myhostname = fully.qualified.domain.name
myorigin = /etc/mailname


Make sure /etc/mailname also has the domain name.



# cat /etc/mailname
fully.qualified.domain.name


Then:



postfix reload
postconf -n # to show currently running configuration

[#34973] Saturday, August 27, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
utschang

Total Points: 357
Total Questions: 120
Total Answers: 119

Location: Croatia
Member since Sat, May 2, 2020
4 Years ago
utschang questions
Mon, Aug 30, 21, 14:09, 3 Years ago
Tue, May 17, 22, 20:44, 2 Years ago
Sun, Jul 11, 21, 23:54, 3 Years ago
Tue, Sep 7, 21, 04:23, 3 Years ago
;