diff options
| author | Hsieh Chin Fan <pham@topo.tw> | 2025-01-23 17:44:35 +0800 |
|---|---|---|
| committer | Hsieh Chin Fan <pham@topo.tw> | 2025-01-23 17:44:42 +0800 |
| commit | 785cb8a9c94561847e506f7fcf0ccc322e354a11 (patch) | |
| tree | 11a3c5d3cbbd8ef1106a3b6b569d6fc2fe994d1c /bin/mail | |
| parent | a0989ff54e061a16dbd93d52a9957431aeed57f2 (diff) | |
Update
Diffstat (limited to 'bin/mail')
| -rwxr-xr-x | bin/mail/deliver.sh | 10 |
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 | 84 | ||
| 85 | } | 85 | } |
| 86 | elif [[ "${TO}" =~ '+'|'=' ]]; then | ||
| 87 | mailbox=${TO#*[+=]} # remove chars before symbol of mailbox | ||
| 88 | mailbox=${mailbox%@*} # remove suffix for mail address | ||
| 86 | elif [[ "${FROM}${RETURN_PATH}" =~ notifications@github.com|noreply@github.com ]]; then | 89 | elif [[ "${FROM}${RETURN_PATH}" =~ notifications@github.com|noreply@github.com ]]; then |
| 87 | mailbox=DEV/github | 90 | mailbox=DEV/github |
| 88 | elif [[ "${SUBJECT}" =~ 帳單|轉帳|對帳|付款|發票|消費|繳費|收據|費用|Invoice|Billing ]]; then | 91 | elif [[ "${SUBJECT}" =~ 帳單|轉帳|對帳|付款|發票|消費|繳費|收據|費用|Invoice|Billing ]]; then |
| @@ -99,8 +102,7 @@ elif [[ "${LIST_ID}" =~ mutt-users.mutt.org ]]; then | |||
| 99 | mailbox=LIST/mutt | 102 | mailbox=LIST/mutt |
| 100 | elif [[ | 103 | elif [[ |
| 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 |
| 106 | elif [[ "${SUBJECT}" =~ login|verify|sign-in|密碼|安全性警示|登入|存取 ]]; then | 108 | elif [[ "${SUBJECT}" =~ login|verify|sign-in|密碼|安全性警示|登入|存取 ]]; then |
| @@ -111,7 +113,7 @@ elif [[ "${SUBJECT}" =~ 未讀|更新|核對表|嘟文|unread|summary|introduc ] | |||
| 111 | mailbox=update | 113 | mailbox=update |
| 112 | elif [[ | 114 | elif [[ |
| 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 |