Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Phpmail and mailinblack #2781

Closed
dede441 opened this issue Sep 29, 2022 · 5 comments
Closed

Phpmail and mailinblack #2781

dede441 opened this issue Sep 29, 2022 · 5 comments

Comments

@dede441
Copy link

dede441 commented Sep 29, 2022

Hi,
Since some months i user Phpmailer to send all my company emails to replace Outlook.
All is ok ... apparently, but we never get anti-spam/mailinblack verification email.
btw if we send the same mail with Outlook, we get back mailinblack verification email.

Emails are send via a domain with valid SPF/DKIM.
I verify my configuration and all seems ok.

That's a part of my header code to see if you've got an idea:

$mail = new PHPMailer\PHPMailer\PHPMailer;
$mail->setLanguage('fr');
$mail->IsSMTP();
$mail->Timeout=5;
$mail->Host = $compte["HOST"];
$mail->Port = $compte["PORT_OUT"];
$mail->SMTPAuth = true;
$mail->XMailer = " ";
$mail->Username = $compte["LOGIN"];
$mail->Password = $compte["PASS"];
if(isset($compte["DKIM_DOMAIN"])) {
$mail->DKIM_domain = $compte["DKIM_DOMAIN"];
$mail->DKIM_private = $compte["DKIM_PRIVATE"];
$mail->DKIM_selector = $compte["DKIM_SELECTOR"];
$mail->DKIM_passphrase = $compte["DKIM_PASSPHRASE"];
$mail->DKIM_identity = $compte["DKIM_IDENTITY"];
}
$mail->IsHTML(true);
$mail->CharSet = "UTF-8";
$mail->Encoding = "base64";

$mail->setFrom($deMail,$de);
$mail->addReplyTo($deMail, $de);
$mail->Sender = $deMail;
$mail->addCustomHeader("Sender",$de . " <" . $deMail . ">");
$mail->addCustomHeader("List-Unsubscribe","<mailto:" . $deMail . ">");
....

There's something more to do ?

@Synchro
Copy link
Member

Synchro commented Sep 29, 2022

I can't tell from the code. Look at the headers of received messages and compare them. I don't know mailinblack, but I would hope they give you some feedback on why they act as they do, probably in extra headers.

@dede441
Copy link
Author

dede441 commented Sep 29, 2022

In fact, if i send the same mail:

  • From my hosting company (OVH), even if use the php mail() function, there's any issue. I received the anti-spam verificaition mail.
  • From my local server (Turnkey 13 - i know it's not uptodate) with phpmailer and sendmail configure, i didn't received the anti-spam verification mail.
    It's seems to be a server configuration issue no ?

@Synchro
Copy link
Member

Synchro commented Sep 29, 2022

I'd say it's a mail server configuration issue. Are you sure your messages are being sent at all? Check your mail server logs to see what is happening to them.

@dede441
Copy link
Author

dede441 commented Sep 29, 2022

I've just compare the two mail (the one who get reply from mailinblack - and the other one) and i noticed that "mine" (the one who didn't get a reply) has a "Message-ID" generated by phpmailer but not with a real qualified name (ex: @linux) as RFC said.

The mail who works has a "Message-ID" like "[email protected]".

Can it be a way ?

@Synchro
Copy link
Member

Synchro commented Sep 29, 2022

The message IDs that PHPMailer generates are RFC compliant, however, you can always override it and set your own to see if that helps. Simply:

$mail->MessageID = "[email protected]";

though of course you are then responsible for ensuring it's unique for every message.

@Synchro Synchro closed this as completed Oct 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants