linagora / james-project

Mirror of Apache James Project
Apache License 2.0
72 stars 62 forks source link

[CNB] Invalid EHLO argument received: [IPV6:2a01:cb06:b841:bf5d:38ff:861a:1646:ab77] #5317

Closed chibenwa closed 2 weeks ago

chibenwa commented 2 weeks ago

In SmtpServerTest,

    @Test
    public void test() throws Exception {
        smtpConfiguration.setAuthorizedAddresses("128.0.0.1/8");
        smtpConfiguration.setAuthorizingAnnounce();
        init(smtpConfiguration);

        SMTPClient smtpProtocol = new SMTPClient();
        InetSocketAddress bindedAddress = testSystem.getBindedAddress();
        smtpProtocol.connect(bindedAddress.getAddress().getHostAddress(), bindedAddress.getPort());

        smtpProtocol.sendCommand("ehlo", "[IPV6:2a01:cb06:b841:bf5d:38ff:861a:1646:ab77]");
        assertThat(smtpProtocol.getReplyString()).contains("250");
    }

fails...

Please fix it...

(spotted on custoer production, prevent mail delivery)

chibenwa commented 2 weeks ago

Also did get "Invalid EHLO argument received: cabinet-maitre-.domain. Must be a domain name or an IP address."

Understand what's going on? Remove trailing . ?

quantranhong1999 commented 2 weeks ago

Also did get "Invalid EHLO argument received: cabinet-maitre-.domain. Must be a domain name or an IP address." Understand what's going on? Remove trailing . ?

Actually, it was EHLO cabinet-maitre-.domain.

It seems not a valid hostname as - should not be the start or end characters:

image
quantranhong1999 commented 2 weeks ago

https://github.com/apache/james-project/pull/2492