{"id":757,"date":"2021-10-26T23:38:22","date_gmt":"2021-10-26T22:38:22","guid":{"rendered":"https:\/\/blog.thomarite.uk\/?p=757"},"modified":"2021-10-26T23:50:13","modified_gmt":"2021-10-26T22:50:13","slug":"muttgmail","status":"publish","type":"post","link":"https:\/\/blog.thomarite.uk\/index.php\/2021\/10\/26\/muttgmail\/","title":{"rendered":"mutt+gmail"},"content":{"rendered":"\n<p>Using mutt for sending emails via my gmail account has been something  I wanted to do for a long time. After my last issue with my laptop, finally  I decided to learn how to do it.<\/p>\n\n\n\n<p>Thanks to these blogs I managed to get it working!!!<\/p>\n\n\n\n<p>For the main setup, this <a href=\"https:\/\/www.makeuseof.com\/install-configure-mutt-with-gmail-on-linux\/\">link<\/a> and <a href=\"https:\/\/mritunjaysharma394.medium.com\/how-to-set-up-mutt-text-based-mail-client-with-gmail-993ae40b0003\">this<\/a>. For overcoming the authentication issue, this <a href=\"https:\/\/unix.stackexchange.com\/questions\/172666\/gmail-blocking-mutt\/194247\">link<\/a>. So you define a new password for an <a href=\"https:\/\/security.google.com\/settings\/security\/apppasswords\">app<\/a> in your google account as I use 2FA.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo aptitude install mutt\n\nmkdir ~\/.mutt\n\nvim ~\/.mutt\/muttrc<\/code><\/pre>\n\n\n\n<p>This is the content of my file:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>set from = \"youremail@gmail.com\"\nset realname = \"Name Surname\"\n\n# IMAP settings\nset imap_user = \"youremail@gmail.com\"\nset imap_pass = \"your_new_app_password\"\n\n# SMTP settings\nset smtp_url = \"smtps:\/\/youremail@smtp.gmail.com\"\nset smtp_pass = \"your_new_app_password\"\n\n# Remote Gmail folders\nset folder = \"imaps:\/\/imap.gmail.com\/\"\nset spoolfile = \"+INBOX\"\nset postponed = \"+&#91;Gmail]\/Drafts\"\nset trash = \"+&#91;Gmail]\/Trash\"\n\n# Composition\nset editor = \"vim\"\nset edit_headers = yes\nset charset = UTF-8<\/code><\/pre>\n\n\n\n<p>This is the error I had before getting the app password:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ echo \"Example mutt+gmail\" | mutt -s \"Testing mutt+gmail\" youremail@gmail.com -a test.txt\nSASL authentication failed\nCould not send the message.\n$ <\/code><\/pre>\n\n\n\n<p>After that. Email sent fine without error and I can see it in my inbox!<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ echo \"Example mutt+gmail v2\" | mutt -s \"Testing mutt+gmail v2\" youremail@gmail.com -a books.ods \n$ <\/code><\/pre>\n\n\n\n<p>The only thing I dont like is I need to have a password in a text file&#8230;.<\/p>\n\n\n\n<p>So let&#8217;s use <a href=\"https:\/\/www.computerhope.com\/unix\/uchmod.htm\">chmod<\/a> so, at least, only me can read the file.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>~\/.mutt$ chmod og-r muttrc\n~\/.mutt$ ls -ltr\ntotal 4\n-rw------- 1 yy yy 687 Oct 26 23:22 muttrc\n~\/.mutt$ <\/code><\/pre>\n\n\n\n<p>Although, Ideally, I would prefer to use a certificate that is only valid for gmail, but I haven&#8217;t been able to find anything related to this.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Using mutt for sending emails via my gmail account has been something I wanted to do for a long time. After my last issue with my laptop, finally I decided to learn how to do it. Thanks to these blogs I managed to get it working!!! For the main setup, this link and this. For &hellip; <a href=\"https:\/\/blog.thomarite.uk\/index.php\/2021\/10\/26\/muttgmail\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;mutt+gmail&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-757","post","type-post","status-publish","format-standard","hentry","category-unix"],"_links":{"self":[{"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/posts\/757","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/comments?post=757"}],"version-history":[{"count":3,"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/posts\/757\/revisions"}],"predecessor-version":[{"id":760,"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/posts\/757\/revisions\/760"}],"wp:attachment":[{"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/media?parent=757"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/categories?post=757"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.thomarite.uk\/index.php\/wp-json\/wp\/v2\/tags?post=757"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}