From 648257b1698602fdeeb7eb5ba496106547f93665 Mon Sep 17 00:00:00 2001 From: Ian Kelling Date: Sun, 28 Jul 2019 20:36:19 -0400 Subject: [PATCH] better local bounce handling --- brc | 23 +++++++++++++---------- mail-setup | 20 +++++++++++--------- 2 files changed, 24 insertions(+), 19 deletions(-) diff --git a/brc b/brc index e1aa677..df4b908 100644 --- a/brc +++ b/brc @@ -122,7 +122,7 @@ if [[ $- == *i* ]]; then if [[ $KONSOLE_PROFILE_NAME ]]; then TERM=xterm-256color - fi + fi # todo: not sure this works in sakura #stty werase undef @@ -1118,14 +1118,14 @@ ifn() { } - o() { - if type gvfs-open &> /dev/null ; then - gvfs-open "$@" - else - xdg-open "$@" - fi - # another alternative is run-mailcap - } +o() { + if type gvfs-open &> /dev/null ; then + gvfs-open "$@" + else + xdg-open "$@" + fi + # another alternative is run-mailcap +} ipdrop() { s iptables -A INPUT -s $1 -j DROP @@ -2192,8 +2192,11 @@ if [[ $- == *i* ]]; then if [[ -e /nocow/btrfs-stale ]] && ((`command ls -AUq /nocow/btrfs-stale|wc -l`)); then ps_char="! $ps_char" fi + if test -e /Maildir/new/*; then + ps_char='!BOUNCE! '"$ps_char" + fi if [[ -e /nocow/mailtest-failure ]]; then - ps_char="@#$@#$ $ps_char" + ps_char='@#$@#$ '"$ps_char" fi source /a/bin/bash_unpublished/source-state if [[ ! $SSH_CLIENT && $MAIL_HOST != $HOSTNAME ]]; then diff --git a/mail-setup b/mail-setup index db75252..65c9d8b 100755 --- a/mail-setup +++ b/mail-setup @@ -684,7 +684,10 @@ EOF cat >>/etc/exim4/update-exim4.conf.conf </dev/null; then - usermod -a -G Debian-exim 1000 -fi -if [[ -e /m/md ]]; then - ln -s /Maildir /m/md/bounces +dirs=(/Maildir/{cur,tmp,new}) +mkdir -p ${dirs[@]} +chown -R $u:Debian-exim /Maildir +chmod 775 ${dirs[@]} +usermod -a -G Debian-exim $u +if [[ -d /m/md ]]; then + sudo -u $u ln -sf -T /Maildir /m/md/bounces fi # put spool dir in directory that spans multiple distros. -- 2.30.2