This method uses the mm-handler.
See also Method 2 which does not use the mm-handler
The following has been tested using the following configuration
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.
add the following in your /etc/mail/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 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
|
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, |
|
Make sure that there is a tab after Mlocal, and not spaces. Otherwise it might not work |
|
This Mlocal is modified so that sendmail passes the hostname using -j parameter. Also a -d parameter has been added before $u. |
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 This changes the group to mail. However you should make it that specified in local.m4. |
Now edit mm-hanlder and make sure that.
$SEND_MAIL is specific to the mm-handler attached to this document |
Month DD HH:MM:SS mailman mm-handler\[32284\]: running as root:root Month 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 DD HH:MM:SS mailman mm-handler\[32284\]: #ARGV = \-1 ARGV = Month DD HH:MM:SS mailman mm-handler\[32284\]: No arguments passed, doing nothing |
Month DD HH:MM:SS mailman mm-handler\[3402\]: can not find /path/to/mailman. Please configure Month DD HH:MM:SS mailman mm-handler\[3408\]: can not find /path/to/lists. Please configure |
mail.4 /path/to/maillog |