From 10cac6eabede265e3e1b2e259491603bcc22aea7 Mon Sep 17 00:00:00 2001 From: Matthias Fechner <idefix@fechner.net> Date: Sun, 15 Nov 2020 09:34:04 +0100 Subject: [PATCH] More small changes on path. --- README.md | 11 +++++++++-- import_mailman_list.sh | 11 ++++++----- import_mbox.sh | 6 +++--- mbox2sympa.pl | 2 +- notify_owner.py | 2 +- owner.template | 2 +- send_command.sh | 6 +++--- 7 files changed, 24 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index f09a2de..1d8d270 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 86e6ce1..0f929af 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 65579e3..aac1d41 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 585ed48..9ad0eb4 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 73b1559..7fc3f56 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 778945d..49ad68b 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 5d10cff..dcc97d8 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 -- GitLab