SMTP Error when connecting to external smtp server

I’m trying to connect to an external smtp server but for some reason i get the following error

3: Connection: opening to REDACTED(REMOTE SMTP SERVER):587, timeout=300, options=array (
)
3: Connection: opened
2: SERVER -> CLIENT: 220 dedi698.jnb1.host-h.net ESMTP XNEELO_MTA 1.00 Wed, 05 Aug 2020 10:11:26 +0200

1: CLIENT -> SERVER: EHLO REDACTED(LOCAL DOMAIN)

2: SERVER -> CLIENT: 501 Syntactically invalid EHLO argument(s)

1: SMTP ERROR: EHLO command failed: 501 Syntactically invalid EHLO argument(s)

1: CLIENT -> SERVER: HELO REDACTED(LOCAL DOMAIN)

2: SERVER -> CLIENT: 501 Syntactically invalid HELO argument(s)

1: SMTP ERROR: HELO command failed: 501 Syntactically invalid HELO argument(s)

3: SMTP Error: Could not authenticate.
1: CLIENT -> SERVER: QUIT

2: SERVER -> CLIENT: 221 dedi698.jnb1.host-h.net closing connection

3: Connection: closed
3: SMTP Error: Could not authenticate.

When using the the smtp server that is on the same domain as suitecrm it works fine.

Where are these REDACTED coming from? Did you put them in manually when posting in the forums? If not, then that’s your problem - find out which security component is editing your traffic

@pgr I put it there manually.

I’m going to guess that you’re trying to connect to an exim based mail server and experiencing this problem:

https://lists.exim.org/lurker/message/20041124.113314.c44c83b2.en.html

As part of the initial negotiation, the client system will send a message along the lines off:

HELO clientname.net

If the name of the mail client (in this case the name of the server hosting the suiteCRM has an underscore (or other invalid character in it), then you will get this error (depending on the exim mailserver configuration).

If this is the problem, then it can be trivially resolved by changing the hostname of the suiteCRM server. (This is the hostname that the server identifies itself as not the DNS name - On a linux system this can be viewed with the console command hostname).

Another alternative could plausible be to set $_SERVER[‘SERVER_NAME’] to something different in the suiteCRM code somewhere, if you are unable to change the reported name of the server concerned (e.g. on shared hosting)

Hopefully that gives you enough pointers to rectify the problem?

Thanks, I’ve solved the problem.

The issue was that in my config.php ‘site_url’ => ‘https://site.com’ must be ‘site_url’ => ‘site.com’, same for host_name.

So I’m posting this just in case someone else makes the same stupid mistake.

1 Like