-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmailman-to-google-group-all-steps.sh
executable file
·74 lines (62 loc) · 2.95 KB
/
mailman-to-google-group-all-steps.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/bin/bash
function press_any_key() {
echo -e "\[\e[34m\]PRESS ANY KEY\[\e[00m\]"
read -n 1 -s
}
set -ex
ssh mailman "/usr/lib/mailman/bin/add_members --welcome-msg=n -r - $1 <<< [email protected]"
ssh mailman ./pickle-mailman-list.py --list [email protected]
scp mailman:[email protected] gitignore/
scp i3mail:/mnt/i3mail/mailman/archives/private/$1.mbox/$1.mbox gitignore/archives/ || true
ls -lh gitignore/$1*
ls -lh gitignore/archives/$1* || true
press_any_key
./mailman-to-google-group-settings-import.py \
--browser-google-account-index 3 \
--sa-creds gitignore/mailing-list-migration-381920-45ae46bb0e0e.json \
--add-owner [email protected] \
--sa-delegate [email protected] \
--mailman-pickle gitignore/[email protected]
press_any_key
./mailman-to-google-group-members-import.py \
--ignore [email protected] \
--browser-google-account-index 3 \
--sa-creds gitignore/mailing-list-migration-381920-45ae46bb0e0e.json \
--sa-delegate [email protected] \
--mailman-pickle gitignore/[email protected]
ssh i3mail "cp /etc/mailman/aliases /etc/mailman/aliases.bak.$1.$(date +%s)"
ssh i3mail "cp /etc/postfix/transport /etc/postfix/transport.bak.$1.$(date +%s)"
ssh i3mail "cp /etc/postfix/local_recipients /etc/postfix/local_recipients.bak.$1.$(date +%s)"
press_any_key
ssh i3mail "sed '/^$1[:-].*|.usr.lib.mailman.mail.mailman [a-z][a-z]* $1\"$/s/^/#/' \
/etc/mailman/aliases > /etc/mailman/aliases.preview"
ssh i3mail "diff -u /etc/mailman/aliases /etc/mailman/aliases.preview; true"
press_any_key
ssh i3mail "sed -i '/^$1[:-].*|.usr.lib.mailman.mail.mailman [a-z][a-z]* $1\"$/s/^/#/' \
/etc/mailman/aliases"
ssh i3mail "cd /etc/mailman/; postalias aliases"
press_any_key
ssh i3mail "echo [email protected] relay:aspmx.l.google.com >> /etc/postfix/transport"
ssh i3mail "echo [email protected] relay:aspmx.l.google.com >> /etc/postfix/transport"
ssh i3mail "echo $1 OK >> /etc/postfix/local_recipients"
ssh i3mail "echo $1+unsubscribe OK >> /etc/postfix/local_recipients"
ssh i3mail "tail /etc/postfix/transport"
ssh i3mail "tail /etc/postfix/local_recipients"
press_any_key
ssh i3mail "cd /etc/postfix; postmap hash:local_recipients"
ssh i3mail "cd /etc/postfix; postmap hash:transport"
ssh i3mail "postfix reload"
press_any_key
./mailman-to-google-group-standard-announcements.py \
--list-name [email protected] \
--message-name SINGLE_VBRIK \
--from-field "Vladimir Brik <[email protected]>"
press_any_key
scp i3mail:/mnt/i3mail/mailman/archives/private/$1.mbox/$1.mbox gitignore/archives/ \
&& mkdir -p gitignore/archives/work/$1 \
&& ./mailman-to-google-group-message-import.py \
--sa-creds gitignore/mailing-list-tools-10746a87da2c.json \
--sa-delegator [email protected] \
--src-mbox gitignore/archives/$1.mbox \
--dst-group [email protected] \
--work-dir gitignore/archives/work/$1