1

Topic: imap-login: Disconnected: Too many invalid commands

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.6.2 PGSQL edition.
- Deployed with iRedMail Easy or the downloadable installer? downloadable installer
- Linux/BSD distribution name and version: FreeBSD 13.1-RELEASE-p3
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): PGSQL
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? No
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

I have a proprietary legacy software that used to work with my previous mailserver but after migrating to iRedMail it fails to connect authenticate with the iRedMail mailserver. I see the following in the logs:

imap-login: Disconnected: Too many invalid commands (no auth attempts in 0 secs):

When I enable all the verbose logging optins, I also see:

imap-login: Disconnected: Connection closed: read(size=855) failed: Connection reset by peer (disconnected before auth was ready, waited 0 secs)

I tried to override the iRedMail settings with the config from the previous server like:

auth_verbose=yes
auth_debug=yes
auth_debug_passwords=yes
mail_debug=yes
verbose_ssl=yes
auth_verbose_passwords=plain

disable_plaintext_auth = no

service imap-login {
    inet_listener imap {
        port = 143
    }
    inet_listener imaps {
        address = *
        port = 993
        ssl = yes
    }
}

ssl_cipher_list = AES128+EECDH:AES128+EDH:EECDH+CHACHA20:EECDH+AESGCM:EDH+AESGCM:AES256+EECDH

None of which works. I have to mention SOGo, Thunderbird, Geary, K9 on Android all work fine. I am running out of ideas.

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: imap-login: Disconnected: Too many invalid commands

In Googling for an answer, I found similar messages on Fail2Ban GitHub issues. Could it be because of fail2ban? If so, how can I disable it?

3

Re: imap-login: Disconnected: Too many invalid commands

OK, finally the following worked for me:

auth_mechanisms = plain login digest-md5 cram-md5

disable_plaintext_auth = no

service imap-login {
    inet_listener imaps {
        address = *
        port = 993
        ssl = yes
    }
}

I setup the software on port 993 and in the log I saw CRAM-MD5 that seems not enabled by iRedMail.