 In this video, I'm going to talk about how to configure MUT. MUT is a email client, a terminal-based email client. In fact, you see it right in front of you. And it is one of the most extensible and valuable programs you can learn to use. It takes a little time getting used to, getting everything set up. But it is one of the most effective programs you can manage. All your email, just with your hands on your keyboard, there is nothing more simple. But, well, of course, setting it up isn't always simple. But that's what I want to talk about in this video. I want to talk about how to do the basics of accessing your email, whether you have your own email server or any kind of email account. How do you access that email from MUT? How do you send emails? And how do you actually get into configuring MUT so you can get what you need out of it? So in this video, I'm going to cover just how to actually plug into your email server or email service and look at your mail and send it. So it's simple enough to do. Now, for the example of this video, I've actually created a junk email account at this site, cock.ly. In fact, I'll tell you what the email address is. It is mutt at cock.ly. So that's the email address I'm going to use. Now, the one important thing that you need, I mean, you, of course, need an email address and you need a password that you can access it with. But you have that already. But the one other important thing you need is the server information for email provider. In this case, it's mail.cock.ly. Most email sites, if you just look them up, if you have Gmail or here I've pulled up mail.com, which is just some boomer website, typically they'll list two servers that you need. One is an IMAP server. Now IMAP is basically where your email is stored and you can log into an IMAP server remotely and access that email from any computer. Okay, if you have the proper credentials. So you have an IMAP server, even if you don't know about it, even if you have some email service, you need to find out their IMAP server URL and their SMTP server URL. Now in cock.ly's case, they're both mail.cock.ly. In many cases, one will be IMAP dot whatever and the SMTP will be SMTP dot whatever. But you also need their port numbers as well. These are usually for IMAP, they're usually 993, they're usually for SMTP, they're usually 587. But every once in a while, someone switches it up and does something a little different. But once you have that kind of stuff, you can start setting up mutt and well let's go ahead and do it. So mutt, like most terminal based programs, has of course config files that you can easily change, just text files. And they are located in your, well we'll go ahead and make the directory. So I'm gonna, it's in config and mutt and I'm gonna change directory to there. And mutt will automatically read the file mutrc, that is where your configs are going to be kept. So the first thing I wanna do, let's, well actually I should open up mutt and show you what it does by default. Now I will say I am actually gonna be using NeoMut which has some extra features. I recommend you to use NeoMut. But most of the stuff we'll talk about in this video is not NeoMut specific, it applies to mutt as well. But let's just run the program and see what happens without having put any configs in whatsoever. What happens is that it'll give us this message, home Luke mail does not exist, create it yes or no. I'm gonna say no. So what this is by default is that mutt is looking to this directory mail in your home directory as your mailbox by default. We don't want it to do that. We want it to look at our IMAP server. So how can we tell it to do that? So I've said no to that prompt. I'm not gonna press Q to quit. So let's change that folder and how we do that in mutt.rc is just by saying set folder and then we're gonna provide our IMAP server in here and it has a very specific kind of formatting. We're gonna say IMAPs colon slash slash. Now we're gonna provide our email address which is I said was mutt at cock.ly and that is gonna be at our IMAP server. So that's mail.cock.ly and then you're gonna put in a colon and then you're gonna put in your port. So that's all you have to do for your folder. So notice again what the format of this is IMAPs. You got your port number here. You got your IMAP server here which may not be mail.something. It might be IMAP.something. Whatever your provider has and then your actual email address here. Now the other thing we want to set, actually we can go ahead and run this and see what happens here. So if I run mail, now it's gonna say Var spool mail Luke is not a mailbox and that's because it's looking, so it's now looking to the right place but it's looking for a spool file that is on your local computer and we can easily change that to be whatever our actual remote mail folder is and we can do that by saying set spool file to plus inbox. Now the plus in general is going to mean the folder we have plus this extra, this sub folder of it. So now once we run that, it's actually saying connecting to mail.cock.ly. Now it's prompting me for a password. I'm gonna input my password here. Okay, now it's logging in and you'll see actually my mail for this account has now popped up. It's not very much, this is basically just an email account I just made and sent emails to for illustrations but you can now move around in mud and use it how you need to. So you'll notice that Vim key bindings, J and K go up and down or you can use arrow keys if you want but notice the formatting here. So these are all different emails. Most recent is at the bottom right now. Emails can be tagged with things. So for example, these emails have a little lowercase R. That means that they have been replied to. This uppercase in means it's a new mail that I haven't opened. I can press enter to open a mail up, Q to quit out. I can press R to reply to one. Although we can't really send mail yet because we haven't configured that but so that's how you can basically move around in mud. Now as I said, mine will end up looking like this. I'll tell you some of the changes I make to do this but let's go ahead and set the rest of the mailbox up just to get the basics out of the way, okay? Now as I said, we can't actually send mail yet. So let's think about doing that but also let's think about how, okay so I'm in my inbox now. How do I change to my sent mail or my drafts or my trash or something else? Now I will say if you press question mark at any time it is going to list out all of the bindings you have right now and you can leaf through them by pressing space or minus sign to go back, okay? So you can check those out but all of these commands, you can remap in your mud RC. I'm not gonna talk about all that in this video but you can do it. So one of the bindings is lowercase C and it will say open mailbox, question for list and I can press question and it is listing all of my mailboxes and I actually have none because I have to either manually set these up or I mean the mailboxes would be like inbox or sent or drafts or something like that. So let's go ahead and start manually setting all this stuff up. Additionally, I will say one other problem is if I press R to reply to a mail and I open it up and I'm gonna say, yeah, I'm gonna send a mail here. I type whatever I want. There are other weird things that we haven't set yet. For example, our from address is actually just the name of my user on this computer at this computer. So we can change all of this. I'm just sort of detailing all the things you need to set up but let's go ahead and do it, okay? So I'm gonna say no to postpone and I'm actually gonna quit month, okay? So let's go back to our config file and I'm gonna put in a couple things here. Let's go ahead and put it in our SMTP server. So let's say we wanna send mail. We wanna put in our SMTP URL, okay? So that is going to tell mutt how to actually send mail, okay? So we can say SMTP colon slash slash mutt at cock.ly at mail.cock.ly and our SMTP server is typically our port number is typically 587, okay? 587. So it looks, the formatting is gonna be pretty similar to your IMAPs or your folder. Just with a couple changes, note that this is our SMTP server. In my case, they're exactly the same but as I said, this might be SMTP for your server settings. Our port is different. And additionally, I will just say I've noticed with cock.ly sometimes they have some problems sending encrypted mail. So I just don't put the S here at the end of SMTP. There might be something else that I'm missing here but just notice that usually you're gonna wanna have the S here but you might have to omit it and I will in this case just for our example. So let's set some other stuff as well. So for example, we can set a record variable. This is gonna be where our sent mail is stored as a record. It's basically gonna be our sent mail box. So I'm gonna say sent. So what this means is whenever I send mail, put that mail in the box that is sent. We can also set a trash variable that is where our trashed mail goes. And if you have a trash variable set, whenever you delete mail, it isn't actually totally deleted, it's just sent to this trash mail box. So you can have that or you cannot have that if you want. And also we have a postponed box. You might be able to guess what this is for. This is for drafts. Okay, so I'm basically naming my mail boxes. So this is naming where mud is gonna look for different things. But there's also another command called mail boxes. And this is where we just name mut. We basically just give the names of all of our boxes that we want mut to pay attention to. So I'm gonna say inbox. I'm gonna spell it right. I'm gonna say sent. I'm gonna say trash. I'm gonna say drafts. I'm gonna say junk. And I'm gonna just put some other name. Let's just say other. You can basically just put whatever you want here, okay? So we can have all of those. I'm gonna save this. Let's see. Let me double check and see if there's something I missed. I think we got all we need for right now. So our SMTP URL. Let's just open up mut and see what happens. So I'm gonna open it up again. It's asking me for my password. Okay, so here we are. And let's reply to this mail. Okay, so I'm gonna reply, say subject, and include message and reply. I'm gonna say yes. It's gonna open it up in whatever your default text editor is. So this is my reply. And I'm gonna save that. Oh, I forgot to set my from address. Maybe I should change that. I'm gonna actually exit out. So to change that, you can just say set from. And I'm gonna say mut at cock.ly. And you can also set your real name. And that is the name, your first name, last name that you wanna be identified by. I'm just gonna put mut, muttington or something like that. So now I'm gonna go back and actually send that mail. So I'm gonna put in my password again. Okay, I'm gonna reply to that. Here is reply. Now, so it's sent from muttington. It is going to go to my sent mailbox. And it's being sent to actually the same email address. But I'm gonna press Y to send that message. And it is now connecting to cock.ly. It's now prompting me for my password. I'm gonna put it in. And I'm gonna press enter and it failed. Okay, why did it? Okay, I stopped the video for a second. I thought there was a big problem that had gone wrong. I actually just typed in my password the wrong way. Just to verify that I can sense that I'll reply to this email. So here is a reply. And I haven't changed anything in my mutt rc, I don't think. So looking up mail.cock.ly. Now the internet's just taken forever. So I'm gonna put in my password and authenticating. And okay, it's sent, yes. So yeah, all that was is I typed my password wrong. So let's talk about passwords actually. And I'll leave you, so you're now at a point where you can start messing around with mutt. So you can check the mutt manual. I'm gonna close out of this for a second. You can check the mutt manual for all of the different kind of things you can add. Now I'm gonna provide a, actually, there's two things I wanna do. One, I wanna show you how to change the colors to make it look a little prettier. And I'll show you how I'll start talking about passwords. So first off, mutt prompted me for my passwords every time I needed to use them. I'm pretty sure it actually saves passwords. If you already input some kind of SMTP password, it'll carry that over from the last time you sent mail. But you can set passwords in your mutt RC. So you can say SMTP pass. Now I'm gonna put in my password here. Don't worry, I don't care if you see it. It's a junk email account. So I'm gonna put in my password here. I'm gonna put in my IMAP password as well here. Okay. And these are typically the same thing if you have a normal email account. Okay, I can't type today. So now if I reopen mutt, notice that it is not gonna prompt me for my password because it already has it. And if I send mail, okay, this won't prompt me for a password. Okay, if I send that, yeah, so it authenticates, it works fine. Okay, now in the next video, I'm gonna talk about how to encrypt your passwords so you don't have to have them in plain text. But as I said, I wanna show you how to do the colors thing. Now I've actually provided in the video description, you should check it out. I have provided a nice little file. Let me open it up. It is called colors.mudrc. And this is just a list of color settings to give you an example of the kind of things you can set to get particular colors. So I'm gonna copy this colors file into my mutt config, okay? So now that it is in config slash mutt, what I can do is I can actually call it, I can source it from my mudrc file. So I can say source colors. Is it color or colors? Just color.mudrc. And once I do that, I'm gonna exit my instance of mutt and then reload it. And you'll see that everything has colors now, okay? So these colors are just what I have set in this file here. And of course you can play around with it and change what you want to get things nice and pretty. Now in the next video, as I said, I wanna talk about encrypting passwords. And I also wanna talk about how you can get your mail offline so you don't have to log into your email account all the time, you don't have to be connected to the internet to actually get things done. So I'll talk about that in the next video. But this has been enough for one and I will see you guys next time.