3

I'm running Dovecot to let people access their email on my server. Unfortunately, some are on networks where they can't connect on the normal IMAP port, so I'm trying to change it. I changed the config to contain:

protocol imap {
  listen = *.1433 *.143
  ...

Then dovecot fails to restart:

Fatal: listen: Can't resolve address *.1433: Name or service not known

What's the correct way of doing this? If possible, I'd prefer to have it listening on both ports.

Bart van Heukelom
  • 1,199
  • 6
  • 21
  • 41

3 Answers3

3

On my FC10 system running dovecot-1.1.10-1.fc10 the syntax is:

protocol imap {
    listen = *:9999 *:143
    ....
}

Look to see what error is being reported. If the configuration is actually correct then the most likely is 'Address already in use', meaning that some other process is already listening on port 9999.

EDIT - I see you've amended the question. The error is that you're using a '.' instead of a ':' as the port separator.

Alnitak
  • 21,191
  • 3
  • 52
  • 82
3

I did a little research, accourding to the FAQ

Is it possible to have Dovecot imap/pop daemons listening on multiple ports?

No, not in the current stable release. But there are workarounds, eg using your firewall to redirect incoming traffic to a given port.

You can simply use iptables to redirect connections to 9999 to 143 with a command like below.

/sbin/iptables -t nat -A PREROUTING -p tcp --dport 9999 -j REDIRECT --to-ports 143
Zoredache
  • 130,897
  • 41
  • 276
  • 420
2

With a current (2015) Dovecot version, the configuration for a different port or multiple ports is now different. You add a inet_listener ... {} section for each port. On my Debian 8 (Jessie) system, it is in /etc/dovecot/conf.d/10-master.conf:

service imap-login {
  inet_listener imap {
    #port = 143
  }
  inet_listener imap_9143 {
    port = 9143
  }
  inet_listener imap_whatever {
    port = 54321
  }
}

If it's in another file on your system, you can find it with grep -r -l 'inet_listener imap' /etc.

mivk
  • 4,004
  • 3
  • 37
  • 32