From 333bbc1539cee4c47485ce672c550ce69ac2ac9b Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Thu, 20 Sep 2012 00:08:15 +0200 Subject: More patches. --- fripost-docs.org | 119 ++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 109 insertions(+), 10 deletions(-) diff --git a/fripost-docs.org b/fripost-docs.org index 7ea6cf0..62a4153 100644 --- a/fripost-docs.org +++ b/fripost-docs.org @@ -2252,6 +2252,15 @@ EOF sudo find -L /var/lib/mailman -type f -a \( -name '*.orig' -o -name '*.rej' \) -delete + +We need to pin mailman to avoid our patches being overwritten by an update. + + :: /etc/apt/preferences + Explanation: We applied custom patches on many files created by this package. + Package: mailman + Pin: version * + Pin-Priority: -30000 + **** Configuration :: /etc/mailman/mm_cfg.py @@ -2294,6 +2303,15 @@ To create a list: sudo -u list ./bin/newlist -q -u smtp.fripost.org test-mailman@fripost.org user@fripost.org xxxxxxxxxxxxxxxx TODO: switch to '-u lists.fripost.org' when the DEFAULT_URL_HOST is updated. +Note: in our case it is *not* the proper way to create lists, since the LDAP directory has to be updated first. + +To delete a list: + + sudo rm -rf /var/lib/mailman/lists/domain/listname + +And the archives: + + sudo rm -rf /var/lib/mailman/archives/{public,private}/domain/listname **** Web server configuration @@ -2335,6 +2353,92 @@ Documentation: https://schleuder2.nadir.org/ sudo chown 'schleuder:schleuder' /etc/schleuder/lists/ sudo chmod 0700 /etc/schleuder/lists/ +**** Patches + +The following strips the list commands out of the local part of the list name. + + sudo patch -p0 << EOF +--- /usr/bin/schleuder ++++ /usr/bin/schleuder +@@ -44,8 +44,12 @@ + arg = ARGV.shift + if arg == '-test' + process_test(ARGV) +- elsif arg =~ /[A-Za-z0-9]+/ +- process_list(arg.gsub(/-(sendkey|bounces)$/, '')) ++ elsif arg =~ /[A-Za-z0-9]+/ ++ l,d = arg.split('#') ++ l = l.gsub(/-(sendkey|bounce)$/, '') ++ list = l ++ list += '@' + d unless d.nil? ++ process_list(list) + else + usage + end +EOF + + sudo rm -f /usr/bin/schleuder.{orig,rej} + + +Unlike GNU Mailman, schleuder-newlist imposes an initial member upon list creation. +The following patch makes it optional: + + sudo patch -p0 << EOF +--- /usr/bin/schleuder-newlist ++++ /usr/bin/schleuder-newlist +@@ -128,17 +128,19 @@ + end + + # Verify init member +- Schleuder.log.debug "Verifying init member..." +- list_initmember = ListCreator::verify_emailvar( +- args[:list_initmember] || '', +- interactive, +- "Email address of the lists' initial member" +- ) +- list_initmemberkey = ListCreator::verify_filevar( +- args[:list_initmemberkey] || '', +- interactive, +- "the public key of the lists' initial member" +- ) ++ unless args[:list_initmember].nil? and args[:list_initmemberkey].nil? and !interactive ++ Schleuder.log.debug "Verifying init member..." ++ list_initmember = ListCreator::verify_emailvar( ++ args[:list_initmember], ++ interactive, ++ "Email address of the lists' initial member" ++ ) ++ list_initmemberkey = ListCreator::verify_filevar( ++ args[:list_initmemberkey], ++ interactive, ++ "the public key of the lists' initial member" ++ ) ++ end + Schleuder.log.debug "Arguments verified..." + + Schleuder.log.debug "Initialize list..." +@@ -162,7 +164,7 @@ + Schleuder.log.debug "Import list's keypair..." + ListCreator::import_keypair(list,list_privatekeyfile,list_publickeyfile) + end +- if (list_initmember != 'none' and list_initmemberkey != 'none') then ++ unless list_initmember.nil? and list_initmemberkey.nil? + Schleuder.log.debug "Add initmember to list..." + ListCreator::add_init_member(list,list_initmember,list_initmemberkey) + end +EOF + + sudo rm -f /usr/bin/schleuder-newlist.{orig,rej} + + +We need to pin schleuder to avoid our patches being overwritten by an update. + + :: /etc/apt/preferences + Explanation: We applied custom patches on /usr/bin/schleuder and /usr/bin/schleuder-newlist. + Package: schleuder + Pin: version * + Pin-Priority: -30000 + **** Configuration :: /etc/schleuder/schleuder.conf @@ -2347,7 +2451,7 @@ A first list can be created with: sudo -u schleuder schleuder-newlist test-schleuder@fripost.org -email test-schleuder@fripost.org -realname test-schleuder -nointeractive -adminaddress user@fripost.org -initmember user@fripost.org -initmemberkey /tmp/user.pub -Note: unlinke Mailman, '-initmember' and '-initmemberkey' are required. +Note: in our case it is *not* the proper way to create lists, since the LDAP directory has to be updated first. To add members, from the command line: @@ -2355,6 +2459,10 @@ To add members, from the command line: # sudo -u schleuder bash echo '- email: user2@fripost.org' >> /var/schleuder/lists/foobar/members.conf +To delete a list: + + sudo rm -rf {/var/lib,/var/log,/etc}/schleuder/listname + **** Web server configuration We will use webschleuder [http://webschleuder.nadir.org/]. Sadly, it is shipped @@ -2438,15 +2546,6 @@ be run by schleuder as it has to read list configuration and the public keyring. TODO: Use SSL. Switch to Nginx+FastCGI/Passenger. -**** Wrapper for Postfix's transport - -We need to strip out the list command before sending the list name to the -schleuder executable (it does it for us, but not when the list is fully qualified). - -The wrapper (postfix-to-schleuder.sh) is available in the fripost-admin repository. - -TODO: bounces -> bounce - *** Tools We need two small scripts to create new lists (one for GNU Mailman, the other -- cgit v1.2.3