Add in mblaze function for better mail managment.

This commit is contained in:
CronyAkatsuki 2023-10-24 18:10:42 +02:00
parent e79bf4a82c
commit 7f3840ba26

View File

@ -128,3 +128,30 @@ n () {
upfast () { upfast () {
curl -F "file=@$(readlink -f $1)" "https://upfast.cronyakatsuki.xyz/" 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
}