0

I have a Java web application which interacts with dovecot 2.2.36 and postfix 3.3.1 and I see errors from application log as keeps:

Java application Log:

04-06-2023 10:18:40 ERROR http-nio-8080-exec-58 comun.Correos:198 - javax.mail.AuthenticationFailedException: [UNAVAILABLE] Maximum number of connections from user+IP exceeded (mail_max_userip_connections=10)
        at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:717)
        at javax.mail.Service.connect(Service.java:388)
        at javax.mail.Service.connect(Service.java:246)
04-06-2023 10:18:43 ERROR http-nio-8080-exec-66 comun.Correos:198 - javax.mail.AuthenticationFailedException: [UNAVAILABLE] Maximum number of connections from user+IP exceeded (mail_max_userip_connections=10)
        at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:717)
        at javax.mail.Service.connect(Service.java:388)
        at javax.mail.Service.connect(Service.java:246)
04-06-2023 10:25:21 ERROR http-nio-8080-exec-59 comun.Correos:198 - javax.mail.AuthenticationFailedException: [UNAVAILABLE] Maximum number of connections from user+IP exceeded (mail_max_userip_connections=10)
        at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:717)
        at javax.mail.Service.connect(Service.java:388)
        at javax.mail.Service.connect(Service.java:246)

Also happens in /var/log/maillog:

Apr  5 16:11:01 java-app dovecot[24959]: imap-login: Maximum number of connections from user+IP exceeded (mail_max_userip_connections=10): user=<123456@example.com>, method=PLAIN, rip=192.168.1.10, lip=192.168.1.10, TLS, session=<fdhslshkjdsd>

Even though, I check the content of /etc/dovecot/conf.d/20-imap.conf and it says the following configuration:

protocol imap {
  mail_max_userip_connections = 1000
}

Dovecot has been restarted but it keeps with the same errors. Maybe 20-imap.conf file is not recognized.

Why the log reports mail_max_userip_connections=10 if set for mail_max_userip_connections = 1000?

user3637971
  • 155
  • 2
  • 11
  • 1
    Compare against the *effective* configuration (which you can dump using the `doveconf` program) that would rule out editing a file that is not parsed / has no effect due to conflicting settings elsewhere. – anx Apr 05 '23 at 22:35
  • Whatever you are doing, there is probably a better place to resolve this. Few sane setups should run into the 10 connection limit. Possibly you are seriously lacking privilege separation (sharing users/sessions/credentials between many users that should have differing access restrictions) or software quality (running into the limit because the application fails to properly reuse or close connections). – anx Apr 05 '23 at 22:40
  • I executed doveconf -a | grep "mail_max_userip_connections" and the value was showing 10. So what I did is adding the instruction !include conf.d/*.conf in dovecot.conf file and finally I restarted dovecot service. The property mail_max_userip_connections started to be considered. – user3637971 Apr 17 '23 at 19:34
  • Sounds like you got a solution. Please use the *answer* section below to share with future readers on how you figured and what eventually did the trick. – anx Jul 04 '23 at 02:29

0 Answers0