Ubuntu – Postfix : Domain not found (in reply to MAIL FROM command)

postfixUbuntu

Setting up a new server and having a few issues with postfix. Set it up using the same config as another server I have which works fine.

Anyway, when I try to send to a certain domain i keep getting

Feb 14 10:28:55 web postfix/smtp[6276]: B9056A041A: to=<enquiries@innovative-payroll.com>, relay=mailserver.innovative-payroll.com[213.171.216.114]:25, delay=0.29, delays=0.06/0.01/0.01/0.21, dsn=5.0.0, status=bounced (host mailserver.innovative-payroll.com[213.171.216.114] said: 550 <www-data@kickseed.vpstest.local>: Sender address rejected: Domain not found (in reply to MAIL FROM command))

The MX records for the innovative-payroll.com domain seem to be setup ok

Using dig on the domain I get the following.

; <<>> DiG 9.6-ESV-R4-P3 <<>> mailserver.innovative-payroll.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 32030
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;mailserver.innovative-payroll.com. IN  A

;; ANSWER SECTION:
mailserver.innovative-payroll.com. 3600 IN A    213.171.216.114

;; Query time: 36 msec
;; SERVER: 192.168.2.1#53(192.168.2.1)
;; WHEN: Thu Feb 14 10:37:50 2013
;; MSG SIZE  rcvd: 67

My postfix config (postconf -n)

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
biff = no
config_directory = /etc/postfix
inet_interfaces = all
mailbox_size_limit = 0
mydestination = web.hoodoowebdesign.co.uk, localhost.hoodoowebdesign.co.uk, localhost
myhostname = web.hoodoowebdesign.co.uk
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
myorigin = /etc/mailname
readme_directory = no
recipient_delimiter = +
relayhost =
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_use_tls = yes

—- Solution —-

Edited the file /etc/mailname and set it too the domain of the server (hoodoowebdesign.co.uk) and it sends correctly now. I assume it had been automatically filled with

kickseed.vpstest.local

when I used one of the short cuts to installing a LAMP enviroment on the server.

Best Answer

Make sure that your machine is configured to respond to the hostname web.hoodoowebdesign.co.uk, and ensure that hostname is correctly configured in DNS. Obviously the hostname is something different at the moment, so mail coming from you ends up coming from kickseed.vpstest.local.