aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorHsieh Chin Fan <pham@topo.tw>2025-01-23 17:44:35 +0800
committerHsieh Chin Fan <pham@topo.tw>2025-01-23 17:44:42 +0800
commit785cb8a9c94561847e506f7fcf0ccc322e354a11 (patch)
tree11a3c5d3cbbd8ef1106a3b6b569d6fc2fe994d1c
parenta0989ff54e061a16dbd93d52a9957431aeed57f2 (diff)
Update
-rwxr-xr-xbin/mail/deliver.sh10
1 files changed, 6 insertions, 4 deletions
diff --git a/bin/mail/deliver.sh b/bin/mail/deliver.sh
index 3974f78..703e284 100755
--- a/bin/mail/deliver.sh
+++ b/bin/mail/deliver.sh
@@ -66,7 +66,7 @@ if [[ "$SENDER" = pham@topo.tw && -n $CHAT_VERSION ]]; then
66 heading="$(head -1 <<<"${body}")" 66 heading="$(head -1 <<<"${body}")"
67 67
68 if [[ "${heading}" =~ ^"." ]]; then 68 if [[ "${heading}" =~ ^"." ]]; then
69 mailbox=do 69 mailbox=act
70 heading=${heading#.} 70 heading=${heading#.}
71 else 71 else
72 mailbox=box 72 mailbox=box
@@ -83,6 +83,9 @@ if [[ "$SENDER" = pham@topo.tw && -n $CHAT_VERSION ]]; then
83 $(sed 1d <<<"$body") 83 $(sed 1d <<<"$body")
84 MAIL 84 MAIL
85 } 85 }
86elif [[ "${TO}" =~ '+'|'=' ]]; then
87 mailbox=${TO#*[+=]} # remove chars before symbol of mailbox
88 mailbox=${mailbox%@*} # remove suffix for mail address
86elif [[ "${FROM}${RETURN_PATH}" =~ notifications@github.com|noreply@github.com ]]; then 89elif [[ "${FROM}${RETURN_PATH}" =~ notifications@github.com|noreply@github.com ]]; then
87 mailbox=DEV/github 90 mailbox=DEV/github
88elif [[ "${SUBJECT}" =~ 帳單|轉帳|對帳|付款|發票|消費|繳費|收據|費用|Invoice|Billing ]]; then 91elif [[ "${SUBJECT}" =~ 帳單|轉帳|對帳|付款|發票|消費|繳費|收據|費用|Invoice|Billing ]]; then
@@ -99,8 +102,7 @@ elif [[ "${LIST_ID}" =~ mutt-users.mutt.org ]]; then
99 mailbox=LIST/mutt 102 mailbox=LIST/mutt
100elif [[ 103elif [[
101 "${SUBJECT}" =~ 電子報|快訊|newsletter || 104 "${SUBJECT}" =~ 電子報|快訊|newsletter ||
102 "${TO}" =~ substack 105 "${FROM}${TO}" =~ substack|service@kucw.io \
103 "${FROM}" =~ service@kucw.io
104 ]]; then 106 ]]; then
105 mailbox=news 107 mailbox=news
106elif [[ "${SUBJECT}" =~ login|verify|sign-in|密碼|安全性警示|登入|存取 ]]; then 108elif [[ "${SUBJECT}" =~ login|verify|sign-in|密碼|安全性警示|登入|存取 ]]; then
@@ -111,7 +113,7 @@ elif [[ "${SUBJECT}" =~ 未讀|更新|核對表|嘟文|unread|summary|introduc ]
111 mailbox=update 113 mailbox=update
112elif [[ 114elif [[
113 "${SUBJECT}${FROM}" =~ 優惠|快訊|願望清單|期待|eDM || 115 "${SUBJECT}${FROM}" =~ 優惠|快訊|願望清單|期待|eDM ||
114 -n "${LIST_ID}" || 116 -n "${LIST_ID}${LIST_UNSUBSCRIBE}" ||
115 ${TO} =~ tienling.chou@topo.tw \ 117 ${TO} =~ tienling.chou@topo.tw \
116 ]]; then 118 ]]; then
117 mailbox=MISC/promote 119 mailbox=MISC/promote