iankelling.org
/
git
/
distro-setup
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
mail improvements
[distro-setup]
/
brc
diff --git
a/brc
b/brc
index b232c9ed97d893933b71d597524481b265edcd69..9e9752c18d33c9da89120b008acbcd9892d82a1d 100644
(file)
--- a/
brc
+++ b/
brc
@@
-1806,9
+1806,8
@@
testmail() {
# MSG_ID is in /var/log/exim4/mainlog, looks like 1ccdnD-0001nh-EN
}
# MSG_ID is in /var/log/exim4/mainlog, looks like 1ccdnD-0001nh-EN
}
-# to test sieve, use below command. for fsf mail, see
fsf-get-mail script.
+# to test sieve, use below command. for fsf mail, see
offlineimap-sync script
# make modifications, then copy to live file, use -eW to actually modify mailbox
# 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,
# sieve-test doesnt know about envelopes, Im not sure if sieve-filter does.
#
# Another option is to use sieve-test SCRIPT MAIL_FILE. note,
# sieve-test doesnt know about envelopes, Im not sure if sieve-filter does.
@@
-1816,15
+1815,17
@@
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
# 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
+
_dosieve
() {
+ sieve-filter
"$@" 2> >(head; tail) >/tmp/testsieve.log && sed -rn '/^Performed actions:/,/^[^ ]/{/^ /p}' /tmp/testsieve.log | sort | uniq -c
}
}
-
-# mail related
-# plain sieve
+# always run this first, edit the test files, then run the following
testsieve() {
testsieve() {
- sieve-filter ~/sieve/main.sieve "$@"
+ _dosieve ~/sieve/maintest.sieve INBOX delete
+}
+runsieve() {
+ c ~/sieve; cp personal{test,}.sieve; cp lists{test,}.sieve
+ _dosieve ~/sieve/main.sieve -eW INBOX delete
}
# mail related
}
# mail related