From 9a067ce7270718043c0a725aa8c97ea75afdf96c Mon Sep 17 00:00:00 2001 From: Ian Kelling Date: Tue, 7 Nov 2017 14:48:49 -0500 Subject: [PATCH] various updates --- brc | 100 +++++++++++++----- filesystem/etc/apt/detect-http-proxy | 2 +- filesystem/etc/dnsmasq.d/iank.conf | 1 + filesystem/etc/profile.d/environment.sh | 14 ++- .../systemd/system/openvpn-client-nn@.service | 10 +- .../etc/systemd/system/openvpn-nn@.service | 48 +++++++++ .../system/transmission-daemon-nn.service | 18 ---- fsf.svbin | Bin 1274 -> 0 bytes machine_specific/btrbk.hosts | 2 + .../etc/systemd/system/btrbk.service | 7 ++ .../filesystem/etc/systemd/system/btrbk.timer | 8 ++ .../etc/bind/bind-writable/db.b8.nz | 12 +++ .../li/filesystem/etc/bind/named.conf.local | 12 +++ subdir_files/sieve/fsf-test.sieve | 29 +++++ fsf.sieve => subdir_files/sieve/fsf.sieve | 24 +---- subdir_files/sieve/lists.sieve | 83 +++++++++++++++ subdir_files/sieve/main.sieve | 1 + 17 files changed, 296 insertions(+), 75 deletions(-) create mode 100644 filesystem/etc/dnsmasq.d/iank.conf create mode 100644 filesystem/etc/systemd/system/openvpn-nn@.service delete mode 100644 filesystem/etc/systemd/system/transmission-daemon-nn.service delete mode 100644 fsf.svbin create mode 100644 machine_specific/btrbk.hosts create mode 100644 machine_specific/btrbk/filesystem/etc/systemd/system/btrbk.service create mode 100644 machine_specific/btrbk/filesystem/etc/systemd/system/btrbk.timer create mode 100644 machine_specific/li/filesystem/etc/bind/bind-writable/db.b8.nz create mode 100644 subdir_files/sieve/fsf-test.sieve rename fsf.sieve => subdir_files/sieve/fsf.sieve (56%) create mode 100644 subdir_files/sieve/lists.sieve diff --git a/brc b/brc index b163a09..382b362 100644 --- a/brc +++ b/brc @@ -272,7 +272,7 @@ _khfix_common() { local h=${1##*@} local x ssh-keygen -R $h -f $(readlink -f ~/.ssh/known_hosts) - x=$(timeout 1 ssh -oBatchMode=yes -v $1 |& sed -rn "s/debug1: Connecting to $h \[([^\]*)].*/\1/p") + x=$(timeout 1 ssh -oBatchMode=yes -oControlMaster=no -oControlPath=/ -v $1 |& sed -rn "s/debug1: Connecting to $h \[([^\]*)].*/\1/p") if [[ ! $x ]]; then echo "khfix: ssh failed" return 1 @@ -380,7 +380,7 @@ cam() { } ccat () { # config cat. see a config without extra lines. - grep '^\s*[^[:space:]#]' "$@" + grep '^\s*[^;[:space:]#]' "$@" } cdiff() { @@ -514,6 +514,11 @@ envload() { # load environment from a previous: export > file done < "$file" } +# mail related +etail() { + sudo tail -f /var/log/exim4/mainlog +} + f() { # cd forward c + @@ -541,8 +546,24 @@ fastboot() { /a/opt/androidsdk/platform-tools/fastboot "$@"; } # Create from existing manually installed apps by doing # fdroidcl search -i, then manually removing # automatically installed/preinstalled apps + +# firefox updater. commented out, firefox depends on nonfree opengl. +# de.marmaro.krt.ffupdater +# # causes replicant to die on install and go into a boot loop +# me.ccrama.redditslide +# +# # my attempt at recovering from boot loop: +# # in that case, boot to recovery (volume up, home button, power, let go of power after samsun logo) +# # then +# mount /dev/block/mmcblk0p12 /data +# cd /data +# find -iname '*appname*' +# rm -rf FOUND_DIRS +# usually good enough to just rm -rf /data/app/APPNAME +# +# currently broken: +#at.bitfire.davdroid fdroid_pkgs=( - at.bitfire.davdroid com.alaskalinuxuser.justnotes com.artifex.mupdfdemo com.fsck.k9 @@ -554,10 +575,8 @@ fdroid_pkgs=( com.zoffcc.applications.zanavi cz.martykan.forecastie de.danoeh.antennapod - de.marmaro.krt.ffupdater im.vector.alpha # riot info.papdt.blackblub - me.ccrama.redditslide me.tripsit.tripmobile net.gaast.giggity net.osmand.plus @@ -689,6 +708,29 @@ feh() { command feh -FzZ "$@" } +# mail related +frozen() { + rm -rf /tmp/frozen + s mailq |gr frozen|awk '{print $3}' | while read -r id; do + s exim -Mvl $id + echo + s exim -Mvh $id + echo + s exim -Mvb $id + echo -e '\n\n##############################\n' + done | tee -a /tmp/frozen +} +frozenrm() { + local ids=() + while read -r line; do + printf '%s\n' "$line" + ids+=($(printf '%s\n' "$line" |gr frozen|awk '{print $3}')) + done < <(s mailq) + echo "sleeping for 2 in case you change your mind" + sleep 2 + s exim -Mrm "${ids[@]}" +} + funce() { # like -e for functions. returns on error. # at the end of the function, disable with: @@ -956,6 +998,8 @@ mbenable() { set -x mv -T $src $dst || { set +x; return 1; } ln -s -T $dst $src + /a/exe/lnf /p/.mu ~ + mu index --maildir=/m/4e set +x } mbdisable() { @@ -1135,6 +1179,7 @@ rlu() { # [OPTS] HOST PATH s rsync -rlpchviog --relative "${opts[@]}" "$path" "root@$host:/"; } +# only run on desktop. simpler to keep this on one system. r2eadd() { # usage: name url # initial setup of rss2email: # r2e new r2e@iankelling.org @@ -1330,6 +1375,10 @@ srun() { ssh $1 /tmp/${2##*/} "${@:2}" } +sss() { # ssh solo + ssh -oControlMaster=no -oControlPath=/ "$@" +} + swap() { local tmp tmp=$(mktemp) @@ -1399,6 +1448,7 @@ te() { return $ret } +# mail related testmail() { declare -gi _seq; _seq+=1 echo "test body" | m mail -s "test mail from $HOSTNAME, $_seq" "${@:-root@localhost}" @@ -1409,7 +1459,8 @@ testmail() { # MSG_ID is in /var/log/exim4/mainlog, looks like 1ccdnD-0001nh-EN } -# to test sieve, use below command. make modifications, then copy to live file, use -eW to actually modify mailbox +# to test sieve, use below command. for fsf mail, see fsf-get-mail script. +# make modifications, then copy to live file, use -eW to actually modify mailbox # cp /p/c/subdir_files/sieve/personal{test,}.sieve; testsievelist -eW INBOX # # Another option is to use sieve-test SCRIPT MAIL_FILE. note, @@ -1417,17 +1468,19 @@ testmail() { # sieve with output filter. arg is mailbox, like INBOX. # This depends on dovecot conf, notably mail_location in /etc/dovecot/conf.d/10-mail.conf -# + testsievelist() { sieve-filter ~/sieve/maintest.sieve "$@" >/tmp/testsieve.log 2> >(tail) && sed -rn '/^Performed actions:/{n;n;p}' /tmp/testsieve.log | sort -u } +# mail related # plain sieve testsieve() { sieve-filter ~/sieve/main.sieve "$@" } +# mail related testexim() { # testmail above calls sendmail, which is a link to exim/postfix. # it's docs don't say a way of adding an argument @@ -1455,6 +1508,13 @@ tm() { (sleep $(calc "$@ * 60") && mpv --no-config --volume 50 /a/bin/data/alarm.mp3) > /dev/null 2>&1 & } +trg() { transmission-remote-gtk&r; } +trc() { + # example, set global upload limit to 100 kilobytes: + # trc -u 100 + TR_AUTH=":$(jq -r .profiles[0].password ~/.config/transmission-remote-gtk/config.json)" transmission-remote transmission.lan -ne "$@" +} + tu() { local s; @@ -1503,22 +1563,6 @@ vpnbash() { } -trg() { transmission-remote-gtk&r; } - -# transmission() { -# local pid=$(cat /var/lib/transmission-daemon/transmission-daemon.pid) -# if [[ $pid && -e /proc/$pid ]]; then -# echo "noop. already running." -# return -# fi - -# local NAME=transmission-daemon -# local DAEMON=/usr/bin/$NAME -# local duser=debian-transmission - -# [ -e /etc/default/$NAME ] && . /etc/default/$NAME -# s ip netns exec vpn sudo -u $duser ionice -c 3 nice -n 19 $DAEMON $OPTIONS -# } virshrm() { for x in "$@"; do virsh destroy "$x"; virsh undefine "$x"; done @@ -1549,6 +1593,12 @@ vpn() { [[ $1 ]] || { echo need arg; return 1; } journalctl --unit=openvpn-client@$1 -f -n0 & s systemctl start openvpn-client@$1 + # sometimes the ask-password agent does not work and needs a delay. + sleep .5 + # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=779240 + # noticed around 8-2017 after update from around stretch release + # on debian testing, even though the bug is much older. + s systemd-tty-ask-password-agent } vpnoff() { @@ -1574,10 +1624,12 @@ vspicy() { # usage: VIRSH_DOMAIN wtr() { curl wttr.in/boston; } xl() { - # this succeeds even if gnome-screensaver isn't running. + # this succeeds even if gnome-screensaver isn\'t running. gnome-screensaver-command --exit &>/dev/null if ! pidof xscreensaver; then + pushd / xscreensaver & + popd # 1 was not long enough sleep 3 fi diff --git a/filesystem/etc/apt/detect-http-proxy b/filesystem/etc/apt/detect-http-proxy index 1cfdaf9..5680402 100755 --- a/filesystem/etc/apt/detect-http-proxy +++ b/filesystem/etc/apt/detect-http-proxy @@ -21,7 +21,7 @@ if [[ -r $f ]]; then exit 0 else if [[ -w $f ]]; then - rm $f + rm -f $f fi fi fi diff --git a/filesystem/etc/dnsmasq.d/iank.conf b/filesystem/etc/dnsmasq.d/iank.conf new file mode 100644 index 0000000..520b8b2 --- /dev/null +++ b/filesystem/etc/dnsmasq.d/iank.conf @@ -0,0 +1 @@ +servers-file=/etc/dnsmasq-servers.conf diff --git a/filesystem/etc/profile.d/environment.sh b/filesystem/etc/profile.d/environment.sh index bc81673..95dce05 100644 --- a/filesystem/etc/profile.d/environment.sh +++ b/filesystem/etc/profile.d/environment.sh @@ -60,8 +60,12 @@ fi # every user in a same group, so if you copy files there with exact # perms, that is probably not what you want. I don't use a system like # that. I don't care much either way, but the ubuntu one seems a bit -# more user friendly, and copying files between them is a pita with -# different umasks. -if test "$(id -u)" -ge 1000; then - umask 002 -fi +# more user friendly, and copying files between them is a annoying with +# different umasks. However, it also makes it so if you create a file as +# a regular user then move it to become a system file, it's got slightly +# wrong permissions, and sometimes thing break. So, this outweighs the +# other things, stick with 022 umask always. +umask 022 +# this is how we could test for non-system user + +#if test "$(id -u)" -ge 1000; then : fi diff --git a/filesystem/etc/systemd/system/openvpn-client-nn@.service b/filesystem/etc/systemd/system/openvpn-client-nn@.service index d76e194..ab5ccba 100644 --- a/filesystem/etc/systemd/system/openvpn-client-nn@.service +++ b/filesystem/etc/systemd/system/openvpn-client-nn@.service @@ -13,18 +13,20 @@ RuntimeDirectory=openvpn-client RuntimeDirectoryMode=0710 WorkingDirectory=/etc/openvpn/client ExecStart=/usr/bin/nsenter --mount=/root/mount_namespaces/%i /usr/sbin/openvpn --suppress-timestamps --nobind --config /etc/openvpn/client/%i.conf +# Ian: commented out these lines from upstream # until we get the next systemd version (233), which can do bind mounts # inside a mnt namespace via systemd, we have to setup our own, which requires # full priveledges. +# when we enable CababilityBoundingSet, s/=/=+/ on these ExecStart/Stop lines. +# systemd ver in flidas does not suppot =+ #CapabilityBoundingSet=CAP_IPC_LOCK CAP_NET_ADMIN CAP_NET_RAW CAP_SETGID CAP_SETUID CAP_SYS_CHROOT CAP_DAC_OVERRIDE LimitNPROC=10 # DeviceAllow=/dev/null rw # DeviceAllow=/dev/net/tun rw -# ian: added just these lines from upstream -ExecStartPre=+/a/bin/newns/newns -n 10.173.0 start %i -ExecStartPre=+/sbin/iptables-restore /a/bin/distro-setup/transmission-firewall/netns.rules -ExecStopPost=+/a/bin/newns/newns stop %i +ExecStartPre=/a/bin/newns/newns -n 10.173.0 start %i +ExecStartPre=/sbin/iptables-restore /a/bin/distro-setup/transmission-firewall/netns.rules +ExecStopPost=/a/bin/newns/newns stop %i PrivateNetwork=true diff --git a/filesystem/etc/systemd/system/openvpn-nn@.service b/filesystem/etc/systemd/system/openvpn-nn@.service new file mode 100644 index 0000000..c814a3f --- /dev/null +++ b/filesystem/etc/systemd/system/openvpn-nn@.service @@ -0,0 +1,48 @@ +[Unit] + + +Description=OpenVPN connection to %i +PartOf=openvpn.service +ReloadPropagatedFrom=openvpn.service + +# ian, this is starting too early, added this from stretch's openvpn-client@.service +After=syslog.target network-online.target +Wants=network-online.target +# ian, commented out, we are starting too early, no need to be before anything. +Before=systemd-user-sessions.service + +Documentation=man:openvpn(8) +Documentation=https://community.openvpn.net/openvpn/wiki/Openvpn23ManPage +Documentation=https://community.openvpn.net/openvpn/wiki/HOWTO + +[Service] +# these cause ExecStart to fail with "nsenter: reassociate to namespace +# 'ns/mnt' failed: Invalid argument" on trisquel 8. Probably because we +# get put into some mount namespace and the one that I setup does not +# exist within it or something stupid that systemd does not +# document. Whatev. +#PrivateTmp=true +#ProtectSystem=yes + +KillMode=mixed +Type=forking +ExecStart=/usr/bin/nsenter --mount=/root/mount_namespaces/%i /usr/sbin/openvpn --daemon ovpn-%i --status /run/openvpn/%i.status 10 --cd /etc/openvpn --script-security 2 --config /etc/openvpn/client/%i.conf --writepid /run/openvpn/%i.pid +PIDFile=/run/openvpn/%i.pid +ExecReload=/bin/kill -HUP $MAINPID +WorkingDirectory=/etc/openvpn +# Ian: commented out these lines from upstream +#CapabilityBoundingSet=CAP_IPC_LOCK CAP_NET_ADMIN CAP_NET_BIND_SERVICE CAP_NET_RAW CAP_SETGID CAP_SETUID CAP_SYS_CHROOT CAP_DAC_READ_SEARCH CAP_AUDIT_WRITE +LimitNPROC=10 +#DeviceAllow=/dev/null rw +#DeviceAllow=/dev/net/tun rw + +# ian: added just these lines from upstream +ExecStartPre=/a/bin/newns/newns -n 10.173.0 start %i +ExecStartPre=/sbin/iptables-restore /a/bin/distro-setup/transmission-firewall/netns.rules +# note, this doesnt get run on trisquel 8 when ExecStart command fails, +# documentation says it should +ExecStopPost=/a/bin/newns/newns stop %i +PrivateNetwork=true + +[Install] +WantedBy=multi-user.target diff --git a/filesystem/etc/systemd/system/transmission-daemon-nn.service b/filesystem/etc/systemd/system/transmission-daemon-nn.service deleted file mode 100644 index fd4b279..0000000 --- a/filesystem/etc/systemd/system/transmission-daemon-nn.service +++ /dev/null @@ -1,18 +0,0 @@ -[Unit] -Description=Transmission BitTorrent Daemon netns -After=network.target -Requires=openvpn-client-nn@client.service -After=openvpn-client-nn@client.service -JoinsNamespaceOf=openvpn-client-nn@client.service - -[Service] -#User=debian-transmission -# notify type doesn't work with sudo -#Type=notify -ExecStart=/usr/bin/nsenter --mount=/root/mount_namespaces/client sudo -u debian-transmission /usr/bin/transmission-daemon -f --log-error -ExecReload=/bin/kill -s HUP $MAINPID -PrivateNetwork=true -Nice=19 - -[Install] -WantedBy=multi-user.target diff --git a/fsf.svbin b/fsf.svbin deleted file mode 100644 index a6b13684b2044d61363dcb547b018a3596c00c06..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1274 zcmah}L2uJA6n;&!rriqbG&FhuDZ8>Z6%s-mqG?%S1rf=4cHZajeeXRxA3yy1+yWQ2z&_W}JS*odw5K>; zmTL#?aU0-UxyC7c!r{C2gEk!;KXIb1el(w(u#^H^osda9Nn{d8Mi=;@;`g=$ozW#C zdkZ2MiBc+Y(bd}+SGk^3zMyG7$6erMgr!lg@!KpT^E*jOW_p9ic$^kf3N05Zt!>Z7 zK@|?PO`;v>f`j=wZX)swoPk_PGR+u2neigX#msCzD?tv%cMdAZnCD!m2Jmi^ZCFF& zJj*C=f_pmW;VxYEFR!42ZUqLnhnia8cqx-=%%Yg(`^R)~=qgh0S zJZE$13yPhaQemocvEH=3janGYX#kKoKb0&zQ zQb#R&n2}Y&gjBYRn&(Dc{l10caT02Uw*{|^z2i^K)fvD5e4zLqzz|*;>%%*=eH^!8 zyGD)Rjq!%?w)7st&YJhD@s8j}>AhKd`!Is{#ybSous*!5(T>})zbz}tN*Tcy=+#66 SB>G-%xQ}V*bn5>SxW56uzXx~# diff --git a/machine_specific/btrbk.hosts b/machine_specific/btrbk.hosts new file mode 100644 index 0000000..3128123 --- /dev/null +++ b/machine_specific/btrbk.hosts @@ -0,0 +1,2 @@ +treetowl +frodo \ No newline at end of file diff --git a/machine_specific/btrbk/filesystem/etc/systemd/system/btrbk.service b/machine_specific/btrbk/filesystem/etc/systemd/system/btrbk.service new file mode 100644 index 0000000..4be721d --- /dev/null +++ b/machine_specific/btrbk/filesystem/etc/systemd/system/btrbk.service @@ -0,0 +1,7 @@ +[Unit] +Description=Btrbk backup +After=multi-user.target + +[Service] +Type=oneshot +ExecStart=/a/bin/log-quiet/sysd-mail-once btrbk /a/exe/btrbk-run diff --git a/machine_specific/btrbk/filesystem/etc/systemd/system/btrbk.timer b/machine_specific/btrbk/filesystem/etc/systemd/system/btrbk.timer new file mode 100644 index 0000000..27113f6 --- /dev/null +++ b/machine_specific/btrbk/filesystem/etc/systemd/system/btrbk.timer @@ -0,0 +1,8 @@ +[Unit] +Description=Run btrbk-run once every 20 mins + +[Timer] +OnCalendar=*:0/20 + +[Install] +WantedBy=timers.target diff --git a/machine_specific/li/filesystem/etc/bind/bind-writable/db.b8.nz b/machine_specific/li/filesystem/etc/bind/bind-writable/db.b8.nz new file mode 100644 index 0000000..fa2298d --- /dev/null +++ b/machine_specific/li/filesystem/etc/bind/bind-writable/db.b8.nz @@ -0,0 +1,12 @@ +$ORIGIN . +$TTL 60 ; 1 minute +b8.nz IN SOA b8.nz. admin.b8.nz. ( + 25 ; serial + 604800 ; refresh (1 week) + 86400 ; retry (1 day) + 2419200 ; expire (4 weeks) + 60 ; minimum (1 minute) + ) + NS n1.iankelling.org. + NS n2.iankelling.org. + A 73.249.108.7 diff --git a/machine_specific/li/filesystem/etc/bind/named.conf.local b/machine_specific/li/filesystem/etc/bind/named.conf.local index 8286002..0b88ee8 100644 --- a/machine_specific/li/filesystem/etc/bind/named.conf.local +++ b/machine_specific/li/filesystem/etc/bind/named.conf.local @@ -19,3 +19,15 @@ file "/etc/bind/bind-writable/db.iank.life"; }; }; include "/etc/bind/key.iank.life"; + + +zone "b8.nz" { +type master; +file "/etc/bind/bind-writable/db.b8.nz"; + update-policy { + // allow host to update themselves with a key having their own name + grant b8.nz. name b8.nz. A TXT; + grant b8.nz. name *.b8.nz. A TXT; + }; +}; +include "/etc/bind/key.b8.nz"; diff --git a/subdir_files/sieve/fsf-test.sieve b/subdir_files/sieve/fsf-test.sieve new file mode 100644 index 0000000..9c631af --- /dev/null +++ b/subdir_files/sieve/fsf-test.sieve @@ -0,0 +1,29 @@ +require [ "regex", "variables", "fileinto", "envelope", "mailbox", "imap4flags", "include" ]; + +if anyof ( + address :is "from" "sysadmin@gnu.org", + address :is "to" "sysadmin-nonrt@gnu.org", + address :is "from" "sysadmin-comment@gnu.org" + ) { + fileinto :create "sysadmin"; + stop; + } +elsif anyof ( + header :contains "list-id" "", + header :is "Return-path" "" + ) { +fileinto :create "rtcc"; + stop; +} + +if anyof ( + header :regex "subject" "mailing list memberships reminder", + address :is "to" "rtbounces@gnu.org", + address :is "to" "faxmaster@fsf.org", + address :is "from" "FaxMaster@fsf.org" + ) { + fileinto :create "log"; + stop; + } + +include :personal "lists"; diff --git a/fsf.sieve b/subdir_files/sieve/fsf.sieve similarity index 56% rename from fsf.sieve rename to subdir_files/sieve/fsf.sieve index bf10e9d..9c631af 100644 --- a/fsf.sieve +++ b/subdir_files/sieve/fsf.sieve @@ -16,14 +16,6 @@ fileinto :create "rtcc"; stop; } -if anyof ( - header :contains "list-id" "", - header :contains "list-id" "" - ) { - fileinto :create "sec"; - stop; - } - if anyof ( header :regex "subject" "mailing list memberships reminder", address :is "to" "rtbounces@gnu.org", @@ -33,19 +25,5 @@ if anyof ( fileinto :create "log"; stop; } -# Return-path: -if allof ( - address :is "from" "mailman-owner@zope.org", - header :is "subject" "zope.org mailing list memberships reminder" - ) { - discard; - stop; - } - -if anyof ( - header :contains "list-id" "" - ) { - fileinto :create "pirate-party"; - stop; - } +include :personal "lists"; diff --git a/subdir_files/sieve/lists.sieve b/subdir_files/sieve/lists.sieve new file mode 100644 index 0000000..8f2c673 --- /dev/null +++ b/subdir_files/sieve/lists.sieve @@ -0,0 +1,83 @@ +require [ "regex", "variables", "fileinto", "envelope", "mailbox", "imap4flags", "include" ]; + +if anyof ( + header :contains "list-id" "", + header :contains "list-id" "" + ) { + fileinto :create "sec"; + stop; + } + +if anyof ( + header :contains "list-id" "", + header :contains "list-id" "", + header :contains "list-id" "", + header :contains "list-id" "", + header :contains "list-id" "", + header :contains "list-id" "", + header :contains "list-id" "", + header :contains "list-id" "", + header :contains "list-id" "", + header :contains "list-id" "", + header :contains "list-id" "", + header :contains "list-id" "", + header :contains "list-id" "", + header :contains "list-id" "", + header :contains "list-id" "", + header :contains "list-id" "", + header :contains "list-id" "", + header :contains "list-id" "", + header :contains "list-id" "", + header :contains "list-id" "", + header :contains "list-id" "", + header :contains "list-id" "", + header :contains "list-id" "", + header :contains "list-id" "", + header :contains "list-id" "", + header :contains "list-id" "", + header :contains "list-id" "", + header :contains "list-id" "", + header :contains "list-id" "", + header :contains "list-id" "", + header :contains "list-id" "", + header :contains "list-id" "", + header :contains "list-id" "", + header :contains "list-id" "", + header :contains "list-id" "", + header :contains "list-id" "", + header :contains "list-id" "", + header :contains "list-id" "", + header :contains "list-id" "", + header :contains "list-id" "") { + if header :regex "list-id" "<([a-z_0-9-]+)[.@]" { + set :lower "listname" "${1}"; + fileinto :create "l/${listname}"; + } +} +if anyof ( + header :contains "list-id" "", + header :contains "list-id" "", + header :contains "list-id" "") { + if header :regex "list-id" "<([a-z_0-9-]+)[.@]" { + set :lower "listname" "${1}"; + fileinto :create "l/fedora.${listname}"; + } +} + +if anyof ( + header :contains "list-id" "", + header :contains "list-id" "", + header :contains "list-id" "", + header :contains "list-id" "" + ) { + fileinto :create "community"; + stop; + } + +if allof ( + address :is "from" "mailman-owner@zope.org", + header :is "subject" "zope.org mailing list memberships reminder" + ) { + discard; + stop; + } diff --git a/subdir_files/sieve/main.sieve b/subdir_files/sieve/main.sieve index 5fbac25..1098ea0 100644 --- a/subdir_files/sieve/main.sieve +++ b/subdir_files/sieve/main.sieve @@ -14,6 +14,7 @@ if header :regex "x-spam_bar" "^\\+{5}" { } include :personal "personal"; +include :personal "lists"; # note, i originally used something like this to filter mailing lists -- 2.30.2