[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: IPv6 Sendmail+Milter



Benoit, Fabio, others,

For my particular setup at Business Internet Trends, I chose to implement
a 'clean' IPv6 enabled sendmail/milter 8.12.9 where I use the following
configuration tactic. 

1. Unpack the tarball in /usr/local/src/

2. Create the file ./devtools/Site/site.config.m4 containing 3 lines:
APPENDDEF(`conf_sendmail_ENVDEF', `-DMILTER')
APPENDDEF(`conf_sendmail_ENVDEF', `-D_FFR_MILTER=1')
APPENDDEF(`conf_libmilter_ENVDEF', `-D_FFR_MILTER=1')

3. Edit sendmail/conf.h and define NETINET6 to 1 (is 0 in default sendmail)
   This is on line 161 on my box.

4. Make and install libmilter; 
   cd libmilter; ./Build; ./Build install

   (what this does is dump Milter header and libraries in /usr/local/)

4. Go back to the sendmail toplevel directory and run ./Build

5. run ./Build install to install the binaries.

Now, on my box I have some features enabled, and I always create .cf files
via .mc files. Take it from an oldtime Sendmail hacker, if you see anybody
editing .cf files to enable features, shoot them in the foot!

My MC file contains the following:
--------------------------------8<------------------------
divert(-1)

divert(0)dnl
VERSIONID(`$Id: crow.mc,v 1.5 2003/04/06 19:10:45 pim Exp $')
OSTYPE(bsd4.4)dnl
DOMAIN(generic)dnl
FEATURE(virtusertable)dnl

define(`confCW_FILE', ``/etc/mail/sendmail.cw'')dnl
define(`ALIAS_FILE', ``/etc/mail/aliases, /etc/mail/specials, /etc/mail/virusscan'')dnl

# Normally, the F=T option would be added between S= and T= options, making the
# mailer send a tempfail if the Milter was not available.  You may also specify
# F=R, to reject messages altogether (but be careful with this). Specifying 
# nothing for the F= option, makes sendmail accept the message and not check
# Milter at all (which might be undesirable).
#
# MUST FIX!

dnl Aparently, Milter needs us to define this.
define(`_FFR_MILTER', `1')dnl
INPUT_MAIL_FILTER(`bit-milter', `S=unix:/var/run/milter/bit-milter.sock, T=S:600s;R:600s;E:5m')dnl

# Crow has a Maildir/ aware procmail in /usr/local/bin/procmail !
FEATURE(`local_procmail', `/usr/local/bin/procmail')dnl

# /etc/mail/access.db functionality
FEATURE(access_db)dnl

DAEMON_OPTIONS(`Name=MTA-v4, Family=inet')
DAEMON_OPTIONS(`Name=MTA-v6, Family=inet6')

MAILER(local)dnl
MAILER(smtp)dnl
------------------------------>8------------------------
Note regarding the MC: The file is used for FreeBSD4.7, but the differences
with stock Debian should be changing the OSTYPE preprocessor.

All of this is self explanatory. The Milter I am calling is one I quickly
wrote up last week. Of course the only thing that's really important here
is that your Milter program is also IPv6 aware -- if it uses the
_SOCK_ADDR information given by mfli_connect(), it should be aware of the
address possible families (AF_INET and AF_INET6). Also make sure your code
is reentrant and threadsafe, because milter is linked with pthreads and
on a busy mailserver, things will break if your code relies on static buffers
and stack!

The sourcecode to bit-milter is not opensourced, but I'm sure my boss 
wouldn't mind me sharing it with the general public -- it isn't what one 
would call rocketscience. If anybody's interrested, I'll post the stuff to 
this list also.

You can test my IPv6 mailserver by sending me mail at <pim@bit.nl> which
has a AAAA record on mx1.bit.nl nowadays (crow.ipv6.bit.nl).

I hope this helps out.

-- 
                             __________________
Met vriendelijke groet,     /\ ___/
Pim van Pelt               /- \ _/  Business Internet Trends BV
PBVP1-RIPE                /--- \/            __________________



Reply to: