diff --git a/.config/zsh/functions.zsh b/.config/zsh/functions.zsh index 7c22299..a36fd50 100755 --- a/.config/zsh/functions.zsh +++ b/.config/zsh/functions.zsh @@ -128,3 +128,30 @@ n () { upfast () { curl -F "file=@$(readlink -f $1)" "https://upfast.cronyakatsuki.xyz/" } + +# mblaze functions + +# Get new mail for current profile +mnew () { + maildir=$(grep "^Maildir:" $HOME/.mblaze/profile | cut -d: -f 2 | sed 's/ //g') + profile=$(basename $maildir) + if [ "$profile" = "local" ]; then + mlist -s "$maildir"| msort -dr | mseq -S + else + mbsync -V $profile + mlist -s "$maildir"/INBOX | msort -dr | mseq -S + fi +} + +# Get full mail for current profile including threads +mall () { + maildir=$(grep "^Maildir:" $HOME/.mblaze/profile | cut -d: -f 2 | sed 's/ //g') + sent=$(grep "^Outbox:" $HOME/.mblaze/profile | cut -d: -f 2 | sed 's/ //g') + profile=$(basename $maildir) + if [ "$profile" = "local" ]; then + mlist "$maildir" | mthread -r -S "$maildir" | mseq -S + else + mbsync -V $profile + mlist "$maildir"/INBOX | mthread -r -S "$sent" | mseq -S + fi +}