338 lines
21 KiB
Plaintext
338 lines
21 KiB
Plaintext
|
|
Episode: 1727
|
||
|
|
Title: HPR1727: Basic Mutt
|
||
|
|
Source: https://hub.hackerpublicradio.org/ccdn.php?filename=/eps/hpr1727/hpr1727.mp3
|
||
|
|
Transcribed: 2025-10-18 08:18:38
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
This is HPR episode 1,727 entitled Basic Mut.
|
||
|
|
It is hosted by Frank Bell and is about 32 minutes long.
|
||
|
|
The summary is Frank Bell discusses setting up and using mut as an male client.
|
||
|
|
This episode of HPR is brought to you by an honesthost.com.
|
||
|
|
With 15% discount on all shared hosting with the offer code HPR15, that's HPR15.
|
||
|
|
Better web hosting that's honest and fair at an honesthost.com.
|
||
|
|
Hello, this is Frank Bell.
|
||
|
|
I've been away for a while, some circumstances happen that made it a little more difficult
|
||
|
|
for me to record, but mostly I ran out of ideas where I thought I could make a contribution.
|
||
|
|
However, I'm back and I have a couple of ideas.
|
||
|
|
My summer project this summer was to learn how to use mut.
|
||
|
|
I had two reasons for this.
|
||
|
|
I wanted to learn more about how email works under the hood.
|
||
|
|
I had a very accomplished member of a local hosting firm tell me once that in his opinion,
|
||
|
|
handling email is the single most complicated thing on the internet and he had a flowchart
|
||
|
|
to prove it.
|
||
|
|
And I wanted to learn more about how to use the VIM editor.
|
||
|
|
I've struggled long for years being able to use VIM or buy to do things like editmyrc.local
|
||
|
|
file or edit my etc.stab file with knowing just a few of the commands, but I never really
|
||
|
|
felt comfortable with it.
|
||
|
|
And I realized I'm not a coder, so I'm not writing code and stuff like that in a text
|
||
|
|
editor all day.
|
||
|
|
I realized that if I were going to get better at using VIM or VIM and between the two I would
|
||
|
|
certainly recommend use VIM, which stands for VIM improved.
|
||
|
|
I had to put myself into a situation where I would use it regularly and I realized that
|
||
|
|
using it to write and respond to emails was just such a situation.
|
||
|
|
And most command line email programs do not have built in editors.
|
||
|
|
It uses an external editor and I said, aha, if I use MUT, I can force myself to learn
|
||
|
|
more about VIM and get comfortable in it.
|
||
|
|
I chose MUT after extensive research into alternatives such as pine and alpine, the
|
||
|
|
VINNERBLE MAIL program after an intensive three or four minutes of Googling about.
|
||
|
|
I want to say at the outset, I am not a MUT expert.
|
||
|
|
I'm at best, a fairly accomplished somewhere between beginner and intermediate user.
|
||
|
|
I still use a GUI email client on my primary computer, currently CMUNK email, but I've also
|
||
|
|
used over the years opera, Sylphide, and I've tried other Linux email clients such as
|
||
|
|
K-mail and evolution which deserves to have been put out of this misery a long time ago.
|
||
|
|
I'm going to address just basic stuff here.
|
||
|
|
If you are in a complex Linux or Unix postmaster, there is nothing that I can tell you.
|
||
|
|
Go off and record your own podcast for hacker public review.
|
||
|
|
Also, I'm talking about setting up the email for an individual user.
|
||
|
|
So all my configuration files will go into my home directory.
|
||
|
|
I'm not doing anything in forward slash Etsy.
|
||
|
|
And finally, I'm not talking about doing my own mail server.
|
||
|
|
I'm talking about using various Linux Unix programs to send and receive mail to and from
|
||
|
|
my ISP and other internet email providers.
|
||
|
|
For one reason, I don't think I'm hardly ready to try to set up my own mail server.
|
||
|
|
I look at the configuration guides for things like XM, SIN mail, and PostFix and my brain
|
||
|
|
gets numb.
|
||
|
|
For another reason, my ISP bans public facing servers for home, internet accounts, and
|
||
|
|
they enforce this policy aggressively, and I don't need that kind of trouble.
|
||
|
|
Now in order to use MUT to read and write emails, I need other programs.
|
||
|
|
To go to the three letter acronyms that have been around for years and years and years,
|
||
|
|
I need an MTA or MTAs mail transport agent to send and receive the mail.
|
||
|
|
An MTA or mail delivery agent to take the incoming email and put it into mailboxes and
|
||
|
|
an MUA mail user agent, and that would be the program for reading and writing emails
|
||
|
|
in my case MUT.
|
||
|
|
After looking at a number of tutorials, I found a couple which will be linked in the
|
||
|
|
show notes that seemed to me the best of the lot for a beginner such as me.
|
||
|
|
So I used the programs that they used and pretty much copied their guidelines for the configuration.
|
||
|
|
I used fetch mail to get the mail, proc mail, and form mail to process the mail.
|
||
|
|
My understanding is that proc mail processes the mail, and form mail actually puts it
|
||
|
|
in the mailboxes that the two programs work together.
|
||
|
|
MUT as I mentioned is a mail reader and a little program called MSMTP to send the mail.
|
||
|
|
To set this up, I had to create RC files for fetch mail, proc mail, MUT, and MSMTP.
|
||
|
|
When I say create RC files, I mean copy RC files from the tutorials and then tweak them
|
||
|
|
to my text.
|
||
|
|
Here is a meta view.
|
||
|
|
I am not going to go into the syntax of the RC files.
|
||
|
|
There are man pages for each of them, excellent tutorials where you can look at the syntax
|
||
|
|
and my experience as a podcast listener is that listening to people parse code in audio
|
||
|
|
is not really a very good way to learn.
|
||
|
|
Just as an aside, I understand that RC stands for run time configuration.
|
||
|
|
Time the file, the program is run, it looks at the RC file and says, okay, these are my
|
||
|
|
marching orders.
|
||
|
|
I will go do that.
|
||
|
|
If you change the RC file, you have to stop and rerun the program for the changes to
|
||
|
|
take effect.
|
||
|
|
I would also note in the outset that there are two primary mailbox formats in the next
|
||
|
|
world.
|
||
|
|
There is the older up to the inbox format in which the mail is stored in a honking grade
|
||
|
|
spool file and when you look at a particular email, you are looking at one piece of that
|
||
|
|
spool file.
|
||
|
|
Traditionally that spool file is in forward slash bar, forward slash spool, forward slash
|
||
|
|
mail, forward slash username, though you can place it elsewhere if you wish.
|
||
|
|
And then there is the mail der, M-A-I-L-D-I-R for mail directory format in which each individual
|
||
|
|
email is its own little file inside of a mail box.
|
||
|
|
I experimented with both.
|
||
|
|
Even in my limited experience, both of them have some pluses and minuses.
|
||
|
|
If you want to have a mind to start this, I suggest you start with the inbox format simply
|
||
|
|
because it is a little simpler.
|
||
|
|
Also note that in configuring the MUT RSC and the PROC mail RSC, which I will be talking
|
||
|
|
about shortly, there are slight differences depending on which mailbox format you use.
|
||
|
|
You have to tell these programs where the various mailboxes are located and the syntax
|
||
|
|
of the names of the mailboxes will be slightly different based on the format.
|
||
|
|
Okay.
|
||
|
|
Mail, fetch mail is a program to get mail, hence the name.
|
||
|
|
It is very simple to configure.
|
||
|
|
You need to open up your text editor and create a fetch mail RSC.
|
||
|
|
Here is the syntax.
|
||
|
|
The word poll, P-O-L-L, space, the mailbox, pop.somewhere.com, imapp.somewhere.com.
|
||
|
|
You would get that information from your email provider, space, the word protocol, space,
|
||
|
|
and whether it is pop 3 or imapp, user, space, quotation marks, user log on name for that
|
||
|
|
mail server, closed quotation marks, space, password, quotation marks, password for that
|
||
|
|
mail server, closed quotation marks.
|
||
|
|
That is the basic minimal format you would need.
|
||
|
|
If you are using a non-standard port, you have to specify the port number.
|
||
|
|
If you are using TLS or SSL, you need to specify that in this file.
|
||
|
|
The tutorial will show you how to do that.
|
||
|
|
It is really very straightforward.
|
||
|
|
If you have multiple accounts, you can configure your fetch mail to fetch mail from all those
|
||
|
|
accounts, simply by adding a new line for each account.
|
||
|
|
For my experimentation, I have one for my ISP email account and a line for Gmail.
|
||
|
|
You can run fetch mail in several ways.
|
||
|
|
Of course, once you get everything working, you want it automated.
|
||
|
|
You can run it as a daemon.
|
||
|
|
You can run it as a cron job.
|
||
|
|
When you are setting things up, you can run it from the command line, which is very
|
||
|
|
useful for testing.
|
||
|
|
You can create macros.
|
||
|
|
You can create a macro to hit the right combination of keys and run fetch mail from within
|
||
|
|
the money interface.
|
||
|
|
In my case, I chose to run it from the decrelem system monitor, which I quite like.
|
||
|
|
I used it since very early on in my experience with Linux.
|
||
|
|
I like its compactness.
|
||
|
|
I like its skinability.
|
||
|
|
I like its versatility.
|
||
|
|
In decrelem, you would open the configuration screen, go to built-ins, go to mail, and there
|
||
|
|
you would find the place to enter the fetch mail command to go pick up your mail and set
|
||
|
|
the interval.
|
||
|
|
How often do you want it to run?
|
||
|
|
I usually set it.
|
||
|
|
On my primary computers, I'll pick up the mail every 5 or 10 minutes.
|
||
|
|
On secondary computers, I might do it only every half hour.
|
||
|
|
Very straightforward.
|
||
|
|
Fetch mail then passes the name to prop mail.
|
||
|
|
You need a dot prop mail rsc file to tell prop mail how to behave.
|
||
|
|
At the top of the prop mail rsc file, you specify the mail directory format.
|
||
|
|
The mode of logging in the location of the log files and some other housekeeping details
|
||
|
|
and the location of form mail.
|
||
|
|
Then it gets interesting.
|
||
|
|
The rest of the prop mail file, you can use for sorting the mail and you use what prop mail
|
||
|
|
calls recipes.
|
||
|
|
They are actually an implementation of regular expressions.
|
||
|
|
That mail has, according to the man page, an internal implementation of eGrap.
|
||
|
|
If your brain glazes over at using regular expressions as mine does, this is a good way
|
||
|
|
to get an early taste of understanding and using regents.
|
||
|
|
I'm not going to go into the details of the recipes, but I will give you an example
|
||
|
|
of how I use them.
|
||
|
|
I have a mail box for HPR and in prop mail I tell it to take all the mail from the HPR
|
||
|
|
mailing list and put it in this mail box.
|
||
|
|
If you have a Facebook account, you can have a mail box for messages coming from facebook
|
||
|
|
mail.com and facebook.com.
|
||
|
|
You can have prop mail with all the Facebook messages into that mail box where you can
|
||
|
|
delete them unread with minimum of inconvenience.
|
||
|
|
I have two links in the show notes about how to use prop mail.
|
||
|
|
Both of them are old blanks because prop mail is an old.
|
||
|
|
I would say mature program.
|
||
|
|
It works so they don't need to come out with a new version of it every two years.
|
||
|
|
The best one is the one from the umbc.edu website that's University of Maryland.
|
||
|
|
Baltimore County, the fellow who wrote it is no longer at UMBC.
|
||
|
|
He has moved on to do other stuff.
|
||
|
|
But when you read it, you can tell that he clearly knows how to teach.
|
||
|
|
It's easily the most understandable introduction to prop mail and regents that I have found
|
||
|
|
in these several months.
|
||
|
|
I have been working on understanding and improving my usage of mutt and the related programs.
|
||
|
|
So prop mail gets the mail, it sorts it according to the recipes that you give it, hands it
|
||
|
|
the form mail and form mail puts it in the mailbox.
|
||
|
|
You do not need a form mail RSC file, prop mail deals with form mail.
|
||
|
|
Now to send the mail, I mentioned I got a little program called MSMTP.
|
||
|
|
The syntax for that is also very straightforward, as straightforward as for fetch mail.
|
||
|
|
For a particular account, you would have the word account followed by the name of the
|
||
|
|
account.
|
||
|
|
So it might be account, space, Gmail.
|
||
|
|
That's simply a label for convenience.
|
||
|
|
Then you specify the host, host, space, the outgoing email server, smtp.sumware.com, smtp.sumware.net.
|
||
|
|
From space, email address, user space, your user name, and you don't have to use quotation
|
||
|
|
marks in this configuration, your password, space, and then your password, and again you
|
||
|
|
do not need quotation marks.
|
||
|
|
And then other stuff you may have to enter if your smtp server uses non-standard ports
|
||
|
|
you need to enter the ports.
|
||
|
|
You're using TLS or SSL to send mail.
|
||
|
|
You need to enter the information for a TLS or SSL and that will depend on how your recipient
|
||
|
|
wants to see that information.
|
||
|
|
Now here's something that I noticed.
|
||
|
|
When I was first experimenting with this, back in the summer, I could not get MSMTP to send
|
||
|
|
mail to my local ISP that I was connected to.
|
||
|
|
When I remarked out by my user name and password, I was able to send email via my local ISP's
|
||
|
|
smtp server.
|
||
|
|
I asked an accomplished Linux citizen man why this was and he just said Frank, he said they
|
||
|
|
know who you are, just like I know who my users are.
|
||
|
|
However, were I to try to connect to my local ISP from say Philadelphia, I would need
|
||
|
|
to make that the user name and password active again to establish a connection from a different
|
||
|
|
ISP.
|
||
|
|
I just found that rather interesting and kind of twisty because one would expect they
|
||
|
|
would just disregard it if they knew who you were but no, it's through a password error.
|
||
|
|
Now we've got, we're getting the mail, we're putting mail in mailboxes, we're able to
|
||
|
|
send mail, now it's time to look at month.
|
||
|
|
The other RSC files I've talked about have been fairly simple.
|
||
|
|
The MUT RSC file is a beast.
|
||
|
|
Not that it's necessarily complex unless you get into macros and stuff, but it's big.
|
||
|
|
It does a lot of stuff, mine is 140 lines long.
|
||
|
|
Now that does count empty lines and about 40 of those lines are configuration for the
|
||
|
|
colors.
|
||
|
|
In other words, what the interface looks like on the screen, background color, foreground
|
||
|
|
color, so on and so forth.
|
||
|
|
The MUT RSC file tells MUT your email identity, the location and format of your inbox or
|
||
|
|
inboxes, where you want to save drafts, what MUT calls postponed mail, what editor you
|
||
|
|
want to use to edit the emails or compose emails.
|
||
|
|
If you don't specify an editor, it will default to whatever the system default editor is.
|
||
|
|
So in Slackware, it defaults to Vi, because Vi is the system default in Slackware.
|
||
|
|
In Magia, it defaults to VIM, because VIM is the system default in Magia.
|
||
|
|
And the Vi command in Magia is actually alias to VIM, so when you type in VI, VIM starts.
|
||
|
|
So on Magia, I don't have to specify an editor to get VIM, and remember VIM was one of my
|
||
|
|
reasons for doing this in the first place.
|
||
|
|
On Slackware, I do have to specify the VIM editor, otherwise I get Vi.
|
||
|
|
You specify the program for sending the mail, the locations of your address, book, and signature,
|
||
|
|
interface behavior, macros, time date display, and the like, and the colors.
|
||
|
|
What I did was I started with the MUT RSC file from CalMAR, linked in the show notes.
|
||
|
|
That is Charlie, Alpha, Lima, Mike, Alpha, Romeo, Dot, Whiskey, Sierra, forward slash, Mike,
|
||
|
|
uniform, time go, time go.
|
||
|
|
And then I set about tailoring it and tweaking it to meet my taste and do some of the things
|
||
|
|
I picked up on some of the other tutorials, in particular, setting up macros so I could
|
||
|
|
send either from my ISP email account or from my Gmail account.
|
||
|
|
A couple of things about using MUT actually more than a couple.
|
||
|
|
In the primary interface, each email will appear as a line, and you're looking at your
|
||
|
|
inbox, you'll see a line that shows the number of the email, some various indicators such
|
||
|
|
as in, meaning a new email, or meaning when you reply to, and so on, but I generally
|
||
|
|
don't pay much attention to those, the date, the sender, and the subject.
|
||
|
|
You can open the email by hitting the space bar or pressing the inner key, navigating
|
||
|
|
it by using the space bar to move down the minus sign to move up.
|
||
|
|
There is no side bar.
|
||
|
|
There is a package referred to as a patch that you can compile into MUT and they create
|
||
|
|
a side bar.
|
||
|
|
I have not played with that at all.
|
||
|
|
In the default inbox view, the emails are descending from oldest to newest and they are
|
||
|
|
threaded, meaning that a reply to one email will be shown in the expanded view as underneath
|
||
|
|
the email it's replying to.
|
||
|
|
It will not be a separate shown separately at the bottom of the inbox.
|
||
|
|
You can change those preferences in the MUT RC.
|
||
|
|
There is also a context menu for whatever view you're in, whether it's viewing an email,
|
||
|
|
looking at the inbox, the send dialog, that will show the most commonly used commands
|
||
|
|
in that view, as well as a question mark, you hit enter question mark and it will open
|
||
|
|
a text health file which you navigate with the space bar and the minus sign.
|
||
|
|
If you want an address book that you can access through tab completion when you're typing
|
||
|
|
in the email address for a new email, you will need an alias file.
|
||
|
|
You can create that file by using the touch command, you can put it wherever you want,
|
||
|
|
that you need to tell MUT where it is in the MUT RC.
|
||
|
|
Then you can add someone's email address to the alias file from the MUT interface.
|
||
|
|
You can also add that manually in any text editor.
|
||
|
|
If you want a signature file, you put that in a separate signature file, these are commonly
|
||
|
|
hidden files but they don't have to be and tell MUT where that signature file is and
|
||
|
|
then it will automatically append the signature to your email before you send it.
|
||
|
|
The body of an email is technically an attachment to the headers.
|
||
|
|
To view the body in line so you open up the email and you're looking at the sender's name,
|
||
|
|
the address, the subject, the list of whether or not there are any attachments and then
|
||
|
|
you see the text of the email in the MUT RC, you set the all of you setting to text slash
|
||
|
|
HTML.
|
||
|
|
You will see many of the examples of this in the tutorials.
|
||
|
|
Now HTML email, have you ever heard anyone say HTML email is evil?
|
||
|
|
View it in a text email client and you will understand why they say that.
|
||
|
|
A single HTML message may appear to be 10 in the inbox, may appear to be 10, 15, 20,
|
||
|
|
25, 30, 40 threads and if you place the selection key over any of those individual items, you
|
||
|
|
will then hit in there and you will see the same darn email.
|
||
|
|
You will also, unless you do something to prevent it, see the raw HTML is like viewing
|
||
|
|
source on a web page.
|
||
|
|
In order to view the HTML in an HTML format, you need to get a text browser and tell MUT
|
||
|
|
to use that text browser to format the email.
|
||
|
|
These browsers include L-Y-N-X, L-I-N-K-S graphic, E-Links, E-L-I-N-K-S, W-3-M to name
|
||
|
|
several of the ones that I have used.
|
||
|
|
I tend to prefer either links L-I-N-K-S or W-3-M, but they all work quite nicely and the
|
||
|
|
way you tell MUT to use your text browser is through a file called the .mailcat file.
|
||
|
|
Mailcat stands for Metamail Capabilities, not as I initially thought mail capture.
|
||
|
|
MUT does not need to be told to look for the mailcat file, it knows to look for the mailcat
|
||
|
|
file.
|
||
|
|
It's part of a larger package called Metamail.
|
||
|
|
I gather from my reading the other text email clients know to look for.
|
||
|
|
They give you a sample line from the .mailcat file, from my mailcat text-forward slash HTML,
|
||
|
|
semicolon.
|
||
|
|
So it says if it's a text HTML package, then spaces links L-I-N-K-S and that refers to
|
||
|
|
the links browser space, percent S, semicolon, name template, equal percent S, HTML.
|
||
|
|
So if this is an HTML email, look at it with the links browser.
|
||
|
|
There is another format, there is a slightly different line in there, again I'm not going
|
||
|
|
to parse that line, but you get the idea.
|
||
|
|
If you were using W3M, it would say text-forward slash HTML, semicolon space, W3M, and then
|
||
|
|
the rest of the line.
|
||
|
|
In the mailcat, you can also specify handlers for other types of files, such as PDFs,
|
||
|
|
I commonly open PDFs in Ocula, images, and you specify image handler, such as F-E-H.
|
||
|
|
I've used X-V on one of my machines, word processor files, O-D-T-Doc, you can specify
|
||
|
|
LibreOffice or whatever your word processing program is.
|
||
|
|
And once you get used to it, it's very nice and clean.
|
||
|
|
Now opening links in HTML email, you need something else, you need URL view, and that
|
||
|
|
is in fact a program commonly resides in USR bin, and you need a dot URL view to tell
|
||
|
|
URL view how to behave.
|
||
|
|
Now here's the sole line in my URL view file, all caps command, space, name of the browser,
|
||
|
|
you see monkey, I use conqueror, the name of the browser, space, percentage, percent
|
||
|
|
sign, S, and with that enabled, in my, I have a macro, which I shamelessly copy from
|
||
|
|
Kalwar, I hit control B, and it open up a page that displays all the links in the email.
|
||
|
|
Now here's where it gets interesting, it doesn't just show the links that the person
|
||
|
|
who wrote the email wants you to know about it, it shows all the other links, all the
|
||
|
|
tracking links, all the report, whether or not this email was open links, all the
|
||
|
|
all that good, everything on one of them.
|
||
|
|
I have found sometimes when you hit the links in some of the user alerts I get, they don't
|
||
|
|
necessarily open properly, I don't know, and I have it dug down sometimes is because
|
||
|
|
the link is repeated, and there's a malformed link, and then there's a proper link.
|
||
|
|
So, but that's what you need to look at the links, but it really is interesting to look
|
||
|
|
at an email, which in a GUI email client might have two or three visible links, and you
|
||
|
|
open it up using URL view, and you see there are 15 links in there.
|
||
|
|
Another thing I've noted is that the mailboxes must be listed in the MUT RC file.
|
||
|
|
If they exist on the hard drive, but they're not listed in the MUT RC file, you will not
|
||
|
|
be able to easily change from one mailbox to the other using the C for change mailbox
|
||
|
|
command.
|
||
|
|
They also must be listed properly depending on whether you're using MIMBOX or a mail door
|
||
|
|
formats.
|
||
|
|
So, that's a little bit of an introduction to using MUT for your email.
|
||
|
|
If you haven't used a text email client, I would say give it a shot, it's an awful lot
|
||
|
|
of fun making it work, and I think a lot of us who do this sort of stuff, enjoy making
|
||
|
|
stuff work, you also learn an awful lot about how Linux and the internet works, and I
|
||
|
|
will say going back to one of my motivations, I feel I'm a lot more comfortable using
|
||
|
|
them than I was before I started doing this.
|
||
|
|
I do not find them at all, intimidating anymore, I'm still only a beginner, but I'm a comfortable
|
||
|
|
beginner.
|
||
|
|
Thank you very much.
|
||
|
|
Today's show, like all our shows, was contributed by an HPR listener like yourself.
|
||
|
|
If you ever thought of recording a podcast, then click on our contributing to find out
|
||
|
|
how easy it really is.
|
||
|
|
NECA Public Radio was founded by the Digital Dove Pound and the Infonomicon Computer Club,
|
||
|
|
and is part of the binary revolution at binrev.com.
|
||
|
|
If you have comments on today's show, please email the host directly, leave a comment on
|
||
|
|
the website, or record a follow-up episode yourself.
|
||
|
|
On this otherwise status, today's show is released on the Creative Commons' Attribution
|