I am having a problem sending mail from the server. The issue was spotted because as php mail() is failing to deliver any messages.
I have checked the mail log on the server and found the following;
Mar 31 11:28:34 serverxx-xxx-xxx-x spamd: spamd: connection from localhost [127.0.0.1] at port 38673 Mar 31 11:28:34 serverxx-xxx-xxx-x spamd: prefork: child states: II Mar 31 11:32:30 serverxx-xxx-xxx-x postfix/pickup: EA26E41204B8: uid=10007 from=<xx-website-xx> Mar 31 11:32:30 serverxx-xxx-xxx-x postfix/cleanup: EA26E41204B8: message-id=<20140331103230.EA26E41204B8@serverxx-xxx-xxx-x.server.xxx> Mar 31 11:32:31 serverxx-xxx-xxx-x postfix/qmgr: EA26E41204B8: from=<email@example.com>, size=655, nrcpt=1 (queue active) Mar 31 11:32:31 serverxx-xxx-xxx-x postfix-local: postfix-local: firstname.lastname@example.org, email@example.com, dirname=/var/qmail/mailnames Mar 31 11:32:31 serverxx-xxx-xxx-x postfix-local: cannot chdir to mailname dir user: No such file or directory Mar 31 11:32:31 serverxx-xxx-xxx-x postfix-local: Unknown user: @vwebsite.co.uk Mar 31 11:32:31 serverxx-xxx-xxx-x postfix/pipe: EA26E41204B8: to=<xx-website-xx>, relay=plesk_virtual, delay=0.29, delays=0.18/0.01/0/0.1, dsn=2.0.0, status=sent (delivered via plesk_virtual service) Mar 31 11:32:31 serverxx-xxx-xxx-x postfix/qmgr: EA26E41204B8: removed
there seems to be an issue with postfix at a surface level. I'm running Plesk with CentOS6. Also of note that i am using google apps for the email service with MX records pointing to google mail. Not sure if this will make a difference but on other domains on the server its also failing to send.
Any help would be appreciated.
I have solved the problem and as this is an issue which seems to be affecting a lot of people and there is so little documentation on this i will post the answer. The issue was the virtual server configuration in the config file.
For me in plesk it is located in /etc/postfix/main.cf
navigate to the bottom of the document and find;
# readme_directory: The location of the Postfix README files. # readme_directory = /usr/share/doc/postfix-2.8.14/README_FILES #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 transport_maps = hash:/var/spool/postfix/plesk/transport smtpd_tls_cert_file = /etc/postfix/postfix_default.pem smtpd_tls_key_file = $smtpd_tls_cert_file
as you can see i have commented out the three entries with virtual_. These are the only one's i needed to comment out. then you can either restart the server or run this command over ssh;