imapext-2007

diff docs/IPv6.txt @ 0:ada5e610ab86

imap-2007e
author yuuji@gentei.org
date Mon, 14 Sep 2009 15:17:45 +0900
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/docs/IPv6.txt	Mon Sep 14 15:17:45 2009 +0900
     1.3 @@ -0,0 +1,131 @@
     1.4 +/* ========================================================================
     1.5 + * Copyright 1988-2006 University of Washington
     1.6 + *
     1.7 + * Licensed under the Apache License, Version 2.0 (the "License");
     1.8 + * you may not use this file except in compliance with the License.
     1.9 + * You may obtain a copy of the License at
    1.10 + *
    1.11 + *     http://www.apache.org/licenses/LICENSE-2.0
    1.12 + *
    1.13 + * 
    1.14 + * ========================================================================
    1.15 + */
    1.16 +
    1.17 +The following information about configuring inetd and xinetd for IPv6 was
    1.18 +contributed by a user.  I have not checked it for accuracy or completeness,
    1.19 +but have included it as-is in the hope that it may be useful:
    1.20 +
    1.21 +---------------------------------------------------------------------------
    1.22 +One thing you might consider adding to the docs are hints for setting up
    1.23 +inetd or xinetd to simultaneously listen on BOTH IPv4 and IPv6 for
    1.24 +different OS.
    1.25 +
    1.26 +Some OS want to see separate IPv4-only and IPv6-only listening sockets
    1.27 +configured in inetd.conf or xinetd.conf.  Others will accept IPv4
    1.28 +connections on lines configured for IPv6 and actually generate errors if
    1.29 +you have both configured when inetd or xinetd start up.  It's not clear to
    1.30 +me whether this difference is due to how inetd or xinetd are built or
    1.31 +whether it's due to the kernel's IP stack implementation.  I suspect it's
    1.32 +really the latter.  Below are some examples:
    1.33 +
    1.34 +Here's a fragment of /usr/local/etc/xinetd.conf for a FreeBSD 4.9 server:
    1.35 +
    1.36 +service imap
    1.37 +{
    1.38 +        socket_type     = stream
    1.39 +        protocol        = tcp
    1.40 +        wait            = no
    1.41 +        user            = root
    1.42 +        server          = /usr/local/libexec/imapd
    1.43 +}
    1.44 +service imap
    1.45 +{
    1.46 +        flags           = IPv6
    1.47 +        socket_type     = stream
    1.48 +        protocol        = tcp
    1.49 +        wait            = no
    1.50 +        user            = root
    1.51 +        server          = /usr/local/libexec/imapd
    1.52 +}
    1.53 +service imaps
    1.54 +{
    1.55 +        socket_type     = stream
    1.56 +        protocol        = tcp
    1.57 +        wait            = no
    1.58 +        user            = root
    1.59 +        server          = /usr/local/libexec/imapd
    1.60 +}
    1.61 +service imaps
    1.62 +{
    1.63 +        flags           = IPv6
    1.64 +        socket_type     = stream
    1.65 +        protocol        = tcp
    1.66 +        wait            = no
    1.67 +        user            = root
    1.68 +        server          = /usr/local/libexec/imapd
    1.69 +}
    1.70 +
    1.71 +Note that you have to specify a nearly identical paragraph for each
    1.72 +service which differs only by the 'flags = IPv6'.  An equivalent
    1.73 +inetd.conf would look something like:
    1.74 +
    1.75 +imap  stream  tcp     nowait  root    /usr/local/libexec/imapd        imapd
    1.76 +imap  stream  tcp6    nowait  root    /usr/local/libexec/imapd        imapd
    1.77 +imaps stream  tcp     nowait  root    /usr/local/libexec/imapd        imapd
    1.78 +imaps stream  tcp6    nowait  root    /usr/local/libexec/imapd        imapd
    1.79 +
    1.80 +The man pages for inetd suggest that if you use a single entry with
    1.81 +'tcp46' replacing either 'tcp' or 'tcp6' the system will listen on both
    1.82 +types of addresses.  At least for the case of FreeBSD this is actually
    1.83 +incorrect.
    1.84 +
    1.85 +Now if you were to use the above xinetd.conf on Fedora Linux, it would
    1.86 +complain.  What does work under Linux is to create a single service
    1.87 +paragraph for each service which will accept connections on both IPv4 and
    1.88 +IPv6:
    1.89 +
    1.90 +In /etc/xinetd.d/imap:
    1.91 +
    1.92 +service imap
    1.93 +{
    1.94 +        flags       = IPv6
    1.95 +        disable     = no
    1.96 +        socket_type = stream
    1.97 +        wait        = no
    1.98 +        user        = root
    1.99 +        server      = /usr/local/sbin/imapd
   1.100 +}
   1.101 +
   1.102 +In /etc/xinetd.d/imaps:
   1.103 +
   1.104 +service imaps
   1.105 +{
   1.106 +        flags       = IPv6
   1.107 +        disable     = no
   1.108 +        socket_type = stream
   1.109 +        wait        = no
   1.110 +        user        = root
   1.111 +        server      = /usr/local/sbin/imapd
   1.112 +}
   1.113 +
   1.114 +The man page for xinetd says the IPv6 flag means xinetd will listen ONLY
   1.115 +on IPv6.  However the actual behaviour (for Fedora Linux) is to listen on
   1.116 +both IPv4 and IPv6.
   1.117 +
   1.118 +All of the above also applies to ipop3d.  Anyway, this might save some
   1.119 +folks a little bit of head scratching time.
   1.120 +---------------------------------------------------------------------------
   1.121 +Addendum from the original submitter:
   1.122 +---------------------------------------------------------------------------
   1.123 +I've since learned that the discrepancy really is a function of the OS.
   1.124 +It seems those systems that force you to create separate IPv4 and IPv6
   1.125 +listeners in inetd (or xinetd) are the same systems that also disable
   1.126 +IPv4-mapped IPv6 addresses by default.  This is a boot-time configuration
   1.127 +option.  If you enable IPv4-mapped IPv6 addresses, then the 'tcp46' option
   1.128 +in inetd works and the simplified config would look like:
   1.129 +
   1.130 +imap4   stream  tcp46   nowait  root    /usr/local/libexec/imapd        imapd
   1.131 +imaps   stream  tcp46   nowait  root    /usr/local/libexec/imapd        imapd
   1.132 +
   1.133 +In FreeBSD, enabling IPv4-mapped addresses is done by adding
   1.134 +ipv6_ipv4mapping="YES" to /etc/rc.conf (in addition to ipv6_enable="YES").

UW-IMAP'd extensions by yuuji