I am getting the above message from some mailserver (posteo.org) in response to the validation test.

According to https://www.roessner-network-solutions.com/mail.html

they must think that the request is somehow invalid. Anybody got an idea?

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

killes@www.drop.org created an issue. See original summary.

oadaeh’s picture

Sorry for the delay on this. It seems I missed quite a few new issues during the summer.

The page you linked to is no longer available, so I cannot see what they said.

However, in my searching for the error message, I found this (and not much else):
http://www.engardelinux.org/modules/index/list_archives.cgi?list=postfix...

Can you try it again with this module's debug mode enabled and see if there is any additional information about the SMTP connection there or maybe in the HTTP logs?

Thanks.

greenreaper’s picture

I believe the issue is that Email Verify isn't following the specification.

Per RFC 5321, section 4.2, the mail server's greeting may be either
220 Something
OR
220-Something
220-Something
220-...
220 The last thing

If you just check for 220 at the start of the first line, you will respond immediately, because "220-" matches "^220". However, this is incorrect (hence, "protocol error"), because that by itself is not a valid greeting. It must be zero or more "220-" and then a "220" line.

Leaving a short delay after the first line is sent and then checking for an immediate response is commonly used to filter out spam.

I ran into this on Drupal 6, and I used this replacement code in email_verify.inc [or rather, email_verify.inc.php for D6] to work around it:

    $connect = @fsockopen($smtp, 25, $errno, $errstr, 15);

    if (!$connect) continue;

    do {
      $out = fgets($connect, 1024);
    } while (preg_match("/^220-/", $out));

    if (preg_match("/^220/", $out)) {
      // OK, we have a SMTP connection
      break;
    }
    else {
      // The SMTP server probably does not like us

Nowadays there is a lot more debugging code in but the principle is the same - you have to read the entire greeting before responding.

This is the same problem as #1909918 and maybe others.

greenreaper’s picture

Category: Support request » Bug report

This is a actually a bug so I changed the issue type. Hope that's OK!

The mail server in question was mx01.posteo.de for a posteo.de account and on connection it response with this:

220-mx01.posteo.de ESMTP Postfix
[...waits six seconds...]
220 mx01.posteo.de ESMTP Postfix

sano made their first commit to this issue’s fork.

sano’s picture

Status: Active » Needs review