Site update

This commit is contained in:
CronyAkatsuki 2024-01-07 14:46:55 +01:00
parent ad69964e08
commit d0a1fb7228
16 changed files with 935 additions and 12 deletions

View file

@ -42,6 +42,13 @@
<div id="blog-meta">
<p id="date">10-11-2023</p>
<p>
<span>|</span>
<a href="https://cronyakatsuki.xyz/tags/linux/">linux</a> <span>|</span>
<a href="https://cronyakatsuki.xyz/tags/ssh/">ssh</a> <span>|</span>
<a href="https://cronyakatsuki.xyz/tags/ntfy/">ntfy</a> <span>|</span>
<a href="https://cronyakatsuki.xyz/tags/security/">security</a></p>
<hr>
</div>

View file

@ -40,6 +40,9 @@
<section class="list">
<a href="/blog/using-mblaze/">
07-01-2024 || Using Mblaze</a><br />
<a href="/blog/hardening-level-pro-notify-on-ssh-login/">
10-11-2023 || Hardening Level Pro: Notify on SSH Login</a><br />

View file

@ -6,11 +6,72 @@
<description>Recent content in Blog on Crony Akatsuki&#39;s Website</description>
<generator>Hugo -- gohugo.io</generator>
<language>en-us</language>
<lastBuildDate>Fri, 10 Nov 2023 19:27:27 +0100</lastBuildDate>
<lastBuildDate>Sun, 07 Jan 2024 12:15:21 +0100</lastBuildDate>
<atom:link href="https://cronyakatsuki.xyz/blog/index.xml" rel="self" type="application/rss+xml" />
<item>
<title>Using Mblaze</title>
<link>https://cronyakatsuki.xyz/blog/using-mblaze/</link>
<pubDate>07-01-2024</pubDate>
<guid>https://cronyakatsuki.xyz/blog/using-mblaze/</guid>
<description>&lt;p&gt;So you followed my last tutorial on setting up mblaze and friend&amp;rsquo;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&amp;rsquo;m going to teach you some basic usage that you can have with it.&lt;/p&gt;
&lt;h1 id=&#34;helper-functions&#34;&gt;Helper function&amp;rsquo;s&lt;/h1&gt;
&lt;p&gt;I guess you haven&amp;rsquo;t read my other blog on setting up mblaze and friend&amp;rsquo;s if you need me to type them out here again, so go read it now! Here is the &lt;a href=&#34;https://cronyakatsuki.xyz/blog/virgin-mutt-user-meet-mblaze/&#34;&gt;link&lt;/a&gt;.&lt;/p&gt;
&lt;h1 id=&#34;getting-mail-and-reading-it&#34;&gt;Getting mail and reading it&lt;/h1&gt;
&lt;p&gt;Now after you have actually read my last blog and got the two function&amp;rsquo;s and the script installed and made them usefull, we can start getting and reading our mail.&lt;/p&gt;
&lt;p&gt;First you will choose what mail you wanna manage, or how I call it profile with my script.&lt;/p&gt;
&lt;p&gt;After choosing it you will now have to choose if you wan&amp;rsquo;t to see all mail available on the server, or you will be just reading the new mail and based on that run either &lt;code&gt;mall&lt;/code&gt; or &lt;code&gt;mnew&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Now we have a couple way&amp;rsquo;s of listing and reading mail.&lt;/p&gt;
&lt;p&gt;We can use the command &lt;code&gt;mscan&lt;/code&gt; that will show you simple one line summaries of your mail. The mail with &lt;code&gt;.&lt;/code&gt; mean their status is undread.&lt;/p&gt;
&lt;p&gt;To read a single specific message we can use &lt;code&gt;mshow&lt;/code&gt;. By default it will use the mail that when using &lt;code&gt;mscan&lt;/code&gt; show&amp;rsquo;s &amp;gt; as &lt;strong&gt;currently choosen&lt;/strong&gt; mail. To read another mail you can choose the number of the mail from &lt;code&gt;mscan&lt;/code&gt; and use mshow like this &lt;code&gt;mshow N&lt;/code&gt; ( N being the number of the mail you wan&amp;rsquo;t to read ).&lt;/p&gt;
&lt;p&gt;Now onto my favourite way of reading mail with mblaze, it&amp;rsquo;s &lt;code&gt;mless&lt;/code&gt;. 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 &lt;code&gt;:p&lt;/code&gt; and &lt;code&gt;:n&lt;/code&gt; with p going to preview and n going to next message.&lt;/p&gt;
&lt;h1 id=&#34;settings-read-status&#34;&gt;Settings read status&lt;/h1&gt;
&lt;p&gt;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 &lt;code&gt;mflag -S N&lt;/code&gt;, 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 &lt;code&gt;mseq -f : | mseq -S&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;We can easily alias this sequence of command&amp;rsquo;s into a function to streamline this.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#c6d0f5;background-color:#303446;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ca9ee6&#34;&gt;function&lt;/span&gt; mread&lt;span style=&#34;color:#99d1db;font-weight:bold&#34;&gt;()&lt;/span&gt; &lt;span style=&#34;color:#99d1db;font-weight:bold&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; mflag -S &lt;span style=&#34;color:#f2d5cf&#34;&gt;$1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; mseq -f : | mseq -S
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#99d1db;font-weight:bold&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You can place this function anywhere in your shell configuration.&lt;/p&gt;
&lt;h1 id=&#34;sending-mail&#34;&gt;Sending mail&lt;/h1&gt;
&lt;p&gt;To write mail with mblaze we use command called &lt;code&gt;mcom&lt;/code&gt;. After running it, it will a file in your editor of choice that looks like this:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code class=&#34;language-devbox&#34; data-lang=&#34;devbox&#34;&gt;To:
Cc:
Bcc:
Subject:
From: John Doe &amp;lt;john@doe.com&amp;gt;
Message-Id: &amp;lt;random-id&amp;gt;
User-Agent: mblaze/...
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;In the &lt;code&gt;To:&lt;/code&gt; file you write the name of mail you wan&amp;rsquo;t to send to for example &lt;code&gt;Shit Shittington &amp;lt;shit@shittington.com&amp;gt;&lt;/code&gt; and subject to name of the subject like regular mail.&lt;/p&gt;
&lt;p&gt;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&amp;rsquo;t to.&lt;/p&gt;
&lt;p&gt;If you save the message as draft just run &lt;code&gt;mcom -r&lt;/code&gt;. To reply to a message use &lt;code&gt;mrep N&lt;/code&gt; to reply to a specific message.&lt;/p&gt;
&lt;h1 id=&#34;extending-mless-functionalitty&#34;&gt;Extending mless functionalitty&lt;/h1&gt;
&lt;p&gt;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&amp;rsquo;s to mless.&lt;/p&gt;
&lt;p&gt;Save this file to &lt;code&gt;~/.mblaze/mlesskey&lt;/code&gt;&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code class=&#34;language-lesskey&#34; data-lang=&#34;lesskey&#34;&gt;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 \^
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;This will add keybindings like &lt;code&gt;]&lt;/code&gt; and &lt;code&gt;[&lt;/code&gt; for previous and next mail and &lt;code&gt;d&lt;/code&gt; for setting read status on mail. Rest you can checkout yourself by looking at this part of mless script on github, &lt;a href=&#34;https://github.com/leahneukirchen/mblaze/blob/master/mless#L92&#34;&gt;link&lt;/a&gt;.&lt;/p&gt;
&lt;h1 id=&#34;conclusion&#34;&gt;Conclusion&lt;/h1&gt;
&lt;p&gt;I guess this is it now, hope this help&amp;rsquo;s you on making your own mail be even more amazing.&lt;/p&gt;
</description>
</item>
<item>
<title>Hardening Level Pro: Notify on SSH Login</title>
<link>https://cronyakatsuki.xyz/blog/hardening-level-pro-notify-on-ssh-login/</link>
@ -184,7 +245,7 @@ Scan-Format: %c%u%r %-3n %10d %17f %t %2i%s
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#c6d0f5;background-color:#303446;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#737994;font-style:italic&#34;&gt;# mblaze functions&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#737994;font-style:italic&#34;&gt;# Get new mail for current profile&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;mnew &lt;span style=&#34;color:#99d1db;font-weight:bold&#34;&gt;()&lt;/span&gt; &lt;span style=&#34;color:#99d1db;font-weight:bold&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ca9ee6&#34;&gt;function&lt;/span&gt; mnew &lt;span style=&#34;color:#99d1db;font-weight:bold&#34;&gt;()&lt;/span&gt; &lt;span style=&#34;color:#99d1db;font-weight:bold&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &lt;span style=&#34;color:#f2d5cf&#34;&gt;maildir&lt;/span&gt;&lt;span style=&#34;color:#99d1db;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#ca9ee6&#34;&gt;$(&lt;/span&gt;grep &lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;^Maildir:&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#f2d5cf&#34;&gt;$HOME&lt;/span&gt;/.mblaze/profile | cut -d: -f &lt;span style=&#34;color:#ef9f76&#34;&gt;2&lt;/span&gt; | sed &lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#39;s/ //g&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#ca9ee6&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &lt;span style=&#34;color:#f2d5cf&#34;&gt;profile&lt;/span&gt;&lt;span style=&#34;color:#99d1db;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#ca9ee6&#34;&gt;$(&lt;/span&gt;basename &lt;span style=&#34;color:#f2d5cf&#34;&gt;$maildir&lt;/span&gt;&lt;span style=&#34;color:#ca9ee6&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &lt;span style=&#34;color:#ca9ee6&#34;&gt;if&lt;/span&gt; &lt;span style=&#34;color:#99d1db;font-weight:bold&#34;&gt;[&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#f2d5cf&#34;&gt;$profile&lt;/span&gt;&lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#99d1db;font-weight:bold&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;local&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#99d1db;font-weight:bold&#34;&gt;]&lt;/span&gt;; &lt;span style=&#34;color:#ca9ee6&#34;&gt;then&lt;/span&gt;
@ -192,11 +253,12 @@ Scan-Format: %c%u%r %-3n %10d %17f %t %2i%s
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &lt;span style=&#34;color:#ca9ee6&#34;&gt;else&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; mbsync -V &lt;span style=&#34;color:#f2d5cf&#34;&gt;$profile&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; mlist -s &lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#f2d5cf&#34;&gt;$maildir&lt;/span&gt;&lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;&lt;/span&gt;/INBOX | msort -dr | mseq -S
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; minc &lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#f2d5cf&#34;&gt;$maildir&lt;/span&gt;&lt;span style=&#34;color:#a6d189&#34;&gt;/INBOX&amp;#34;&lt;/span&gt; &amp;gt; /dev/null
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &lt;span style=&#34;color:#ca9ee6&#34;&gt;fi&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#99d1db;font-weight:bold&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#737994;font-style:italic&#34;&gt;# Get full mail for current profile including threads&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;mall &lt;span style=&#34;color:#99d1db;font-weight:bold&#34;&gt;()&lt;/span&gt; &lt;span style=&#34;color:#99d1db;font-weight:bold&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#ca9ee6&#34;&gt;function&lt;/span&gt; mall &lt;span style=&#34;color:#99d1db;font-weight:bold&#34;&gt;()&lt;/span&gt; &lt;span style=&#34;color:#99d1db;font-weight:bold&#34;&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &lt;span style=&#34;color:#f2d5cf&#34;&gt;maildir&lt;/span&gt;&lt;span style=&#34;color:#99d1db;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#ca9ee6&#34;&gt;$(&lt;/span&gt;grep &lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;^Maildir:&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#f2d5cf&#34;&gt;$HOME&lt;/span&gt;/.mblaze/profile | cut -d: -f &lt;span style=&#34;color:#ef9f76&#34;&gt;2&lt;/span&gt; | sed &lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#39;s/ //g&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#ca9ee6&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &lt;span style=&#34;color:#f2d5cf&#34;&gt;sent&lt;/span&gt;&lt;span style=&#34;color:#99d1db;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#ca9ee6&#34;&gt;$(&lt;/span&gt;grep &lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;^Outbox:&amp;#34;&lt;/span&gt; &lt;span style=&#34;color:#f2d5cf&#34;&gt;$HOME&lt;/span&gt;/.mblaze/profile | cut -d: -f &lt;span style=&#34;color:#ef9f76&#34;&gt;2&lt;/span&gt; | sed &lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#39;s/ //g&amp;#39;&lt;/span&gt;&lt;span style=&#34;color:#ca9ee6&#34;&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &lt;span style=&#34;color:#f2d5cf&#34;&gt;profile&lt;/span&gt;&lt;span style=&#34;color:#99d1db;font-weight:bold&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#ca9ee6&#34;&gt;$(&lt;/span&gt;basename &lt;span style=&#34;color:#f2d5cf&#34;&gt;$maildir&lt;/span&gt;&lt;span style=&#34;color:#ca9ee6&#34;&gt;)&lt;/span&gt;
@ -205,6 +267,7 @@ Scan-Format: %c%u%r %-3n %10d %17f %t %2i%s
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &lt;span style=&#34;color:#ca9ee6&#34;&gt;else&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; mbsync -V &lt;span style=&#34;color:#f2d5cf&#34;&gt;$profile&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; mlist &lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#f2d5cf&#34;&gt;$maildir&lt;/span&gt;&lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;&lt;/span&gt;/INBOX | mthread -r -S &lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#f2d5cf&#34;&gt;$sent&lt;/span&gt;&lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;&lt;/span&gt; | mseq -S
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; minc &lt;span style=&#34;color:#a6d189&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span style=&#34;color:#f2d5cf&#34;&gt;$maildir&lt;/span&gt;&lt;span style=&#34;color:#a6d189&#34;&gt;/INBOX&amp;#34;&lt;/span&gt; &amp;gt; /dev/null
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; &lt;span style=&#34;color:#ca9ee6&#34;&gt;fi&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#99d1db;font-weight:bold&#34;&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;For the rest of usage of mblaze, I really recommend to use &lt;code&gt;man mblaze&lt;/code&gt; since the software is really well documented, or you can also watch this &lt;a href=&#34;https://piped.cronyakatsuki.xyz/watch?v=5YS8RPC4zwc&#34;&gt;video&lt;/a&gt; I took the inspiration from for this setup.&lt;/p&gt;

View file

@ -0,0 +1,154 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link href="/css/style.css" rel="stylesheet" />
<title>Using Mblaze</title>
<meta property="og:title" content="Using Mblaze" />
<meta property="og:description" content="So you followed my last tutorial on setting up mblaze and friend&rsquo;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&rsquo;m going to teach you some basic usage that you can have with it.
Helper function&rsquo;s I guess you haven&rsquo;t read my other blog on setting up mblaze and friend&rsquo;s if you need me to type them out here again, so go read it now!" />
<meta property="og:type" content="article" />
<meta property="og:url" content="https://cronyakatsuki.xyz/blog/using-mblaze/" /><meta property="article:section" content="blog" />
<meta property="article:published_time" content="2024-01-07T12:15:21+01:00" />
<meta property="article:modified_time" content="2024-01-07T12:15:21+01:00" /><meta property="og:site_name" content="Crony Akatsuki&#39;s Website" />
</head>
<body>
<header>
<h1>Crony Akatsuki</h1>
<nav>
<span><a href="/">Home</a></span>
<span>|</span>
<span><a href="/about">About</a></span>
<span>|</span>
<span><a href="/blog">Blog</a></span>
<span>|</span>
<span><a href="/services">Services</a></span>
</nav>
</header>
<main>
<div id="content">
<h1>Using Mblaze</h1>
<div id="blog-meta">
<p id="date">07-01-2024</p>
<p>
<span>|</span>
<a href="https://cronyakatsuki.xyz/tags/linux/">linux</a> <span>|</span>
<a href="https://cronyakatsuki.xyz/tags/mblaze/">mblaze</a> <span>|</span>
<a href="https://cronyakatsuki.xyz/tags/mail/">mail</a></p>
<hr>
</div>
<p>So you followed my last tutorial on setting up mblaze and friend&rsquo;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&rsquo;m going to teach you some basic usage that you can have with it.</p>
<h1 id="helper-functions">Helper function&rsquo;s</h1>
<p>I guess you haven&rsquo;t read my other blog on setting up mblaze and friend&rsquo;s if you need me to type them out here again, so go read it now! Here is the <a href="https://cronyakatsuki.xyz/blog/virgin-mutt-user-meet-mblaze/">link</a>.</p>
<h1 id="getting-mail-and-reading-it">Getting mail and reading it</h1>
<p>Now after you have actually read my last blog and got the two function&rsquo;s and the script installed and made them usefull, we can start getting and reading our mail.</p>
<p>First you will choose what mail you wanna manage, or how I call it profile with my script.</p>
<p>After choosing it you will now have to choose if you wan&rsquo;t to see all mail available on the server, or you will be just reading the new mail and based on that run either <code>mall</code> or <code>mnew</code>.</p>
<p>Now we have a couple way&rsquo;s of listing and reading mail.</p>
<p>We can use the command <code>mscan</code> that will show you simple one line summaries of your mail. The mail with <code>.</code> mean their status is undread.</p>
<p>To read a single specific message we can use <code>mshow</code>. By default it will use the mail that when using <code>mscan</code> show&rsquo;s &gt; as <strong>currently choosen</strong> mail. To read another mail you can choose the number of the mail from <code>mscan</code> and use mshow like this <code>mshow N</code> ( N being the number of the mail you wan&rsquo;t to read ).</p>
<p>Now onto my favourite way of reading mail with mblaze, it&rsquo;s <code>mless</code>. 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 <code>:p</code> and <code>:n</code> with p going to preview and n going to next message.</p>
<h1 id="settings-read-status">Settings read status</h1>
<p>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 <code>mflag -S N</code>, 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 <code>mseq -f : | mseq -S</code>.</p>
<p>We can easily alias this sequence of command&rsquo;s into a function to streamline this.</p>
<div class="highlight"><pre tabindex="0" style="color:#c6d0f5;background-color:#303446;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span><span style="color:#ca9ee6">function</span> mread<span style="color:#99d1db;font-weight:bold">()</span> <span style="color:#99d1db;font-weight:bold">{</span>
</span></span><span style="display:flex;"><span> mflag -S <span style="color:#f2d5cf">$1</span>
</span></span><span style="display:flex;"><span> mseq -f : | mseq -S
</span></span><span style="display:flex;"><span><span style="color:#99d1db;font-weight:bold">}</span>
</span></span></code></pre></div><p>You can place this function anywhere in your shell configuration.</p>
<h1 id="sending-mail">Sending mail</h1>
<p>To write mail with mblaze we use command called <code>mcom</code>. After running it, it will a file in your editor of choice that looks like this:</p>
<pre tabindex="0"><code class="language-devbox" data-lang="devbox">To:
Cc:
Bcc:
Subject:
From: John Doe &lt;john@doe.com&gt;
Message-Id: &lt;random-id&gt;
User-Agent: mblaze/...
</code></pre><p>In the <code>To:</code> file you write the name of mail you wan&rsquo;t to send to for example <code>Shit Shittington &lt;shit@shittington.com&gt;</code> and subject to name of the subject like regular mail.</p>
<p>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&rsquo;t to.</p>
<p>If you save the message as draft just run <code>mcom -r</code>. To reply to a message use <code>mrep N</code> to reply to a specific message.</p>
<h1 id="extending-mless-functionalitty">Extending mless functionalitty</h1>
<p>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&rsquo;s to mless.</p>
<p>Save this file to <code>~/.mblaze/mlesskey</code></p>
<pre tabindex="0"><code class="language-lesskey" data-lang="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 \^
</code></pre><p>This will add keybindings like <code>]</code> and <code>[</code> for previous and next mail and <code>d</code> for setting read status on mail. Rest you can checkout yourself by looking at this part of mless script on github, <a href="https://github.com/leahneukirchen/mblaze/blob/master/mless#L92">link</a>.</p>
<h1 id="conclusion">Conclusion</h1>
<p>I guess this is it now, hope this help&rsquo;s you on making your own mail be even more amazing.</p>
</div>
</main>
<footer>
<div id="links">
<span><a href="https://code.cronyakatsuki.xyz">Code</a></span>
<span>|</span>
<span><a href="https://steamcommunity.com/id/CronyAkatsuki/">Steam</a></span>
<span>|</span>
<span><a href="https://osu.ppy.sh/users/18953565">Osu!</a></span>
<span>|</span>
<span><a href="https://anilist.co/user/CronyAkatsuki/">Anilist</a></span>
<span>|</span>
<span><a href="https://youtube.com/channel/UClFdlNlUipHG5Kit8GbFz5Q">Gaming Channel</a></span>
<span>|</span>
<span><a href="https://uptime.cronyakatsuki.xyz/status/public">Services Status</a></span>
<span>|</span>
<span><a href="https://lemmy.cronyakatsuki.xyz/u/crony">Lemmy</a></span>
</div>
<div id="banners">
<a rel="noreferrer" href="/" target="_blank"><img src="/88x31.png"
alt="Me" title="Me" /></a>
<a rel="noreferrer" href="https://kernel.org" target="_blank"><img src="https://cyber.dabamos.de/88x31/linux_powered.gif"
alt="linux kernel" title="Best kernel in the world" /></a>
<a rel="noreferrer" href="https://debian.org" target="_blank"><img src="https://cyber.dabamos.de/88x31/debian.gif"
alt="debian" title="This website run's on debian" /></a>
<a rel="noreferrer" href="https://bitwarden.com" target="_blank"><img src="https://cyber.dabamos.de/88x31/bitwarden.gif"
alt="Bitwarden" title="Bitwarden/Vaultwarden for the win" /></a>
<a rel="noreferrer" target="_blank"><img src="https://cyber.dabamos.de/88x31/free.gif"
alt="foss" title="Foss is the way" /></a>
<a rel="noreferrer" href="https://neovim.io" target="_blank"><img src="/assets/badges/neovim.gif"
alt="Neovim" title="Written in neovim" /></a>
<a rel="noreferrer" href="https://landchad.net" target="_blank"><img src="https://landchad.net/pix/landchad.gif"
alt="LandChad" title="Get A Website!" /></a>
<a rel="noreferrer" href="https://poggerer.xyz" target="_blank"><img src="https://poggerer.xyz/88x31.png"
alt="Tulg" title="Tulg" /></a>
<a rel="noreferrer" href="https://arthurmelton.com" target="_blank"><img src="https://arthurmelton.com/88x31.png"
alt="AMTitan" title="AMTitan" /></a>
<a rel="noreferrer" href="https://aadi.net.in" target="_blank"><img src="https://aadi.net.in/88x31.png"
alt="Aadi" title="Aadi" /></a>
<a rel="noreferrer" href="https://bear.oops.wtf/" target="_blank"><img src="https://bear.oops.wtf/download/88x31.png"
alt="Bear" title="Bear" /></a>
</div>
</footer>
</body>
</html>

View file

@ -42,6 +42,12 @@
<div id="blog-meta">
<p id="date">24-10-2023</p>
<p>
<span>|</span>
<a href="https://cronyakatsuki.xyz/tags/linux/">linux</a> <span>|</span>
<a href="https://cronyakatsuki.xyz/tags/mail/">mail</a> <span>|</span>
<a href="https://cronyakatsuki.xyz/tags/mblaze/">mblaze</a></p>
<hr>
</div>
@ -182,7 +188,7 @@ Scan-Format: %c%u%r %-3n %10d %17f %t %2i%s
<div class="highlight"><pre tabindex="0" style="color:#c6d0f5;background-color:#303446;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span><span style="color:#737994;font-style:italic"># mblaze functions</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#737994;font-style:italic"># Get new mail for current profile</span>
</span></span><span style="display:flex;"><span>mnew <span style="color:#99d1db;font-weight:bold">()</span> <span style="color:#99d1db;font-weight:bold">{</span>
</span></span><span style="display:flex;"><span><span style="color:#ca9ee6">function</span> mnew <span style="color:#99d1db;font-weight:bold">()</span> <span style="color:#99d1db;font-weight:bold">{</span>
</span></span><span style="display:flex;"><span> <span style="color:#f2d5cf">maildir</span><span style="color:#99d1db;font-weight:bold">=</span><span style="color:#ca9ee6">$(</span>grep <span style="color:#a6d189">&#34;^Maildir:&#34;</span> <span style="color:#f2d5cf">$HOME</span>/.mblaze/profile | cut -d: -f <span style="color:#ef9f76">2</span> | sed <span style="color:#a6d189">&#39;s/ //g&#39;</span><span style="color:#ca9ee6">)</span>
</span></span><span style="display:flex;"><span> <span style="color:#f2d5cf">profile</span><span style="color:#99d1db;font-weight:bold">=</span><span style="color:#ca9ee6">$(</span>basename <span style="color:#f2d5cf">$maildir</span><span style="color:#ca9ee6">)</span>
</span></span><span style="display:flex;"><span> <span style="color:#ca9ee6">if</span> <span style="color:#99d1db;font-weight:bold">[</span> <span style="color:#a6d189">&#34;</span><span style="color:#f2d5cf">$profile</span><span style="color:#a6d189">&#34;</span> <span style="color:#99d1db;font-weight:bold">=</span> <span style="color:#a6d189">&#34;local&#34;</span> <span style="color:#99d1db;font-weight:bold">]</span>; <span style="color:#ca9ee6">then</span>
@ -190,11 +196,12 @@ Scan-Format: %c%u%r %-3n %10d %17f %t %2i%s
</span></span><span style="display:flex;"><span> <span style="color:#ca9ee6">else</span>
</span></span><span style="display:flex;"><span> mbsync -V <span style="color:#f2d5cf">$profile</span>
</span></span><span style="display:flex;"><span> mlist -s <span style="color:#a6d189">&#34;</span><span style="color:#f2d5cf">$maildir</span><span style="color:#a6d189">&#34;</span>/INBOX | msort -dr | mseq -S
</span></span><span style="display:flex;"><span> minc <span style="color:#a6d189">&#34;</span><span style="color:#f2d5cf">$maildir</span><span style="color:#a6d189">/INBOX&#34;</span> &gt; /dev/null
</span></span><span style="display:flex;"><span> <span style="color:#ca9ee6">fi</span>
</span></span><span style="display:flex;"><span><span style="color:#99d1db;font-weight:bold">}</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#737994;font-style:italic"># Get full mail for current profile including threads</span>
</span></span><span style="display:flex;"><span>mall <span style="color:#99d1db;font-weight:bold">()</span> <span style="color:#99d1db;font-weight:bold">{</span>
</span></span><span style="display:flex;"><span><span style="color:#ca9ee6">function</span> mall <span style="color:#99d1db;font-weight:bold">()</span> <span style="color:#99d1db;font-weight:bold">{</span>
</span></span><span style="display:flex;"><span> <span style="color:#f2d5cf">maildir</span><span style="color:#99d1db;font-weight:bold">=</span><span style="color:#ca9ee6">$(</span>grep <span style="color:#a6d189">&#34;^Maildir:&#34;</span> <span style="color:#f2d5cf">$HOME</span>/.mblaze/profile | cut -d: -f <span style="color:#ef9f76">2</span> | sed <span style="color:#a6d189">&#39;s/ //g&#39;</span><span style="color:#ca9ee6">)</span>
</span></span><span style="display:flex;"><span> <span style="color:#f2d5cf">sent</span><span style="color:#99d1db;font-weight:bold">=</span><span style="color:#ca9ee6">$(</span>grep <span style="color:#a6d189">&#34;^Outbox:&#34;</span> <span style="color:#f2d5cf">$HOME</span>/.mblaze/profile | cut -d: -f <span style="color:#ef9f76">2</span> | sed <span style="color:#a6d189">&#39;s/ //g&#39;</span><span style="color:#ca9ee6">)</span>
</span></span><span style="display:flex;"><span> <span style="color:#f2d5cf">profile</span><span style="color:#99d1db;font-weight:bold">=</span><span style="color:#ca9ee6">$(</span>basename <span style="color:#f2d5cf">$maildir</span><span style="color:#ca9ee6">)</span>
@ -203,6 +210,7 @@ Scan-Format: %c%u%r %-3n %10d %17f %t %2i%s
</span></span><span style="display:flex;"><span> <span style="color:#ca9ee6">else</span>
</span></span><span style="display:flex;"><span> mbsync -V <span style="color:#f2d5cf">$profile</span>
</span></span><span style="display:flex;"><span> mlist <span style="color:#a6d189">&#34;</span><span style="color:#f2d5cf">$maildir</span><span style="color:#a6d189">&#34;</span>/INBOX | mthread -r -S <span style="color:#a6d189">&#34;</span><span style="color:#f2d5cf">$sent</span><span style="color:#a6d189">&#34;</span> | mseq -S
</span></span><span style="display:flex;"><span> minc <span style="color:#a6d189">&#34;</span><span style="color:#f2d5cf">$maildir</span><span style="color:#a6d189">/INBOX&#34;</span> &gt; /dev/null
</span></span><span style="display:flex;"><span> <span style="color:#ca9ee6">fi</span>
</span></span><span style="display:flex;"><span><span style="color:#99d1db;font-weight:bold">}</span>
</span></span></code></pre></div><p>For the rest of usage of mblaze, I really recommend to use <code>man mblaze</code> since the software is really well documented, or you can also watch this <a href="https://piped.cronyakatsuki.xyz/watch?v=5YS8RPC4zwc">video</a> I took the inspiration from for this setup.</p>