Drift/Epost/Migrere Mailman: Difference between revisions
No edit summary |
m (Oysteikt moved page Tjenester/Epost/Migrere Mailman to Drift/Epost/Migrere Mailman: Maintenance related email article -> Drift/Epost) |
||
(13 intermediate revisions by 3 users not shown) | |||
Line 13: | Line 13: | ||
</nowiki></pre> | </nowiki></pre> | ||
Fiks konfigen til mailman så vi får rett domene | Fiks konfigen til mailman så vi får rett domene. pvv.org har blitt brukt hittil, og om vi bytter til pvv.ntnu.no vil ikke de gamle listene dukke opp i oversikten. Mailman har visst gjort et forsøk på å støtte flere domener, men har vel fortsatt felles navnerom for selve listenavnet... | ||
MTA=None er for å slippe at newlist forteller hvordan man lager aliaser for listen. Vi har exim-magi som fikser aliasene. | |||
<pre><nowiki> | |||
exim-test:~# diff /usr/lib/mailman/Mailman/mm_cfg.py.knutabackup-2006-07-15 /usr/lib/mailman/Mailman/mm_cfg.py | exim-test:~# diff /usr/lib/mailman/Mailman/mm_cfg.py.knutabackup-2006-07-15 /usr/lib/mailman/Mailman/mm_cfg.py | ||
65c65 | 65c65 | ||
< DEFAULT_EMAIL_HOST = 'pvv.ntnu.no' | < DEFAULT_EMAIL_HOST = 'pvv.ntnu.no' | ||
--- | --- | ||
> DEFAULT_EMAIL_HOST = 'list.pvv. | > DEFAULT_EMAIL_HOST = 'list.pvv.org' | ||
68c68 | 68c68 | ||
< DEFAULT_URL_HOST = 'pvv.ntnu.no' | < DEFAULT_URL_HOST = 'pvv.ntnu.no' | ||
--- | --- | ||
> DEFAULT_URL_HOST = 'list.pvv. | > DEFAULT_URL_HOST = 'list.pvv.org' | ||
89c89 | |||
< # MTA=None # Misnomer, suppresses alias output on newlist | |||
--- | |||
> MTA=None # Misnomer, suppresses alias output on newlist | |||
</nowiki></pre> | </nowiki></pre> | ||
Line 33: | Line 40: | ||
</nowiki></pre> | </nowiki></pre> | ||
Fiks | Fiks magisk exim-oppsett: <pre><nowiki> | ||
exim-test:/etc/exim4# cat conf.d/ | exim-test:/etc/exim4# cat conf.d/main/00_pvv_exim-variabler | ||
# | # Home dir for your Mailman installation -- aka Mailman's prefix | ||
# directory. | |||
debug_print = "R: | MAILMAN_HOME=/var/lib/mailman | ||
MAILMAN_WRAP=MAILMAN_HOME/mail/mailman | |||
# User and group for Mailman, should match your --with-mail-gid | |||
# switch to Mailman's configure script. | |||
MAILMAN_USER=list | |||
MAILMAN_GROUP=daemon | |||
</nowiki></pre> <pre><nowiki> | |||
exim-test:/etc/exim4# cat conf.d/router/950_pvv-config_mailman | |||
mailman_router: | |||
debug_print = "R: mailman_router for $local_part$local_part_suffix@$domain" | |||
driver = accept | |||
require_files = MAILMAN_HOME/lists/$local_part/config.pck | |||
local_part_suffix_optional | |||
local_part_suffix = -bounces : -bounces+* : \ | |||
-confirm+* : -join : -leave : \ | |||
-owner : -request : -admin | |||
transport = mailman_transport | |||
</nowiki></pre> <pre><nowiki> | </nowiki></pre> <pre><nowiki> | ||
exim-test:/etc/exim4# cat conf.d/transport/30_pvv-config_mailman_pipe | exim-test:/etc/exim4# cat conf.d/transport/30_pvv-config_mailman_pipe | ||
mailman_transport: | |||
debug_print = "T: mailman_pipe for $local_part$local_part_suffix@$domain" | |||
driver = pipe | |||
command = MAILMAN_WRAP \ | |||
'${if def:local_part_suffix \ | |||
{${sg{$local_part_suffix}{-(\\w+)(\\+.*)?}{\$1}} } \ | |||
{post}}' \ | |||
$local_part | |||
current_directory = MAILMAN_HOME | |||
home_directory = MAILMAN_HOME | |||
user = MAILMAN_USER | |||
group = MAILMAN_GROUP | |||
</nowiki></pre> | </nowiki></pre> | ||
Line 63: | Line 83: | ||
Alias /pipermail/ /var/lib/mailman/archives/public/ | Alias /pipermail/ /var/lib/mailman/archives/public/ | ||
Alias /images/mailman/ /usr/share/images/mailman/ | Alias /images/mailman/ /usr/share/images/mailman/ | ||
<Directory /var/lib/mailman/archives/public> | |||
Options Indexes FollowSymLinks | |||
</Directory> | |||
<LocationMatch "^/$"> | <LocationMatch "^/$"> | ||
Redirect / http:// | Redirect / http://list.pvv.org/mailman/listinfo | ||
</LocationMatch> | </LocationMatch> | ||
</nowiki></pre> | </nowiki></pre> | ||
Line 100: | Line 124: | ||
Fiks tilganger: <pre><nowiki> | Fiks tilganger: <pre><nowiki> | ||
exim-test:/var/lib/mailman# find archives/ lists/ -exec chgrp list {} \; | exim-test:/var/lib/mailman# find archives/ lists/ -not -type l -exec chgrp list {} \; | ||
</nowiki></pre> | |||
Kjør noe magiske oppgraderings-greier som ikke ser ut til å gjøre noen ting: <pre><nowiki> | |||
exim-test:/var/lib/mailman# /usr/lib/mailman/bin/update | |||
No updates are necessary. | |||
</nowiki></pre> | </nowiki></pre> | ||
Line 112: | Line 141: | ||
Start tjenester:<pre><nowiki> | Start tjenester:<pre><nowiki> | ||
exim-test:/etc/exim4# /etc/init.d/mailman start | exim-test:/etc/exim4# /etc/init.d/mailman start | ||
exim-test:/etc/exim4# /etc/init.d/apache restart | exim-test:/etc/exim4# /etc/init.d/apache restart | ||
exim-test:/etc/exim4# /etc/init.d/exim4 | </nowiki></pre> | ||
Oppdater exim-ting: <pre><nowiki> | |||
exim-test:/etc/exim4# update-exim4.conf | |||
exim-test:/etc/exim4# /etc/init.d/exim4 stop | |||
exim-test:/etc/exim4# ps aux | grep exim # sjekk at alt er nede | |||
exim-test:/etc/exim4# pkill exim4 # kverk resterende exim-ting | |||
exim-test:/etc/exim4# vim /etc/aliases # fjern mailman-aliaser | |||
exim-test:/etc/exim4# /etc/init.d/exim4 start | |||
</nowiki></pre> | </nowiki></pre> | ||
Line 148: | Line 184: | ||
== Potensielle problemer == | == Potensielle problemer == | ||
På exim-test havnet ingenting i listen på http://exim-test.pvv.ntnu.no/mailman/listinfo. | På exim-test havnet ingenting i listen på http://exim-test.pvv.ntnu.no/mailman/listinfo. Grunnen viste seg å være at listinfo er domene-spesifikk. | ||
__NOTOC__ | __NOTOC__ |
Latest revision as of 01:19, 24 August 2024
Dette er egentlig Knut Auvors notater for hvordan han skal flytte PVVs Mailman-installasjon fra Mailman 2.0.13 på proto til Mailman 2.1.5 på decibel, men den står her i tilfelle noen skal gjøre noe lignende igjen. Eksemplene er hentet fra testmigreringen fra proto til exim-test.
Forberedelser på den nye boksen
Installer moroa:
exim-test:/# aptitude install mailman
dpkg kommer til å mase om at du må opprette en liste som heter "mailman". Vent med det.
Sett site-passord:
exim-test:~# mmsitepass New site password:
Fiks konfigen til mailman så vi får rett domene. pvv.org har blitt brukt hittil, og om vi bytter til pvv.ntnu.no vil ikke de gamle listene dukke opp i oversikten. Mailman har visst gjort et forsøk på å støtte flere domener, men har vel fortsatt felles navnerom for selve listenavnet...
MTA=None er for å slippe at newlist forteller hvordan man lager aliaser for listen. Vi har exim-magi som fikser aliasene.
exim-test:~# diff /usr/lib/mailman/Mailman/mm_cfg.py.knutabackup-2006-07-15 /usr/lib/mailman/Mailman/mm_cfg.py 65c65 < DEFAULT_EMAIL_HOST = 'pvv.ntnu.no' --- > DEFAULT_EMAIL_HOST = 'list.pvv.org' 68c68 < DEFAULT_URL_HOST = 'pvv.ntnu.no' --- > DEFAULT_URL_HOST = 'list.pvv.org' 89c89 < # MTA=None # Misnomer, suppresses alias output on newlist --- > MTA=None # Misnomer, suppresses alias output on newlist
Fiks exim-konfigen så den aksepterer list.pvv-domenene:
exim-test:/etc/exim4# diff update-exim4.conf.conf.old update-exim4.conf.conf 20c20 < dc_other_hostnames='pvv.org:pvv.ntnu.no' --- > dc_other_hostnames='pvv.org:pvv.ntnu.no:list.pvv.org:list.pvv.ntnu.no'
Fiks magisk exim-oppsett:
exim-test:/etc/exim4# cat conf.d/main/00_pvv_exim-variabler # Home dir for your Mailman installation -- aka Mailman's prefix # directory. MAILMAN_HOME=/var/lib/mailman MAILMAN_WRAP=MAILMAN_HOME/mail/mailman # User and group for Mailman, should match your --with-mail-gid # switch to Mailman's configure script. MAILMAN_USER=list MAILMAN_GROUP=daemon
exim-test:/etc/exim4# cat conf.d/router/950_pvv-config_mailman
mailman_router: debug_print = "R: mailman_router for $local_part$local_part_suffix@$domain" driver = accept require_files = MAILMAN_HOME/lists/$local_part/config.pck local_part_suffix_optional local_part_suffix = -bounces : -bounces+* : \ -confirm+* : -join : -leave : \ -owner : -request : -admin transport = mailman_transport
exim-test:/etc/exim4# cat conf.d/transport/30_pvv-config_mailman_pipe
mailman_transport: debug_print = "T: mailman_pipe for $local_part$local_part_suffix@$domain" driver = pipe command = MAILMAN_WRAP \ '${if def:local_part_suffix \ {${sg{$local_part_suffix}{-(\\w+)(\\+.*)?}{\$1}} } \ {post}}' \ $local_part current_directory = MAILMAN_HOME home_directory = MAILMAN_HOME user = MAILMAN_USER group = MAILMAN_GROUP
Fiks apache-konfig for mailman:
exim-test:/etc/exim4# cat /etc/apache/conf.d/mailman ScriptAlias /mailman/ /usr/lib/cgi-bin/mailman/ Alias /pipermail/ /var/lib/mailman/archives/public/ Alias /images/mailman/ /usr/share/images/mailman/ <Directory /var/lib/mailman/archives/public> Options Indexes FollowSymLinks </Directory> <LocationMatch "^/$"> Redirect / http://list.pvv.org/mailman/listinfo </LocationMatch>
Rydd unna litt kataloger:
exim-test:/var/lib/mailman# find archives/ lists/ -ls 160877 4 drwxrwsr-x 4 root list 4096 Jul 15 21:58 archives/ 3110 4 drwxrws--x 2 root list 4096 Jul 15 21:58 archives/private 160878 4 drwxrwsr-x 2 root list 4096 Jul 15 21:58 archives/public 97766 4 drwxrwsr-x 2 root list 4096 Jul 15 21:58 lists/ exim-test:/var/lib/mailman# rm -r archives/ lists/
Selve migreringen: På den gamle boksen
Stopp qmail på den gamle boksen, så all mail køes ute:
svc -d /service/smtpd touch /service/smtpd/down
Sjekk at den ikke svarer på smtp:
telnet proto smtp
Kopier lister og arkiver til den nye boksen:
proto:/local/mailman# tar -cf - lists/ archives/ | ssh exim-test 'cd /var/lib/mailman; tar xf -'
Selve migreringen: På den nye boksen
Fiks arkiv-symlinker (de er absolutte og peker på /local/mailman):
exim-test:/var/lib/mailman/archives/public# for f in *; do ln -sf ../private/$f $f; done
Fiks tilganger:
exim-test:/var/lib/mailman# find archives/ lists/ -not -type l -exec chgrp list {} \;
Kjør noe magiske oppgraderings-greier som ikke ser ut til å gjøre noen ting:
exim-test:/var/lib/mailman# /usr/lib/mailman/bin/update No updates are necessary.
Opprett mailman-listen (noe nytt i 2.1.5?):
exim-test:/var/lib/mailman# newlist mailman
Mekk aliaser:
exim-test:/var/lib/mailman# /usr/lib/mailman/bin/genaliases | sed '1,3d' > /etc/aliases.mailman
Start tjenester:
exim-test:/etc/exim4# /etc/init.d/mailman start exim-test:/etc/exim4# /etc/init.d/apache restart
Oppdater exim-ting:
exim-test:/etc/exim4# update-exim4.conf exim-test:/etc/exim4# /etc/init.d/exim4 stop exim-test:/etc/exim4# ps aux | grep exim # sjekk at alt er nede exim-test:/etc/exim4# pkill exim4 # kverk resterende exim-ting exim-test:/etc/exim4# vim /etc/aliases # fjern mailman-aliaser exim-test:/etc/exim4# /etc/init.d/exim4 start
Testing og wrap-up
Telnet til smtp-porten og sjekk at listemail kan leveres (fra en pvv-boks, så slipper du å bli greylistet):
knuta@decibel ~ $ telnet exim-test smtp Trying 129.241.210.196... Connected to exim-test.pvv.ntnu.no. Escape character is '^]'. 220 exim-test.pvv.ntnu.no ESMTP Exim 4.50 Mon, 17 Jul 2006 21:45:22 +0200 HELO exim-test.pvv.ntnu.no 250 exim-test.pvv.ntnu.no Hello knuta at decibel.pvv.ntnu.no [129.241.210.179] MAIL FROM: mail-drift@pvv.ntnu.no 250 OK RCPT TO: knutatest@list.pvv.ntnu.no 250 Accepted DATA 354 Enter message, ending with "." on a line by itself Subject: Liten testmail huhei! . 250 OK id=1G2Z36-00052n-LK quit 221 exim-test.pvv.ntnu.no closing connection Connection closed by foreign host.
Om du mottok mailen er sikkert alt bra. SSH til dvask og oppdater DNS. Hurra!
Potensielle problemer
På exim-test havnet ingenting i listen på http://exim-test.pvv.ntnu.no/mailman/listinfo. Grunnen viste seg å være at listinfo er domene-spesifikk.