cancel
Showing results for 
Search instead for 
Did you mean: 

Sending mail from Linux server in Virtual Machine no longer working - 550 sender rejected

osfan
Dabbler
Posts: 13
Registered: ‎27-06-2014

Sending mail from Linux server in Virtual Machine no longer working - 550 sender rejected

I wonder if anyone could help me understand what's going on, what's changed, and what I need to do to fix my issue.

 

I used to be able to have mail sent using Postfix on a Linux server running in a virtual machine on my desktop to various test email addresses. I used a Turnkey Linux image running in VMWare as the Turnkey Linux server is set up to allow mail out with Postfix pre-configured.

 

I recently needed to test an application on my Linux server, but am no longer able to get email.

If I look in the /var/log/mail.log  I find messages such as 

<www-data@localhost> sender rejected - invalid domain (no MX or A record) (in reply to MAIL FROM command))

I have   

relayhost = relay.force9.net

in my mail.cf in /etc/postfix

My site on Linux is set up as a virtual host using a 192.168.1.x on a particular port.

My server does not have a domain name as it's just for testing.

All I am doing is running the Php mail($to, $subject, $body, $headers);   command

As I say this used to work fine.

I would be grateful for any help.

Thank you.

 

2 REPLIES 2
7up
Community Veteran
Posts: 15,794
Thanks: 1,550
Fixes: 17
Registered: ‎01-08-2007

Re: Sending mail from Linux server in Virtual Machine no longer working - 550 sender rejected

Well it looks like someone somewhere has changed the configuration so that the mail server performs a dns check on the senders domain before accepting mail - aka checking that you're not a spammer. In this case your domain doesn't have a MX or A record setup on any dns server and thus you're done for.

 

Simple answer would be to jump over to a dns service like no-ip or freedns.afraid.org and get yourself a subdomain from one of their domains and create an A record pointing to your network. Then use that in your outgoing mail instead of localhost.

I need a new signature... i'm bored of the old one!
osfan
Dabbler
Posts: 13
Registered: ‎27-06-2014

Re: Sending mail from Linux server in Virtual Machine no longer working - 550 sender rejected

Thank you 7up, a sensible suggestion.

 

I have managed to make it work by changing

myhostname = localhost

to

myhostname = force9.net

in /etc/postfix/main.cf

just in case this is of use to anyone else with a similar problem.