# How to configure sendmail to run with IPv6
#
# Authors: Gopi Garge, Vaibhav Sharma - Exocore Consulting P Ltd.
# E-mail: gopi, vaibhav@exocore.com
# Date: 31 Aug 2002
# History: This document originated out of a query to the IPv6 list
# Assumptions: Reader familiarity with sendmail source distributions and
# typical sendmail idiosyncrasies.
#

1. Facts:

Sendmail has had support for IPv6 for a long time now. The current version is 8.12.6 and the v6 support has been there since version 8.9.x (??)

 

2. Pre-requisites:

The host/server that you want to enable v6 support for sendmail must have v6 enabled on it. If you use Linux, you can run xinetd-ipv6.
 

With v6 enabled on your host along with the v4 stack, each interface will have a total of three addresses:

a) an IPv4 address, say 192.168.1.19

b) an IPv6 link local address, autoconfigured with the MAC address
c) an IPv6 site local address that would typically encode your v4 address,  fec0:ffff:192:168::19

You can view these addresses by running ifconfig.

3. Enabling v6 for sendmail:

The magic happens in the sendmail configuration files. It is a good practise to understand how to use the .mc files and convert them to .cf files using m4.

By enabling v6 for sendmail, we mean that an instance of the sendmail daemon must listen on a v6 socket and respond to incoming connections on this v6 socket. Such a v6 socket will be bound to a port and an IPv6 address.

The option that sendmail provides to define these parameters is

the option O ( -O on the command line; use man sendmail )
with the option name DaemonPortOptions. This option can take upto eight (keyword, value) pairs [1]. These are the options which the daemon can use to gather information on what ports/sockets to bind to.

The corresponding .mc file macro is DAEMON_OPTIONS. Here are the example entries to make in such a .mc file:

DAEMON_OPTIONS(`Name=MTA-v6, Family=inet6, port=smtp, Addr=::1')

DAEMON_OPTIONS(`Name=MTA-v6, Family=inet6, port=smtp, Addr=fec0:ffff:192:168::19')
 

 

The keyword, value pairs mentioned here are self-explanatory. The 'Name'  has a value that is used as a string label to identify the daemon instance in the logs. When you have both a v4 and a v6 stack, you might want to  know how many connections came in via the v4 stack and how many via the v6 stack. 'Name' helps in such a situation. A typical log entry is shown below:

Aug 31 12:10:19 hostname sendmail[6402]: NOQUEUE: [::1] did not issue MAIL/EXPN/VRFY/ETRN during connection to MTA-v6
 

 

Add the DAEMON_OPTIONS to the end of your .mc file, making sure that you change the IPv6 address appropriately. Now, generate the .cf file using m4. Replace the working copy of the .cf file with the one you generated and restart the sendmail daemon. Watch maillog for errors. If there are none, test by using a telnet ::1 25 to get the sendmail daemon prompt.
 

 

4. Quick and Dirty hack:

a) Edit your sendmail.cf

b) Add the following lines with the appropriate IPv6 interface address just below the section SMTP daemon options

# sendmail v6 listner - Added 310802

O DaemonPortOptions=Name=MTA-v6, Family=inet6, port=smtp, Addr=::1
O DaemonPortOptions=Name=MTA-v6, Family=inet6, port=smtp, Addr=fec0:ffff:192:168::19
#

c) Restart or HUP sendmail and watch for errors

d) telnet ::1 25

 
 

5. References:

[1]: The Sendmail Reference Guide - pp 60,61

Search

Everything here is Copyright © The Author of the Piece
Anything else is Copyright © 2004 The Bangalore Linux User Group
All Rights Reserved.

Comments? Feedback? Mail The WebMaster

Website sponsored and maintained by
[Exocore]