From e16cf6440539a8bf12a949a1a285629307be0bb4 Mon Sep 17 00:00:00 2001 From: Hsieh Chin Fan Date: Sat, 15 Apr 2023 23:00:21 +0800 Subject: Update function about IMAP with curl --- alias | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'alias') diff --git a/alias b/alias index e8b8e6a..3775d1a 100644 --- a/alias +++ b/alias @@ -73,12 +73,12 @@ ssh.down() { } # imap -curl.save_as_mail() { - curl imaps://mail.topo.tw/INBOX \ +curl.mail.save() { + curl "imaps://mail.topo.tw/$1" \ --user pham:`pass mail/pham@mail.topo.tw` \ - -T $1 + -T $2 } -curl.save_as_mail_attachment() { +curl.mail.save_attachment() { #TEMPFILE=$(mktemp) trap 'rm $TEMPFILE' EXIT mail -a $1 -Sexpandaddr /dev/stdout | \ @@ -86,6 +86,15 @@ curl.save_as_mail_attachment() { --user pham:`pass mail/pham@mail.topo.tw` \ -T /dev/stdin } +curl.mail.search.subject() { + curl "imaps://mail.topo.tw/$1" \ + --user pham:`pass mail/pham@mail.topo.tw` \ + --request "SEARCH SUBJECT $2" +} +curl.mail.fetch() { + curl "imaps://mail.topo.tw/$1;MAILINDEX=$2" \ + --user pham:`pass mail/pham@mail.topo.tw` \ +} # Gist alias g='gist' -- cgit v1.2.3-70-g09d2