From: Ian Kelling Date: Thu, 30 Mar 2017 22:58:39 +0000 (-0700) Subject: mostly fix mail bugs X-Git-Url: https://iankelling.org/git/?p=distro-setup;a=commitdiff_plain;h=a84e2166aafd58213298ff4b2f674a4b644cc416 mostly fix mail bugs --- diff --git a/btrbk-run b/btrbk-run index 97b83e0..4642a70 100755 --- a/btrbk-run +++ b/btrbk-run @@ -28,21 +28,23 @@ script_dir=$(dirname $(readlink -f "$BASH_SOURCE")) # note q is owned by root:1000 # note p/m is owned 1000:1000 and chmod 700 mountpoints=(/a) -private_mountpoints=(/q /m) +private_mountpoints=(/q) rsync_mountpoint=/q conf_only=false dry_run=false # mostly for testing resume_arg= do_i=true +do_o=true -temp=$(getopt -l help hcinprt: "$@") || usage 1 +temp=$(getopt -l help hcinoprt: "$@") || usage 1 eval set -- "$temp" while true; do case $1 in -c) conf_only=true; shift ;; -i) do_i=false; shift ;; -n) dry_run=true; dry_run_arg=-n; shift ;; + -o) do_o=false; shift ;; -p) progress_arg="--progress"; shift ;; # btrbk arg: Resume only. Skips snapshot creation. -r) resume_arg=-r; shift ;; @@ -52,7 +54,11 @@ while true; do *) echo "$0: Internal error!" ; exit 1 ;; esac done -read primary <<<"$@" + +if $do_o; then + private_mountpoints+=(/o) +fi +read primary <<<"$@" # not yet used ##### end command line parsing ######## diff --git a/distro-end b/distro-end index 2317edd..202f85f 100755 --- a/distro-end +++ b/distro-end @@ -332,7 +332,7 @@ ser enable mailroute if [[ $HOSTNAME == treetowl ]]; then # note, this will need to be changed when the mail/contacts host changes sgo openvpn-client@mail - /a/bin/distro-setup/radicale-setup.sh + /a/bin/distro-setup/radicale-setup fi ## android studio setup @@ -373,10 +373,12 @@ if [[ $HOSTNAME == treetowl ]]; then pi syncthing ;; esac + lnf -T /w/syncthing /home/ian/.config/syncthing sgo syncthing@ian # runs as ian # these things persist in ~/.config/syncthing, which I save in - # /p/c/machine_specific + # /w/syncthing (not in /p, because syncthing should continue to + # run on home server even when using laptop as primary device) # open http://localhost:8384/ # change listen address from default to tcp://:22001, # this is because we do port forward so it doesn\'t have to use @@ -452,7 +454,7 @@ EOF # it contains runtime data, # plus a simple symlink to the config file which it's # not worth separating out. - s lnf -T /q/transmission-daemon /var/lib/transmission-daemon/.config/transmission-daemon + s lnf -T /i/transmission-daemon /var/lib/transmission-daemon/.config/transmission-daemon # # config file documented here, and it's the same config # for daemon vs client, so it's documented in the gui. diff --git a/mail-route b/mail-route index f896bfe..dc74c7b 100755 --- a/mail-route +++ b/mail-route @@ -62,8 +62,9 @@ esac # match source or dest port. when we send to 25, it picks a random high port as # the source. -for port in 25 993; do # smtp and imap with ssl. -e iptables -t mangle $iptables_op OUTPUT -m tcp -p tcp -m multiport --ports $port -j MARK --set-mark 0x1 +for port in 25 143; do # smtp and imap. + e iptables -t mangle $iptables_op \ + OUTPUT -m tcp -p tcp -m multiport --ports $port -j MARK --set-mark 0x1 done e iptables -t nat $iptables_op POSTROUTING -o tun0 -m mark --mark 0x1 -j SNAT --to-source 10.8.0.4 e ip rule $ip_op fwmark 1 table 1 diff --git a/mail-setup b/mail-setup index da91b1c..716a8b1 100755 --- a/mail-setup +++ b/mail-setup @@ -1,4 +1,4 @@ -#!/bin/bash -l +#!/bin/bash # Copyright (C) 2016 Ian Kelling # Licensed under the Apache License, Version 2.0 (the "License"); @@ -430,6 +430,7 @@ Description=Offlineimap sync After=multi-user.target [Service] +User=ian Type=oneshot ExecStart=/a/bin/log-quiet/sysd-mail-once offlineimap-sync /a/bin/distro-setup/offlineimap-sync EOF diff --git a/radicale-setup.sh b/radicale-setup similarity index 98% rename from radicale-setup.sh rename to radicale-setup index 620096a..826ddb9 100755 --- a/radicale-setup.sh +++ b/radicale-setup @@ -20,7 +20,7 @@ pi nginx python-dulwich radicale # I moved /var/lib/radicale after it's initialization. # I did a sudo -u radicale git init in the collections subfolder # after it gets created, per the git docs. -lnf -T /q/radicale /var/lib/radicale +lnf -T /o/radicale /var/lib/radicale acme-tiny -n cal.iank.pw diff --git a/vpn-mail-forward b/vpn-mail-forward index 9a86e69..76da424 100755 --- a/vpn-mail-forward +++ b/vpn-mail-forward @@ -10,7 +10,7 @@ do-forward() { done } -ports=(25 993) +ports=(25 143) case $1 in start) do-forward -A ${ports[@]}