diff --git a/README.md b/README.md index f09a2de6e6f5a734d0eb2904fdda5563961e5965..1d8d270ff7286e9612fe7230851b5de6331a7fc4 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,15 @@ +This project was initially cloned from: +https://git.fs.lmu.de/roots/mailman2sympa + This setup is used to migrate mailman running on FreeBSD to sympa. You must have installed some depedencies: -pkg install mailman zsh +``` +pkg install mailman zsh bash +``` Execute for each mailinglist the command: - +``` import_mailman_list.sh mailinglist +``` + diff --git a/import_mailman_list.sh b/import_mailman_list.sh index 86e6ce11da6f3e2a5dbaf147836d9d9948690ee5..0f929af0e7f2162d46bd7c7c14cbbbb8d0d6e80a 100755 --- a/import_mailman_list.sh +++ b/import_mailman_list.sh @@ -25,20 +25,20 @@ awk '/^wwsympa_url/ { print "url = u\""$2"\""; }' < /usr/local/etc/sympa/$ROBOT/ XML=$(mktemp) ./gen_config.py $INPUT $XML chmod 644 $XML -/usr/lib/sympa/bin/sympa.pl --create_list --robot $ROBOT --input_file $XML +/usr/local/bin/sympa.pl --create_list --robot $ROBOT --input_file $XML rm $XML #import archive if [[ -f "$ARCHIVE" ]] ; then - TMP=$(TMPDIR=/srv mktemp) - cp /srv/mailman/archives/private/$LIST.mbox/$LIST.mbox $TMP + TMP=$(TMPDIR=/tmp mktemp) + cp /usr/local/mailman/archives/private/$LIST.mbox/$LIST.mbox $TMP chmod 644 $TMP ./import_mbox.sh $TMP $NEWLIST $ROBOT rm $TMP fi # add members -list_members -f $LIST | tr -d '"\\' | sed -e 's:\(.*\) <\(.*\)>:\2 \1:' -e "s:^:QUIET ADD $NEWLIST :" | ./send_command.sh $ROBOT +/usr/local/mailman/bin/list_members -f $LIST | tr -d '"\\' | sed -e 's:\(.*\) <\(.*\)>:\2 \1:' -e "s:^:QUIET ADD $NEWLIST :" | ./send_command.sh $ROBOT # sends a mail to every digest user, thus disabled # set digest members to digest mode @@ -46,7 +46,8 @@ list_members -f $LIST | tr -d '"\\' | sed -e 's:\(.*\) <\(.*\)>:\2 \1:' -e "s:^: # echo "QUIET SET $LIST DIGEST" | send_command.sh fs.lmu.de $digest #done -rmlist $LIST +# we skip this for now +#/usr/local/mailman/bin/rmlist $LIST ./notify_owner.py $INPUT rm $INPUT diff --git a/import_mbox.sh b/import_mbox.sh index 65579e322b552535c3330e0da468ac3dd8fa4d65..aac1d41ab42f4949bfdad07069f93dc1bf2d5f9d 100755 --- a/import_mbox.sh +++ b/import_mbox.sh @@ -1,4 +1,4 @@ -#!/bin/zsh +#!/usr/bin/env zsh # import_mbox # List archive import @@ -18,7 +18,7 @@ # Configuration variables SYMPA_USER=sympa:sympa -SYMPA_ROOT=/srv/sympa +SYMPA_ROOT=/usr/local/share/sympa MBOX_BACKUP=import.mbox set -e @@ -56,7 +56,7 @@ chmod -R g=rX,o= "$SYMPA_ROOT/list_data/$SYMPA_DOMAIN/$LIST_NAME/archives" # Convert to Sympa web archives input files echo "Step 3: converting .log files into arc/${LIST_NAME}\@${SYMPA_DOMAIN}/\*/arctxt files" -su sympa -s /bin/bash -c "/usr/share/sympa/bin/arc2webarc.pl $LIST_NAME $SYMPA_DOMAIN" || true +su sympa -s /usr/local/bin/bash -c "/usr/local/libexec/sympa/arc2webarc.pl $LIST_NAME $SYMPA_DOMAIN" || true # Generate the HTML archives echo "Step 4: triggering web archives regeneration" diff --git a/mbox2sympa.pl b/mbox2sympa.pl index 585ed488949eddb48941f6cf8718457b7c23f0d8..9ad0eb41b5b4817d580c6f8816b1443e2eb79f61 100755 --- a/mbox2sympa.pl +++ b/mbox2sympa.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # Archive converter from standard mbox format to Sympa's archive format, # creating the Sympa compatible log.* files in the same directory as the # input files. When done here, copy the log.* files to the "archives" diff --git a/notify_owner.py b/notify_owner.py index 73b15592ff2309c4635e433f68311a0872096099..7fc3f568db8f952b66b787d7efc50a4c9131c877 100755 --- a/notify_owner.py +++ b/notify_owner.py @@ -12,7 +12,7 @@ TEMPLATEDIR="./" MAILSERVER="localhost" MAILPORT="25" -def sendMailFromTemplate(template, to, subject, params, sender = 'root@fs.lmu.de'): +def sendMailFromTemplate(template, to, subject, params, sender = 'idefix@fechner.net'): if not os.path.isfile(TEMPLATEDIR + template): raise Exception('Template %s not found'%template) diff --git a/owner.template b/owner.template index 778945d846bda888bf94d4134abff40c6c5cfe73..49ad68b92d4f13aab2fafaba89b26ef006a416d1 100644 --- a/owner.template +++ b/owner.template @@ -9,7 +9,7 @@ Nach dem Login siehst du auf der linken Seite alle Listen auf denen du Mitglied Solltest du Fragen haben oder das Gefühl das etwas nicht funktioniert so schreibe uns einfach eine Mail. Viele Grüße, -die Roots des Fachschaftenservers +die Roots [0] $url/info/$new_listname [1] $url/arc/$new_listname diff --git a/send_command.sh b/send_command.sh index 5d10cff2c11e74a0f4f9a39ec68c3a499036459a..dcc97d80101f32613cc0e14189a634811364fe67 100755 --- a/send_command.sh +++ b/send_command.sh @@ -1,11 +1,11 @@ -#!/bin/zsh +#!/us/bin/env zsh # wrapper around sendmail to send commands to sympa -[ -f /etc/sympa/$1/robot.conf ] || { echo "Robot does not exist" ; exit 1 } +[ -f /usr/local/etc/sympa/$1/robot.conf ] || { echo "Robot does not exist" ; exit 1 } TO="sympa@$1" # sender must be a listmaster -FROM=${2:-listmaster@domain.tld} +FROM=${2:-idefix@fechner.net} exec sendmail -f $FROM $TO