Recently changes were made to my server by my host regarding email due to spam.
I have found that a large number of spam is being sent from your
server:root@server2 [~]# exiqgrep -r *****.com -c 5814 matches out
of 6122 messagesThis means that the *****.com is the recipient of 5,814
messages being sent from your server. I have removed these messages
from the queue and increased the level of mail logging and security on
your server. I have also disabled your server from being an open
relay, which appears to be how the mail was being sent out. There is a
good chance that this was causing the delay, however the issue remains
that you have a hijacked script/account that is trying to send mail at
this rate. The server is now set to NOT send mail from any user other
than an SMTP user, root, and mailman; As such you will have to ensure
that any mail scripts are properly using SMTP authentication. You can
find more information on how to do so here:http://email.about.com/od/emailprogrammingtips/qt/PHP_Email_SMTP_Authentication.htm
I would also strongly suggest turning on DKIM and SPF records (which
can be done in cPanel under “Mail Authentication”) for any and all
domains on this server as it will reduce the chance of
bouncebacks/rejected mail as well as being blacklisted for the spam
that has been going out. I am also running a malware scan on the
***** account, and have turned off the default email address. I
will let you know as soon as the scan is complete whether or not there
were any hits.
My scripts now have to use SMTP Authentication. Now I’m getting errors after updating my code.
Warning: fsockopen() [function.fsockopen]: php_network_getaddresses:
getaddrinfo failed: Name or service not known in
/home/*/public_html/fkg/lib/phpmailer/class.SMTP.php on line 89Warning: fsockopen() [function.fsockopen]: unable to connect to
mail..*****.com:25 (php_network_getaddresses: getaddrinfo
failed: Name or service not known) in
/home/*/public_html/fkg/lib/phpmailer/class.SMTP.php on line 89
SMTP -> ERROR: Failed to connect to server: php_network_getaddresses:
getaddrinfo failed: Name or service not known (0) Mailer ErrorDescription: SMTP Error: could not connect to SMTP host server(s)
here is my code
$mail = new phpmailer();
$mail->SMTPDebug = 1;
$mail->IsSMTP(); // telling the class to use SMTP
$mail->Host = "mail.***.************.com"; // SMTP server
$mail->Port = "25";
$mail->SMTPAuth = true; //we need to autenticate to the server
//$mail->SMTPSecure = "ssl"; //we use ssl to protected the flow of info
$mail->Username = "noreply+*****.com"; //account
$mail->Password = "********"; //password
any ideas on what is happening. Thanks in advance.
Ok, in the end of the day, after a long chat session…
Few issues. In this case, server on the other side was
exim, which only allows you to authenticate after you hit it with anEHLOcommand.PHPMailer, that was used, doesn’t allow you to force aEHLO, so authentication againsteximserver didn’t work.Switching to
PEAR::Mail+PEAR::Net_SMTP+PEAR::Net_Socket“fixed” the issue.References: