root.veg
12-22-2003, 08:57 PM
Just a short mini-howto, this, in celebration of successfully setting up a mailing list for me and my friends to keep in touch, using my mail-and-web-server box at home.
I discovered the very-nifty GNU mailman, which is included in the main Debian package list, and seemed just right for me. However, compared to many programs I've configured, I think Mailman has good but very fragmented documentation. It took me ages to piece together the following steps, which seems odd given Debian / Exim / Mailman must be a pretty common setup.
So it's not very long, but here is my howto:
1) Make sure you've got an always-on internet connection with a public IP address, and unless you want to be really awkward, your own domain name.
2) Install and configure Exim. In particular, you need to make sure that exim is configured to use your domain-name on outgoing mail, and will receive mail addressed to your domain-name. Assuming you're only setting up one mail server for your domain, this is achieved by making sure the following entries are included in /etc/exim/exim.conf (thanks to hayl and bwkaz, for their help when I started asking clueless questions on these forums):
in the "main configuration settings" section:
primary_hostname = yourdomain.com
in the "transports" section:
remote_smtp:
driver = smtp
in the "routers" section:
lookuphost:
driver = lookuphost
transport = remote_smtp
(I think if you know your domain-name set-up when you install exim, then apt-get will ask you questions which should fill this in automatically for you.)
Also, very importantly, find the line in etc/exim/exim.conf , under "directors configuration" and "system_aliases", which says
# user = list
and UNCOMMENT IT (remove the # sign).
Note that the business of getting mail to your mailserver may require IP masquerading and port-forwarding. My set-up is one static IP, on a separate box running a firewall. The firewall tool I use is shorewall (the Debian packaged version) which does IP masquerading for all of my network, and also forwards all SMTP traffic (Port 25) and HTTP traffic (port 80) to my mail-and-web-server box.
Save your new /etc/exim/exim.conf . Test your mailserver with a couple of e-mails to and from internet addresses (just to make sure that any problems you have from now on are only to do with Mailman).
3) Install Apache. This is not strictly necessary, as you don't need a web interface: subscribers can make all the admin requests via e-mail commands. I just let apt-get do a default install. I changed the default index.html page, but that doesn't get in the way of Mailman's web interface. Also, if you have separate machines for web-serving and mail-serving, it may not be worth the hassle trying to get Mailman to use an Apache server on another machine. (However, if you've got separate boxes for web and mail, chances are you don't need to read my howto :) )
4) Use apt-get (or dselect) to install mailman. This will install the necessary Python packages, too (but you knew apt-get would do that anyway, right? :) ). During installation, mailman should be set up to use the same
domain-name as exim uses.
5) As root run the command /var/lib/mailman/bin/newlist . This program will ask you for details of your new list. it will then print out on the screen a few lines which you need to paste into your /etc/aliases file. I guess newlist doesn't do this automatically because messing around with /etc/aliases while a mailserver is running is a security risk. Anyway, paste those lines into /etc/aliases like it says. Also make sure you don't
have any previously-created aliases with the same name as your new list.
6) Run the command
newaliases
which should be in root's $PATH . This is very important, as the changes to /etc/aliases don't take effect unless you do it.
7) Test it all out - it's especially easy if you've got Apache running, because you can do all the admin with the web interface, using the "click-every-link-until-I-find-what-I-want" method :) . The URL you're after will be
http://<yourwebserver>/cgi-bin/mailman/listinfo/<yourlistname>
and you can get to all the options from there. Pay particular attention to whether you want your list to be publicly-accessible and whether anyone can mail to the list, also on whether the list archives are publicly-viewable. The web interface for mailman is pretty well documented, though, in the following link which the Mailman website points to:
http://staff.imsa.edu/~ckolar/mailman/
Told you it was short. But maybe it will be of use to someone... comments and additions welcome!
Andrew.
I discovered the very-nifty GNU mailman, which is included in the main Debian package list, and seemed just right for me. However, compared to many programs I've configured, I think Mailman has good but very fragmented documentation. It took me ages to piece together the following steps, which seems odd given Debian / Exim / Mailman must be a pretty common setup.
So it's not very long, but here is my howto:
1) Make sure you've got an always-on internet connection with a public IP address, and unless you want to be really awkward, your own domain name.
2) Install and configure Exim. In particular, you need to make sure that exim is configured to use your domain-name on outgoing mail, and will receive mail addressed to your domain-name. Assuming you're only setting up one mail server for your domain, this is achieved by making sure the following entries are included in /etc/exim/exim.conf (thanks to hayl and bwkaz, for their help when I started asking clueless questions on these forums):
in the "main configuration settings" section:
primary_hostname = yourdomain.com
in the "transports" section:
remote_smtp:
driver = smtp
in the "routers" section:
lookuphost:
driver = lookuphost
transport = remote_smtp
(I think if you know your domain-name set-up when you install exim, then apt-get will ask you questions which should fill this in automatically for you.)
Also, very importantly, find the line in etc/exim/exim.conf , under "directors configuration" and "system_aliases", which says
# user = list
and UNCOMMENT IT (remove the # sign).
Note that the business of getting mail to your mailserver may require IP masquerading and port-forwarding. My set-up is one static IP, on a separate box running a firewall. The firewall tool I use is shorewall (the Debian packaged version) which does IP masquerading for all of my network, and also forwards all SMTP traffic (Port 25) and HTTP traffic (port 80) to my mail-and-web-server box.
Save your new /etc/exim/exim.conf . Test your mailserver with a couple of e-mails to and from internet addresses (just to make sure that any problems you have from now on are only to do with Mailman).
3) Install Apache. This is not strictly necessary, as you don't need a web interface: subscribers can make all the admin requests via e-mail commands. I just let apt-get do a default install. I changed the default index.html page, but that doesn't get in the way of Mailman's web interface. Also, if you have separate machines for web-serving and mail-serving, it may not be worth the hassle trying to get Mailman to use an Apache server on another machine. (However, if you've got separate boxes for web and mail, chances are you don't need to read my howto :) )
4) Use apt-get (or dselect) to install mailman. This will install the necessary Python packages, too (but you knew apt-get would do that anyway, right? :) ). During installation, mailman should be set up to use the same
domain-name as exim uses.
5) As root run the command /var/lib/mailman/bin/newlist . This program will ask you for details of your new list. it will then print out on the screen a few lines which you need to paste into your /etc/aliases file. I guess newlist doesn't do this automatically because messing around with /etc/aliases while a mailserver is running is a security risk. Anyway, paste those lines into /etc/aliases like it says. Also make sure you don't
have any previously-created aliases with the same name as your new list.
6) Run the command
newaliases
which should be in root's $PATH . This is very important, as the changes to /etc/aliases don't take effect unless you do it.
7) Test it all out - it's especially easy if you've got Apache running, because you can do all the admin with the web interface, using the "click-every-link-until-I-find-what-I-want" method :) . The URL you're after will be
http://<yourwebserver>/cgi-bin/mailman/listinfo/<yourlistname>
and you can get to all the options from there. Pay particular attention to whether you want your list to be publicly-accessible and whether anyone can mail to the list, also on whether the list archives are publicly-viewable. The web interface for mailman is pretty well documented, though, in the following link which the Mailman website points to:
http://staff.imsa.edu/~ckolar/mailman/
Told you it was short. But maybe it will be of use to someone... comments and additions welcome!
Andrew.