mailman: initial import

This commit is contained in:
Jose V Beneyto 2010-10-07 10:55:35 +02:00
parent 3455071c72
commit 50632cc2e3
6 changed files with 2451 additions and 0 deletions

2272
mailman/.footprint Normal file

File diff suppressed because it is too large Load Diff

2
mailman/.md5sum Normal file
View File

@ -0,0 +1,2 @@
9ea163871ceccbd33fee4c9e335fcf7b mailman-2.1.14.tgz
4391100538e3cb6966d7d954bb539bbd mailman.rc

61
mailman/Pkgfile Normal file
View File

@ -0,0 +1,61 @@
# Description: Mailman, the GNU Mailing List Manager
# URL: http://www.gnu.org/software/mailman/
# Maintainer: Jose V Beneyto, sepen at crux dot nu
# Packager: Jose V Beneyto, sepen at crux dot nu
# Depends on: python
name=mailman
version=2.1.14
release=1
source=(http://ftp.gnu.org/gnu/$name/$name-$version.tgz \
$name.rc)
build() {
cd $name-$version
patch -p1 -i contrib/redhat_fhs.patch
rm -f configure
aclocal
autoconf
./configure --prefix=/usr/lib/$name \
--with-var-prefix=/var/lib/$name \
--with-config-dir=/etc/$name \
--with-lock-dir=/var/lock/$name \
--with-log-dir=/var/log/$name \
--with-pid-dir=/var/run/$name \
--with-queue-dir=/var/spool/$name \
--with-mailhost=localhost.localdomain \
--with-urlhost=localhost.localdomain \
--with-mail-gid=$name \
--with-cgi-id=www \
--with-cgi-gid=www \
--without-permcheck
make
make DESTDIR=$PKG install
install -D -m 0755 $SRC/$name.rc $PKG/etc/rc.d/$name
# create empty crontab
install -d $PKG/etc/cron.d
cat > $PKG/etc/cron.d/$name << __EOF__
# DO NOT EDIT THIS FILE!
#
# Contents of this file managed by /etc/rc.d/mailman
# Master copy is /usr/lib/mailman/cron/crontab.in
# Consult that file for documentation
#
# End of file
__EOF__
# fix permissions
chown -R root:$name $PKG/etc/$name $PKG/usr/lib/$name \
$PKG/var/{lib,lock,log,run,spool}/$name
chmod 02775 $PKG/etc/$name $PKG/var/{lib,lock,log,run,spool}/$name
find $PKG/usr/lib/$name -type d -exec chmod 02775 {} \;
#chmod o+x $PKG/var/lib/$name/archives/private
# fix configs
ln -sf /usr/lib/$name/Mailman/mm_cfg.py $PKG/etc/$name
ln -sf /etc/$name/sitelist.cfg $PKG/var/lib/$name/data
}

76
mailman/README Normal file
View File

@ -0,0 +1,76 @@
README for mailman
PRE-INSTALL
Execute the pre-install script to add a new mailman user/group
NOTES
Configure options:
$ less /usr/lib/mailman/Mailman/Defaults.py
$ sudo vim /etc/mailman/mm_cfg.py
Configure aliases for Postfix MTA:
$ sudo /usr/lib/mailman/bin/genaliases
$ sudo vim /etc/postfix/main.cf
[...]
alias_maps = hash:/etc/postfix/aliases, hash:/etc/mailman/aliases, ...
[...]
$ sudo newaliases
To create a new list:
$ sudo /usr/lib/mailman/bin/newlist
To check perimissions:
$ sudo /usr/lib/mailman/bin/check_perms -v
Maybe after create your first list you need to setup some directories/files:
$ sudo chown mailman:mailman /etc/mailman/aliases*
$ sudo chmod 660 /etc/mailman/aliases.db
To configure httpd settings (without vhosts) append this to your httpd.conf:
[...]
ScriptAlias /mailman/ /usr/lib/mailman/cgi-bin/
<Directory "/usr/lib/mailman/cgi-bin/">
AllowOverride None
Options ExecCGI
Order allow,deny
Allow from all
</Directory>
Alias /pipermail/ /var/lib/mailman/archives/public/
<Directory "/var/lib/mailman/archives/public">
Options +FollowSymLinks
Order allow,deny
Allow from all
</Directory>
# Uncomment the following line, replacing www.example.com with your server's
# name, to redirect queries to /mailman to the listinfo page (recommended).
RedirectMatch ^/mailman[/]*$ http://www.example.com/mailman/listinfo
[...]
IMPORTANT: If archives/private is not o+x, then the owner of archives/private
must be the web server user whatever that is - i.e. the web server user must be
able to search in archives/private.
$ ls -ld /var/lib/mailman/archives/p*
drwxrws--x 6 root mailman 4096 Jan 12 17:02 /var/lib/mailman/archives/private
drwxrwsr-x 2 root mailman 4096 Jan 12 17:02 /var/lib/mailman/archives/public
The owner (root) is not important. the group is Mailman's group and may or may
not be 'mailman' (e.g. on a debian/ubuntu package install, it is 'list')

25
mailman/mailman.rc Executable file
View File

@ -0,0 +1,25 @@
#!/bin/sh
#
# /etc/rc.d/mailman: start/stop mailman daemon
#
PYTHON=/usr/bin/python
MAILMANHOME=/usr/lib/mailman
MAILMANCTL=$MAILMANHOME/bin/mailmanctl
case $1 in
start)
$PYTHON $MAILMANCTL -s -q start
;;
stop)
$PYTHON $MAILMANCTL -q stop
;;
restart)
$PYTHON $MAILMANCTL -q restart
;;
*)
echo "usage: $0 [start|stop|restart]"
;;
esac
# End of file

15
mailman/pre-install Executable file
View File

@ -0,0 +1,15 @@
#!/bin/sh
mmuser="mailman"
mmgroup="mailman"
mmuserid=41
mmgroupid=41
# make sure the user/group exists or add if not exists
/usr/bin/getent group $mmgroup || \
/usr/sbin/groupadd -g $mmgroupid $mmgroup
/usr/bin/getent passwd $mmuser || \
/usr/sbin/useradd -s /sbin/nologin -u $mmuserid -g $mmgroupid $mmuser
# End of file