Hi, the default: listen = *, :: should work and should open port 143 on IPv4 and IPv6. In my setup it looks broken: root at mail-archiv:/etc/dovecot# doveconf | grep ^listen listen = *, :: root at mail-archiv:/etc/dovecot# /etc/init.d/dovecot restart Restarting mail server: dovecotError: service(imap-login): listen(::, 143) failed: Address already in use Fatal: Failed to start listeners root at mail-archiv:/etc/dovecot# But it's working with "listen = *": root at mail-archiv:/etc/dovecot# doveconf | grep ^listen listen = * root at mail-archiv:/etc/dovecot# /etc/init.d/dovecot restart Restarting mail server: dovecot. root at mail-archiv:/etc/dovecot# Peer Heinlein -- Heinlein Professional Linux Support GmbH Linux: Akademie - Support - Hosting http://www.heinlein-support.de Tel: 030-405051-42 Fax: 030-405051-19 Zwangsangaben lt. ?35a GmbHG: HRB 93818 B / Amtsgericht Berlin-Charlottenburg, Gesch?ftsf?hrer: Peer Heinlein -- Sitz: Berlin
On Wed, 2010-08-04 at 16:47 +0200, Peer Heinlein wrote:> Restarting mail server: dovecotError: service(imap-login): listen(::, > 143) failed: Address already in use..> But it's working with "listen = *": > > root at mail-archiv:/etc/dovecot# doveconf | grep ^listen > listen = * > root at mail-archiv:/etc/dovecot# /etc/init.d/dovecot restart > Restarting mail server: dovecot.Does "listen = *" also make it listen on IPv6? Sounds like you've enabled some "IPv6 binds listen for IPv4 too" feature. What OS is this? Does compiling this program give the "blah" error on your system? #include <sys/socket.h> #include <netinet/in.h> #include <netdb.h> #include <arpa/inet.h> #ifdef IPV6_V6ONLY # error blah #endif
On 2010-08-04 16:47:10 +0200, Peer Heinlein wrote:> listen = *, ::what os/distro? there is this ipv6-mapped-v4 stuff (::ffff:), which might cause trouble here.> But it's working with "listen = *": > > root at mail-archiv:/etc/dovecot# doveconf | grep ^listen > listen = *how does the netstat -tuplen | grep 143 look like with this? darix -- openSUSE - SUSE Linux is my linux openSUSE is good for you www.opensuse.org
On Wed, Aug 4, 2010 at 10:47, Peer Heinlein <p.heinlein+dovecot at heinlein-support.de> wrote:> the default: > > listen = *, :: > > should work and should open port 143 on IPv4 and IPv6.On Linux, listening to :: in IPv6 has the effect of listening also on 0.0.0.0 in IPv4, even though only a single socket is involved. If the process binds a socket first to IPv4 then another socket to IPv6, the IPv6 bind will fail with EADDRINUSE (Address already in use). At this point the process is listening to IPv4 but not IPv6. If the process binds a socket first to IPv6 then another socket to IPv4, the IPv4 bind will fail with the same error. But the socket bound to IPv6 will be listening also to IPv4 via 4-in-6. IPv4 peers can connect and will show a peer address like ::ffff:xxxx:xxxx or ::ffff:xx.xx.xx.xx depending on how the address gets formatted. On OpenBSD, this does not happen, and a process must bind a socket separately for IPv6 and IPv4 to be able to listen in both address spaces. I don't know how other operating systems do it. But it should be one way or the other. What a program doing such socket binding could (maybe should) do is either understand what OS it is running on and act accordingly, or just bind the IPv6 socket first and treat a failure to bind on IPv4 as a soft error if the IPv6 succeeded. So, if you are on Linux, just use listen = :: and test if you can connect via the IPv4 address. If so, you are good to go. But, if you are on OpenBSD, just use listen = * and test if you can connect via the IPv6 interface address (you can use the IPv6 link-local address if you connect from an IPv6 peer on the same LAN segment and specify the outgoing interface index as part of the address). On another OS, try each way and use what works. Or you can listen on your explicit interface addresses (not ::ffff:xxxx:xxxx or ::ffff.xx.xx.xx.xx) in each address space. -- sHiFt HaPpEnS!
On Thu, 2010-08-05 at 09:44 -0400, Phil Howard wrote:> On Linux, listening to :: in IPv6 has the effect of listening also on > 0.0.0.0 in IPv4, even though only a single socket is involved.Not if you do this (and Dovecot does): opt = 1; setsockopt(fd, IPPROTO_IPV6, IPV6_V6ONLY, &opt, sizeof(opt));
Possibly Parallel Threads
- "doveadm penalty -a" doesn't work?
- exim4 + dovecot + SquirrelMail virtualhosted on Debian
- doveadm mailbox command in multi instance setup
- sieve-plugin: undefined symbol mail_deliver_get_lvar_expand_table
- crash on shared folders if remote user has empty $home