cronyakatsuki.xyz/content/blog/using-mblaze.md
2024-01-07 14:46:55 +01:00

94 lines
3.8 KiB
Markdown

+++
title = 'Using Mblaze'
date = 2024-01-07T12:15:21+01:00
draft = false
tags = ['linux', 'mblaze', 'mail' ]
+++
So you followed my last tutorial on setting up mblaze and friend's for you mail management, but now you are left just looking at it not understanding how to use the power you have been given now. So now I'm going to teach you some basic usage that you can have with it.
# Helper function's
I guess you haven't read my other blog on setting up mblaze and friend's if you need me to type them out here again, so go read it now! Here is the [link](https://cronyakatsuki.xyz/blog/virgin-mutt-user-meet-mblaze/).
# Getting mail and reading it
Now after you have actually read my last blog and got the two function's and the script installed and made them usefull, we can start getting and reading our mail.
First you will choose what mail you wanna manage, or how I call it profile with my script.
After choosing it you will now have to choose if you wan't to see all mail available on the server, or you will be just reading the new mail and based on that run either `mall` or `mnew`.
Now we have a couple way's of listing and reading mail.
We can use the command `mscan` that will show you simple one line summaries of your mail. The mail with `.` mean their status is undread.
To read a single specific message we can use `mshow`. By default it will use the mail that when using `mscan` show's > as **currently choosen** mail. To read another mail you can choose the number of the mail from `mscan` and use mshow like this `mshow N` ( N being the number of the mail you wan't to read ).
Now onto my favourite way of reading mail with mblaze, it's `mless`. You just run it and it will run a less instance showing all your mail, and have the ability to change between them with keybindings `:p` and `:n` with p going to preview and n going to next message.
# Settings read status
To flag mail as read we can use the mflag utiity. We do it by choosing what mail we wanna mark as read and running the command `mflag -S N`, but after that we need to fix our list because the filename changed because of the fact that we changed the flag to read. To fix that we will run `mseq -f : | mseq -S`.
We can easily alias this sequence of command's into a function to streamline this.
```bash
function mread() {
mflag -S $1
mseq -f : | mseq -S
}
```
You can place this function anywhere in your shell configuration.
# Sending mail
To write mail with mblaze we use command called `mcom`. After running it, it will a file in your editor of choice that looks like this:
``` devbox
To:
Cc:
Bcc:
Subject:
From: John Doe <john@doe.com>
Message-Id: <random-id>
User-Agent: mblaze/...
```
In the `To:` file you write the name of mail you wan't to send to for example `Shit Shittington <shit@shittington.com>` and subject to name of the subject like regular mail.
After that you type the message in the last empty line at the bottom, of course you can make it as long as you wan't to.
If you save the message as draft just run `mcom -r`. To reply to a message use `mrep N` to reply to a specific message.
# Extending mless functionalitty
We can extend the functionality of mless a bit by creating a file with custom keybindings that will go ahead and a few more function's to mless.
Save this file to `~/.mblaze/mlesskey`
``` lesskey
Q quit \1
:cq quit \1
[ prev-file
] next-file
{ noaction E1\n
} quit $
$ quit $
S noaction E//scan\n
` noaction E\#\n
H quit H
N quit N
R quit R
K quit k
d quit d
\^ quit \^
```
This will add keybindings like `]` and `[` for previous and next mail and `d` for setting read status on mail. Rest you can checkout yourself by looking at this part of mless script on github, [link](https://github.com/leahneukirchen/mblaze/blob/master/mless#L92).
# Conclusion
I guess this is it now, hope this help's you on making your own mail be even more amazing.