One of my favorite programs is mutt. It's of course a terminal email client. Very convenient. It's very minimalist But you can do a whole lot. You can make a lot of customization. I actually have three or four different email accounts linked to it But one of the things that I didn't like by default is that usually you have mutt looking directly at servers on the internet Which means you have to have an internet connection at all times And I actually don't have internet at my own house. I'm actually not at my house right now But I always you know I always sort of want the feeling of being able to access my email wherever I am So one of the great tools you can use to sort of bridge this gap is offline IMAP and another tool called MSMTP So offline IMAP Basically for those of you who don't know right an IMAP server is a server sort of like Gmail or You know most email providers where they keep all of your emails on a server and you can access them from different computers But offline IMAP how it works is basically it makes a copy of all those emails on your own machine So you can access them offline and so that of course is exactly what I wanted So I got that and there's also MSMTP This is sort of the same thing for sending mail. It allows you to send mail from the terminal, which is pretty Convenient as well. So I really don't have to be connected to the internet. I can just use these programs You know to use manage my email offline So in this video, I'm gonna show you how I give you sort of config files to start with and show you how I have Mine set up. It's relatively simple. It took me a long time to actually get this set up just because you know, there are a bunch of little things but You know, I'll make it easy for you. I got a couple of configs here So once you install those, you know, they're gonna be in your Linux repositories or whatever once you install those you want to go the two important files are offline IMAP RC and MS MSMTP RC every time I try and say that like it's so I don't know I have to think about every single letter I'm probably still getting it wrong But anyway, so how do you change these? How do these work? So in the offline IMAP ours? I see let me make this a little bigger. Actually, it looks ugly like that, but whatever so in here You have general settings that you can set for all of your different accounts And then you list all your accounts in the accounts variable thing So you let's say you have a Gmail account you call it Gmail maybe you have a home account or work account and for each of these accounts Offline IMAP is going to look in the rest of the document for them So here I just have a Gmail account as you can see And the first thing you do is you list the local repository and a remote repository And then you give information for both of them. So our remote repository It's already set up for Gmail. All you have to do is change your username and change your password And then it's going to be able to log on For the local repository, you just tell it it's a mail directory And then where on your computer you actually want this email to be saved So I have mine in dot mail slash Gmail So that's pretty much all you have to do In terms of settings of course for different kinds of these are Gmail settings for other kinds of servers You might have to put in different information I might you know, it's in the documentation. I might include that as well But you know be sure to explore the documentation anyway, but if you have a Gmail All you really have to do is replace these So that's offline IMAP and once you do that all you really have to do is run offline IMAP Actually, I think I haven't yeah, I have mine running or Did have it running here So all you have to do is run offline IMAP and it's going to Look at your mail directories online and it's going to start syncing them to your computer Which might take forever If you have you know a whole lot of email for me It doesn't take too long And once the first time it has to download everything but later on it just checks to see if there's new email So go ahead and have that running once you have these settings And the other third thing you want to set up is the ms ms mtp rc Lots of letters there So this is pretty simple as well. You can give it some, you know Default settings up here And then sort of like in the offline IMAP account You give it some kind of you know each of your account some kind of name And then you set some, you know, give it whatever information it needs to know about your server Usually just the host and the port and then your account name and password and that's pretty much it So once you've done that You can actually send emails with ms mtp by the terminal But we actually want to use that with mut So how do we set now that we have both of these set up? How do we interface them with mut? It's pretty simple Let me go to the mut example in here Yeah and gmail rc Okay, so here Normally when you set up mut you have mut looking at imap servers But we want mut to look at the mail directory on our computer So that's why we say the inbox type is mail dear And the folder is the same folder that we set in the offline imap rc And our send mail command is not something, you know, it's not an action on the server. It's actually this You know the ms mtp command With the setting gmail because gmail is the account we want to use Other than that you pretty much just put your Username and password you can use these settings and they're going to work on gmail They only need a little bit of tinkering for any other Email client and that's pretty much it. Um this again as I might have said like this sort of took me a long time to sort of perfect Uh, but once you get that, uh, you have offline email You can you know receive them when you get uh any kind of internet connection Then you can look and respond to them offline and then you know it it just works Um, so the last thing is um, so whenever you run the offline imap command It will try and sync your you know online repository and your mail directory on your you know your drive wherever it is Um, so you might want to have I don't have a systematic way of doing this on my computer um because Uh, you might want to like schedule offline imap to run at a certain time or at a certain frequency I just have a looping script that runs it every minute or so Um, which isn't the best way of doing it. There are ways of actually checking the server first I've just never implemented it So if you can think of a better way to do it or if you find something better Then doing what I have and having it run in tmux Uh, you know in the background feel free to share it, but um, yeah, so this is a great way to get your email You know really have control of your email So I'll put the links to the configs in the description But yeah, that's pretty much it. Hope you learned something. Hope you can go a little further with it. So thanks for watching