aboutsummaryrefslogtreecommitdiffhomepage
path: root/alias
diff options
context:
space:
mode:
authorHsieh Chin Fan <pham@topo.tw>2023-04-15 23:00:21 +0800
committerHsieh Chin Fan <pham@topo.tw>2023-04-15 23:00:21 +0800
commite16cf6440539a8bf12a949a1a285629307be0bb4 (patch)
tree2b8234cbfb94bc7885d6881005837639c1966019 /alias
parenteba32df4188f3c2127cf03ee26cda6eb4f3fab41 (diff)
Update function about IMAP with curl
Diffstat (limited to 'alias')
-rw-r--r--alias17
1 files changed, 13 insertions, 4 deletions
diff --git a/alias b/alias
index e8b8e6a..3775d1a 100644
--- a/alias
+++ b/alias
@@ -73,12 +73,12 @@ ssh.down() {
73} 73}
74 74
75# imap 75# imap
76curl.save_as_mail() { 76curl.mail.save() {
77 curl imaps://mail.topo.tw/INBOX \ 77 curl "imaps://mail.topo.tw/$1" \
78 --user pham:`pass mail/pham@mail.topo.tw` \ 78 --user pham:`pass mail/pham@mail.topo.tw` \
79 -T $1 79 -T $2
80} 80}
81curl.save_as_mail_attachment() { 81curl.mail.save_attachment() {
82#TEMPFILE=$(mktemp) 82#TEMPFILE=$(mktemp)
83 trap 'rm $TEMPFILE' EXIT 83 trap 'rm $TEMPFILE' EXIT
84 mail -a $1 -Sexpandaddr /dev/stdout | \ 84 mail -a $1 -Sexpandaddr /dev/stdout | \
@@ -86,6 +86,15 @@ curl.save_as_mail_attachment() {
86 --user pham:`pass mail/pham@mail.topo.tw` \ 86 --user pham:`pass mail/pham@mail.topo.tw` \
87 -T /dev/stdin 87 -T /dev/stdin
88} 88}
89curl.mail.search.subject() {
90 curl "imaps://mail.topo.tw/$1" \
91 --user pham:`pass mail/pham@mail.topo.tw` \
92 --request "SEARCH SUBJECT $2"
93}
94curl.mail.fetch() {
95 curl "imaps://mail.topo.tw/$1;MAILINDEX=$2" \
96 --user pham:`pass mail/pham@mail.topo.tw` \
97}
89 98
90# Gist 99# Gist
91alias g='gist' 100alias g='gist'