[Exim] Exim 4.04: ezmlm to Mailman migration

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: Florian Weimer
Dátum:  
Címzett: exim-users
Tárgy: [Exim] Exim 4.04: ezmlm to Mailman migration
Here are two routers, a transport and a shell script for implementing
the LIST-subscribe@DOMAIN/LIST-unsubscribe@DOMAIN addresses for Exim
and qmail.

Perhaps it helps someone else to recover from a qmail mistake,
too. ;-)

The routers:

## Next 2 routers handle list-subscribe and list-unsubscribe addresses
## in a way which is compatible with ezmlm.

mailman_subscribe_router:
domains = +mailman_domains
driver = accept
require_files = MAILMAN_HOME/lists/${lc::$local_part}/config.db
local_part_suffix = "-subscribe"
transport = mailman_subscribe_transport

mailman_unsubscribe_router:
domains = +mailman_domains
driver = accept
require_files = MAILMAN_HOME/lists/${lc::$local_part}/config.db
local_part_suffix = "-unsubscribe"
transport = mailman_subscribe_transport

The transport:

mailman_subscribe_transport:
  driver = pipe
  user = MAILMAN_USER
  group = MAILMAN_GROUP
  current_directory = MAILMAN_HOME
  home_directory = MAILMAN_HOME
  command = /usr/local/sbin/ezmlm-to-mailman \
    $local_part $domain ${sg{$local_part_suffix}{^-}{}}
# For list-unsubcribe@domain, invokes
# "ezmlm-to-mailman list domain unsubscribe",
# via the routers above.


The script "ezmlm-to-mailman":

#!/bin/sh

set -e

PATH=/usr/bin:/bin

LIST="$1"
DOMAIN="$2"
ACTION="$3"

test -z "$SENDER" && exit 0

cat <<EOF | /usr/sbin/sendmail "-f $SENDER" -t
From: $SENDER
To: $LIST-request@$DOMAIN
Subject: $ACTION

EOF

exit 0

--
Florian Weimer                       Weimer@???
University of Stuttgart           http://CERT.Uni-Stuttgart.DE/people/fw/
RUS-CERT                          +49-711-685-5973/fax +49-711-685-5898