Differences between revisions 3 and 4
Revision 3 as of 2008-01-08 03:29:46
Size: 4716
Editor: tlembke
Comment:
Revision 4 as of 2008-01-08 03:29:47
Size: 4641
Editor: tlembke
Comment: Migrated to Confluence 4.0
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
#pragma page-filename DOC/versions/14352444
This method uses the mm-handler.
[[../Integrating Mailman with Sendmail - Method 2|See also Method 2]] which does not use the mm-handler
#pragma page-filename DOC/versions/786602
This method uses the mm-handler.<<BR>> [[../Integrating Mailman with Sendmail - Method 2|See also Method 2]] which does not use the mm-handler
Line 6: Line 5:
Line 13: Line 13:
Line 14: Line 15:
For the purpose of this document the server domain shall be called mailman.foo.com and it is a 'A' name entry in the DNS.&nbsp;
Line 16: Line 16:
=== &nbsp;virtusertable ===
&nbsp;add the following in your /etc/mail/virtusertable
<<BR>>
For the purpose of this document the server domain shall be called mailman.foo.com and it is a 'A' name entry in the DNS. 

===  
virtusertable ===

add the following in your /etc/mail/virtusertable <<BR>>
Line 20: Line 23:
root@mailman.foo.bar&nbsp;&nbsp;&nbsp; admin@foo.bar&nbsp;
virtusertable

 
root@mailman.foo.bar    admin@foo.bar 
Line 23: Line 30:
this shall redirect any email to root on the server to be redirected to the email admin on the mail server.
<<BR>><<BR>><<BR>><<BR>><<BR>><<BR>><<BR>><<BR>>
=== &nbsp;local.m4 ===
local mailer is used by sendmail to deliver mails; however since we are not using the server to host any emails we don't need it.&nbsp; We can change it to pass all the mails to mm-handler. Edit /usr/share/sendmail-cf/mailer/local.m4
<<BR>>
this shall redirect any email to root on the server to be redirected to the email admin on the mail server. <<BR>> <<BR>> <<BR>> <<BR>> <<BR>> <<BR>> <<BR>> <<BR>>

===  local.m4 ===

local mailer is used by sendmail to deliver mails; however since we are not using the server to host any emails we don't need it.  We can change it to pass all the mails to mm-handler. Edit /usr/share/sendmail-cf/mailer/local.m4 <<BR>>
Line 29: Line 37:
at the end of the file look for
Line 31: Line 38:
Mlocal,&nbsp;&nbsp;&nbsp; ... local.m4
Line 33: Line 40:
and replace it with

Mlocal,&nbsp;&nbsp;&nbsp; P=/etc/mail/mm-handler, F=rDFMhlqSu, S=EnvFromL, R=EnvToL/HdrToL,
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;
T=DNS/RFC822/X-Unix, U=mailman:mail,
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;
A=mm-handler $h -j $j -d $u
  at the end of the file look for
Mlocal,    ...
and replace it with  
Mlocal,    P=/etc/mail/mm-handler, F=rDFMhlqSu, S=EnvFromL, R=EnvToL/HdrToL,<<BR>>              T=DNS/RFC822/X-Unix, U=mailman:mail,<<BR>>              A=mm-handler $h -j $j -d $u
Line 40: Line 47:
{{{#!wiki warning

Warning

 
Make sure that there is a tab after Mlocal, and not spaces.  Otherwise it might not work
}}}
Line 42: Line 56:
Make sure that there is a tab after Mlocal, and not spaces.&nbsp; Otherwise it might not work
Warning

 
This Mlocal is modified so that sendmail passes the hostname using -j parameter.  Also a -d parameter has been added before $u.
Line 45: Line 63:
 1. This assumes that mm-handler is installed in /etc/mail/mm-handler.  You change it to the location where mm-handler is installed/copied.
 1. U=mailman:mail shall run mm-handler as user:mailman, group:mail.  Change it to one that your mailman installation expects.
Line 46: Line 66:
{{{#!wiki warning
This Mlocal is modified so that sendmail passes the hostname using -j parameter.&nbsp; Also a -d parameter has been added before $u.
}}}
===  mm-handler ===
Line 50: Line 68:

 1. This assumes that mm-handler is installed in /etc/mail/mm-handler.&nbsp; You change it to the location where mm-handler is installed/copied.
 1. U=mailman:mail shall run mm-handler as user:mailman, group:mail.&nbsp; Change it to one that your mailman installation expects.
=== &nbsp;mm-handler ===
Line 57: Line 71:

 
Line 59: Line 75:
Line 65: Line 80:
This shall make the script executable by user and group.&nbsp; This shall make the script executable by user and group. 
Line 76: Line 91:
 * $SEND_MAIL is referring to correct program.
