• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Resolved My mail server is on a spam list

brownbag

Basic Pleskian
My outgoing mail is being blocked by certain mail servers with the following error:
<[email protected]>: host mail.abuseat.org[54.93.50.35] said: 550 *** The
HELO for IP address 139.180.168.140 was 'localhost.localdomain' (invalid
syntax) *** (in reply to RCPT TO command)

It appears that to resolve this, I have to "correct your HELO localhost.localdomain and if needed, configure your mail server with correct DNS (forward and reverse) and HELO/EHLO values".
My mail server is on my plesk server and I'm using phpmailer to send mail.

The code that I use to send mail (edited for privacy and simplicy reasons) is:

PHP:
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\SMTP;
use PHPMailer\PHPMailer\Exception;

        $mail = new PHPMailer(true);

        //Server settings
        $mail->SMTPDebug = 0;
        $mail->isSMTP();
        $mail->Host       = 'mydomain.com';
        $mail->SMTPAuth   = true;
        $mail->Username   = '[email protected]';
        $mail->Password   = '***************';
        $mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
        $mail->Port       = 587;

        //Recipients
        $mail->setFrom([email protected], 'My company');
        $mail->addAddress([email protected]);
        $mail->addCC($cc_email);
        $mail->addReplyTo([email protected], 'do not reply');

        // Content
        $mail->isHTML(true);
        $mail->Subject = 'subject';
        $mail->Body    = 'message';
        $mail->AltBody = 'message';

        $mail->send();

Can I get some advice on areas that I should look for to 'fix' this problem.
 
I have found a solution that seems to be suited. My hostname wasn't set so that's probably the issue.
I've modified the hostname by modifying /etc/hosts, but what is odd is that it is not reflected immediately.

My hosts file is as follows:

127.0.0.1 localhost.localdomain localhost

# The following lines are desirable for IPv6 capable hosts
::1 localhost.localdomain localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
hostname servername.mydomain.com

changes to hostname are meant to take effect immediately but the hostname command still returns
localhost.localdomain.

do I need to remove the first line which seems to set it to localhost.localdomain? Why is this line there?
 
Back
Top