How to setup mutt with Yahoo Mail

Hi! I just stumbled upon terminal email clients, and decided to give mutt a go. This is how you setup mutt with Yahoo.

Install mutt

Using your preferred package manager, install the mutt package. I’m on Arch (btw), so for me, that’s pacman:

sudo pacman -S mutt

Configuring mutt

I followed the steps from this forum post:

1. Create the config directories and files:

mkdir -p ~/.mutt/cache/headers
mkdir ~/.mutt/cache/bodies
touch ~/.mutt/certificates
touch ~/.mutt/muttrc

Note: the -p on mkdir is a flag to create missing parent directories. So the first command will create ~/.mutt/ and ~/.mutt/cache if they don’t exist, before attempting to create ~/.mutt/cache/headers.

2. Create a Yahoo app password

Yahoo won’t let you sign in from any app without an “app password”. The idea is that your main Yahoo password is restricted to the web client only. Open up the Security page in your Yahoo Account preferences – link.

Scroll to “How you sign in to Yahoo”, which should have a panel for “Other ways to sign in” with “App Password” underneath. Click on “Generate and manage app passwords”, enter a name for the app (it doesn’t matter what you write here, I used “mutt laptop” so I can differentiate between apps easily). When you enter the name, the password will appear. Write that down somewhere, because you won’t get to see it again otherwise.

3. Configuration file

Open ~/.mutt/muttrc with your preferred text editor (nvim of course) and use the following template:

# Yahoo settings
set imap_user = "username@yahoo.com"
set imap_pass = "password"
set smtp_url = "smtp://$imap_user:$imap_pass@smtp.mail.yahoo.com:587"
set smtp_pass = "password"
set from = "username@yahoo.com"
set realname = "Your real name"
set folder = "imaps://imap.mail.yahoo.com:993"
set spoolfile = "+INBOX"
set postponed="+[Yahoo]/Drafts"
set header_cache=~/.mutt/cache/headers
set message_cachedir=~/.mutt/cache/bodies
set certificate_file=~/.mutt/certificates
set move = no
set sort = 'threads'
set sort_aux = 'last-date-received'
set imap_check_subscribed

# Some tweaks
set ssl_starttls = yes
set imap_keepalive = 300
set mail_check = 90
set timeout = 15
set charset = iso-8859-1

4. Replace placeholders

  • On the bits where it says username in the values (e.g. username@yahoo.com), put your login, so essentially write your email address.
  • Don’t forget to replace “Your real name” with whatever you wish to show up as the sender when sending mail. For the webmail client, this is whatever name you’ve configured in your Yahoo account.
  • On the bits where it says password, use the App Password we generated above.

VoilĂ !

You should be all set. Run mutt in your terminal to see if it worked. Hopefully you get to see your inbox! (I have some Cyrillic emails which show up as ?)

An issue I encountered

It’s a good client, but it + kitty (my terminal emulator) do not seem to pair well. Let’s look at an email with links:

This image has an empty alt attribute; its file name is image-1-1024x431.png

Yeah, not pretty. If you’re looking for a solution for that, this blog seems to have fixed it, but I haven’t tested it. Happy mutt-ing!

Welcome to whatever this is!

Hi, dear reader! Welcome to my website, I guess. I hadn’t ever planned on writing a blog (it’s 2024, I’m Gen Z, sue me), but I realised occasionally I have thoughts that I find cool, but don’t have anyone to talk about with. So this is where they’re going now!

A bit about myself: I’m a self-taught programmer from Bulgaria, I love tinkering around with systems and stuff that’s more “behind the scenes”. I’ve been coding since around 8 years old and have gained quite a lot of weird and quirky bits of knowledges from random areas in development that have piqued my interest as I grew older. I really like roleplay games (not the DnD style, but actual real world roleplaying) and I sometimes journal.

I don’t have any plans for this. No set interval between posts, nothing. Some may be in Bulgarian, who knows: I get a spot on the Internet to dump my ridicolousness in now, and that’s all that matters to me!