<<BR>>
{{{#!wiki warning
 * $SEND_MAIL is referring to correct program. <<BR>> 
 {{{#!wiki warning

Warning
Line 80: Line 97:
}}}

After configuring the variables in mm-handler run it on the console.&nbsp; This should generate log entries in your syslog.&nbsp; In this case look for /var/log/maillog or /var/log/messages or wherever your system is configured to log these subsystems (refer to syslog.conf).
<<BR>>
{{{
}}} After configuring the variables in mm-handler run it on the console.  This should generate log entries in your syslog.  In this case look for /var/log/maillog or /var/log/messages or wherever your system is configured to log these subsystems (refer to syslog.conf). <<BR>>
 {{{
Line 87: Line 101:
Month&nbsp; DD HH:MM:SS mailman mm-handler\[32284\]: #ARGV = -1 ARGV = &nbsp; Month&nbsp; DD HH:MM:SS mailman mm-handler\[32284\]: #ARGV = \-1 ARGV = &nbsp;
Line 89: Line 103:
}}}
Line 91: Line 104:
If any of the configuration parameters are not correct i.e. correct file is not there or directory doesn't exist then you should see error messages like

{{{
}}} If any of the configuration parameters are not correct i.e. correct file is not there or directory doesn't exist then you should see error messages like 
 {{{
Line 97: Line 109:
}}}
Line 99: Line 110:
Once mm-handler can run with no errors.&nbsp; Now you can try to send emails the server and see how it behaves.&nbsp; You can see the log output to verify that emails are being handled properly.&nbsp; Once you are satisfied with the configuration, you can change the syslog.conf and change the log level of mail to level 4 e.g }}} Once mm-handler can run with no errors.  Now you can try to send emails the server and see how it behaves.  You can see the log output to verify that emails are being handled properly.  Once you are satisfied with the configuration, you can change the syslog.conf and change the log level of mail to level 4 e.g
 {{{
mail.4 /path/to/maillog
Line 101: Line 114:
{{{
mail.4 /path/to/maillog
}}}

This will log error and warning messages to your log file that can be used for administration purposes.&nbsp;
}}} This will log error and warning messages to your log file that can be used for administration purposes. 

This method uses the mm-handler.
See also Method 2 which does not use the mm-handler

Assumption

The following has been tested using the following configuration

  • Mailman 2.1.9
  • Sendmail 8.13.1
  • CentOS release 4.5 (Final)
  • Attached mm-handler (most noticeable change is writing logs to syslog)
  • You are going to be using the server only for mailing lists and not for delivery to local addresses

Method

For the purpose of this document the server domain shall be called mailman.foo.com and it is a 'A' name entry in the DNS. 

virtusertable

add the following in your /etc/mail/virtusertable

virtusertable

root@mailman.foo.bar    admin@foo.bar 

this shall redirect any email to root on the server to be redirected to the email admin on the mail server.







local.m4

local mailer is used by sendmail to deliver mails; however since we are not using the server to host any emails we don't need it.  We can change it to pass all the mails to mm-handler. Edit /usr/share/sendmail-cf/mailer/local.m4

local.m4

at the end of the file look for Mlocal,    ... and replace it with Mlocal,    P=/etc/mail/mm-handler, F=rDFMhlqSu, S=EnvFromL, R=EnvToL/HdrToL,
             T=DNS/RFC822/X-Unix, U=mailman:mail,
             A=mm-handler $h -j $j -d $u

Warning

Make sure that there is a tab after Mlocal, and not spaces.  Otherwise it might not work

Warning

This Mlocal is modified so that sendmail passes the hostname using -j parameter.  Also a -d parameter has been added before $u.

  1. This assumes that mm-handler is installed in /etc/mail/mm-handler.  You change it to the location where mm-handler is installed/copied.
  2. U=mailman:mail shall run mm-handler as user:mailman, group:mail.  Change it to one that your mailman installation expects.

mm-handler

Copy the file into /etc/mail/ directory (or where ever your installation of sendmail is).

Make sure that the path in your local.m4 is the same as the one where you are copying the mm-handler file

chmod ug+x mm-handler

This shall make the script executable by user and group. 

chown root:mail mm-handler&nbsp;This changes the group to mail.  However you should make it that specified in local.m4.

Now edit mm-hanlder and make sure that.

  • perl path is correct.
  • $MMWRAPPER is referring to right mailman configuration.
  • $MMLISTDIR is referring to the correct directory.
  • $SEND_MAIL is referring to correct program.

    Warning

    $SEND_MAIL is specific to the mm-handler attached to this document

    After configuring the variables in mm-handler run it on the console.  This should generate log entries in your syslog.  In this case look for /var/log/maillog or /var/log/messages or wherever your system is configured to log these subsystems (refer to syslog.conf).

    Month&nbsp; DD HH:MM:SS mailman mm-handler\[32284\]: running as root:root
    Month&nbsp; DD HH:MM:SS mailman mm-handler\[32284\]: running as root. For security reasons you should configure sendmail.mc to run the mailer as non-root
    Month&nbsp; DD HH:MM:SS mailman mm-handler\[32284\]: #ARGV = \-1 ARGV = &nbsp;
    Month&nbsp; DD HH:MM:SS mailman mm-handler\[32284\]: No arguments passed, doing nothing
    If any of the configuration parameters are not correct i.e. correct file is not there or directory doesn't exist then you should see error messages like
    Month DD HH:MM:SS mailman mm-handler\[3402\]: can not find /path/to/mailman.&nbsp; Please configure
    
    Month DD HH:MM:SS mailman mm-handler\[3408\]: can not find /path/to/lists.&nbsp; Please configure
    Once mm-handler can run with no errors.  Now you can try to send emails the server and see how it behaves.  You can see the log output to verify that emails are being handled properly.  Once you are satisfied with the configuration, you can change the syslog.conf and change the log level of mail to level 4 e.g
    mail.4                   /path/to/maillog
    This will log error and warning messages to your log file that can be used for administration purposes. 


MailmanWiki: DOC/Integrating Mailman with Sendmail - Method 1 (last edited 2008-01-08 03:29:47 by tlembke)