up vote 2 down vote favorite
share [g+] share [fb]

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.

link|improve this question

38% accept rate
feedback

2 Answers

up vote 3 down vote accepted

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.

link|improve this answer
I changed the question – Bart van Heukelom May 5 '09 at 16:24
It should be a colon, not a "." – Alnitak May 5 '09 at 16:47
Changing it to a colon helped. It works now – Bart van Heukelom May 7 '09 at 12:30
feedback

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
link|improve this answer
iptables is awesome like that. – Magus May 5 '09 at 17:13
strange, the multiple port syntax in my answer seems to work fine. – Alnitak May 5 '09 at 19:21
@Alnitak, I used your syntax on my system and dovecot started, but netstat only showed it listening on one port. (deb5.0) – Zoredache May 5 '09 at 19:50
Having Dovecot listen to multiple ports for the same service is possible since version 1.1. Debian Lenny only ships Dovecot 1.0.x. – joschi Jun 1 '09 at 10:24
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.