Problem with send e-mail via PHPMailer

General discussion of Mantis.

Moderators: Developer, Contributor

Post Reply
victorlopes
Posts: 2
Joined: 12 Jul 2017, 23:51

Problem with send e-mail via PHPMailer

Post by victorlopes »

Problem description

We had some problems with sending Mantisbt shipping. It uses PHPMailer and gave problem because of Hostname.domain, specifically in "mantis.*" (look at the bug below). I do not know if the problem is in PHPMailer or the mantisbt tool, but we solved it by setting this parameter, like:

t_mail->Helo = 'mantis.domain.com.br'

in

mantis_directory/core/email_api.php

It's not an Issue, but it's a problem we've had and solved it that way.

We get into trouble by running command:

openssl s_client -starttls smtp -crlf -connect smtp.gmail.com:587

and doing the whole SMTP protocol.

Debug output
Error Log:

2017-11-29 23:30:10 SERVER -> CLIENT: 220 smtp.gmail.com ESMTP k21sm2079012qta.27 - gsmtp 2017-11-29 23:30:10 CLIENT -> SERVER: EHLO mantis.* 2017-11-29 23:30:10 SERVER -> CLIENT: 501-5.5.4 HELO/EHLO argument *"mantis.*"* invalid, closing connection. 501 5.5.4 https://support.google.com/mail/?p=helo k21sm2079012qta.27 - gsmtp 2017-11-29 23:30:10 SMTP ERROR: EHLO command failed: 501-5.5.4 HELO/EHLO argument "mantis.*" invalid, closing connection. 501 5.5.4 https://support.google.com/mail/?p=helo k21sm2079012qta.27 - gsmtp 2017-11-29 23:30:10 CLIENT -> SERVER: HELO mantis.* 2017-11-29 23:30:10 SERVER -> CLIENT: 2017-11-29 23:30:10 SMTP ERROR: HELO command failed: 2017-11-29 23:30:10 SMTP NOTICE: EOF caught while checking if connected 2017-11-29 23:30:10 SMTP Error: Could not connect to SMTP host. 2017-11-29 23:30:10 SMTP Error: Could not connect to SMTP host.

Thanks.
victorlopes
Posts: 2
Joined: 12 Jul 2017, 23:51

Re: Problem with send e-mail via PHPMailer

Post by victorlopes »

So, in fact, it's an issue, the problem must be at the point where Mantisbt does the SMTP protocol. It should probably be picking up the hostname.domain parameter incorrectly.
Post Reply