Sendmail email problems with VPS (yahoo, hotmail)

14 posts / 0 new
Last post
#1 Wed, 01/16/2013 - 06:50

Sendmail email problems with VPS (yahoo, hotmail)

Just got a new VPS. Everything is setup.

Server setup: BIND server - active (one master zone apache webhost - active (one virtual host for

Now it was working fine and I got sendmail to send emails to all email addresses using mail function.

However most of the emails sent were to my own yahoo and hotmail emails to test the feature.

I mainly use PHP mail() function.

Now recently hotmail blocked my IP: -- Transcript of session follows ----- ... while talking to

MAIL From:root@localhost.localdomain SIZE=569 <<< 550 SC-001 (SNT0-MC2-F4) Unfortunately, messages from 198.IP.IP.IP weren't sent. Please contact your Internet service provider since part of their network is on our block list. You can also refer your provider to 554 5.0.0 Service unavailable

I contacted hotmail and have got this resolved I hope.

But after sorting that out Yahoo then started blocking my emails: ----- The following addresses had permanent fatal errors ----- (reason: 553 5.7.1 [BL21] Connections will not be accepted from 198.IP.IP.IP, because the ip is in Spamhaus's list; see

----- Transcript of session follows ----- ... while talking to <<< 553 5.7.1 [BL21] Connections will not be accepted from 198.IP.IP.IP, because the ip is in Spamhaus's list; see 554 5.0.0 Service unavailable 550 5.1.1 MY@EMAIL.Address... User unknown

When i looked up my IP on spamhaus site it said it was only listed under CBL, which meant my server is not identifying itself properly, but why now, i didnt change anything and it was sending to Yahoo before ok: IP Address is listed in the CBL. It appears to be infected with a spam sending trojan, proxy or some other form of botnet. This IP address is HELO'ing as "localhost.localdomain" which violates the relevant standards (specifically: RFC5321).

So please can someone help me resolve this?

Here is copy of my etc\host\ mail localhost.localdomain localhost vmXXX

Auto-generated hostname. Please do not remove this comment.

198.IP.IP.IP vmXXX ::1 localhost.localdomain localhost


Wed, 01/16/2013 - 08:59


How much email is currently in your mail queue? You can determine that by running this command:

mailq | tail -1

Also, what does the command hostname return -- is that your actual hostname, or does it return "localhost"?


Wed, 01/16/2013 - 09:25

mailq | tail -1 Total requests: 0

hostname vm___

Wed, 01/16/2013 - 10:14

Can you paste in the output of the command "postconf -n"?

Wed, 01/16/2013 - 10:36

bash: postconf: command not found

Wed, 01/16/2013 - 12:24

It's possible that "/usr/sbin" isn't in your path.

Try this command:

/usr/sbin/postconf -n

Wed, 01/16/2013 - 12:35
tpnsolutions's picture


A note on getting removed from blacklists. While most providers will eventually work to assist you in getting removed from their block list, it is often easier to ask the data center or IP block owner to take care of this, assuming you have a good relationship with them.

The reason for this is because IP block owners, and data centers generally have a better relation with these organizations, understand how to speed up the process of being removed from the most popular blacklists and will generally be more long-term successful.

Companies like Hotmail, Yahoo, and Google often poll numerous reputable blacklists as part of their anti-spam practices. This means, getting off their internal list today, may result in being automatically added tomorrow if you don't resolve the underlying issue.

Often if you experience an issue for a prolonged period, while a bit of a pain, you may simply ask that your data center or provider issue you new IPs and let them deal with getting the IPs off the blacklists.

*** we've personally experienced blacklist issues in the past, and it is a very big pain in the butt getting off the lists at times, if you don't know how to go about it. ***


Best Regards,
Peter Knowles | TPN Solutions
Email: | Skype: tpnassist
Wed, 01/16/2013 - 13:58

i dont have postfix installed as i use sendmail. is that a problem?

Wed, 01/16/2013 - 14:35

Oh I see... yeah, that is indeed the problem.

Most of the time when folks say "Sendmail", they really mean "Postfix", since that's the default. But you really do mean Sendmail :-)

Unfortunately, I'm not familiar with Sendmail configuration, so I'm not sure how to tell you to correct that.

All I can offer is that somewhere in your Sendmail config, there's something in it that's causing the system to use "localhost.localdomain" as the HELO name. You may be able to browse your config and find that.

Unfortunately. if you move away from the default of Postfix, you're a bit more on your own for correcting issues that arise. Most folks here aren't familiar with Sendmail :-)


Thu, 01/17/2013 - 07:03

i have heard that postfix is better than sendmail.

Can you say for certain that if i install postfix that you could help resolve the issue?

Thu, 01/17/2013 - 09:50

i chnaged hostname to using command prompt

i then set the MASQUERADE_AS(`')

i then tried i then i could send mail from command prompt and using php mail() to yahoo.

i sent several messages. the messages FROM header was shown as ""

Then it stopped working again. When i sent a nother mail the from header had reverted back to "root@localhost.localdomain"


Thu, 01/17/2013 - 09:55

Well, it's not that one is better than the other, or that this problem will just go away by switching.

It's that the folks in the forums here (including myself) know how to fix that problem in Postfix :-)

However, it's not possible (or at least, not simple) to switch from Sendmail to Postfix once Virtualmin has begun adding users to the one.

One thing you could try is to hunt down a Sendmail guru for help. Someone who knows Sendmail could probably fix that issue in a couple of minutes.

Or just Google for how to change the HELO in Sendmail, you may find some options there. For example, I Google'd "change sendmail helo hostname", and got a lot of promising results, including this one:

The change you need to make to update the HELO hostname isn't a large one, it may just be a matter of researching which parameter exactly to tweak.


Thu, 01/17/2013 - 12:55

Im crossing fingers and saying its fixed now....

I have installed postfix and it seems its easier to configure how you want it. I can send via postfix.

I also got option to use ISP mail relay host as a last resort

I also used changed /etc/mail/ file to include this:

That seems to help. I still have left the hostname as and also the sendmail masquerade settings.

So this is solved for now I hope this helps anyone else having the same issues.


Wed, 01/23/2013 - 15:47

php mail function is bad imho in fact I have it disabled on my servers. I use smtp for everything yes it involves creating an account for your sites mail but I've not been added to any block list so far. Dispite tons of spammers hitting my mail servers over the years. Less so in recent memory but any time you have a contact form that sends email on a web facing host you will need to deal with spammers/anti spam etc. These spammers use fake email addresses with known hosts most of the time. So when they try and send you mail it gets bounced back to the server they spoofed yahoo etc. Eventually yahoo etc gets tired of this and they block you. So I'd set up a spamtrap and disable mail bouncing only send through smtp with proper DKIM sigs and turn off open smtp relay. Make sure your hostname is fully qualified and you have reverse pointer records to your server from the IP most hosts will allow you to set up a pointer. It doesn't even have to point to mail sub-domain just to the machine from which you send mail.

Topic locked