Solved

Using MUTT to send command line GMAIL email on a MAC

Posted on 2013-12-08
12
1,653 Views
Last Modified: 2014-11-12
I tried to configure the muttrc file using nano in Terminal, and yet I get an error when mutt is starting as follows:

Error in /Users/name/.muttrc, line 1: imap_user: unknown variable
Error in /Users/name/.muttrc, line 2: imap_pass: unknown variable
Error in /Users/name/.muttrc, line 3: smtp_url: unknown variable
Error in /Users/name/.muttrc, line 4: smtp_pass: unknown variable
Error in /Users/name/.muttrc, line 10: header_cache: unknown variable
Error in /Users/name/.muttrc, line 11: message_cachedir: unknown variable
Error in /Users/name/.muttrc, line 12: certificate_file: unknown variable

This is how I configured the muttrc file, yet I get the errors above:

set imap_user = "email@gmail.com"
set imap_pass = "password"
set smtp_url = "smtp://user@smtp.gmail.com:587/"
set smtp_pass = "password"
set from = "emaoil@gmail.com"
set realname = "First Last Name"
set folder = "imaps://imap.gmail.com:993"
set spoolfile = "+INBOX"
set postponed = "+[Gmail]/Drafts"
set header_cache = ~/.mutt/cache/headers
set message_cachedir = ~/.mutt/cache/bodies
set certificate_file = ~/.mutt/certificates
set move = no
0
Comment
Question by:100questions
  • 7
  • 5
12 Comments
 

Author Comment

by:100questions
ID: 39705233
I was unable to solve this, I had to uninstall mutt.
0
 
LVL 76

Expert Comment

by:arnold
ID: 39705407
Have you given up? Or is this still an open question?
0
 

Author Comment

by:100questions
ID: 39705815
If there is a solution, I would like to try it.
0
 
LVL 76

Expert Comment

by:arnold
ID: 39706616
First make sure the mutt you have installed supports imap (mutt -v | grep -i imap)

Second, the configuration file should be separate from your existing one such that to call it up, you would use mutt -F google.muttrc

Third using the above, your settings worked in the mutt version 1.5.20 on a centos box and prompted me for issues relating to the certificates from the referenced location smtp and imap.
0
 

Author Comment

by:100questions
ID: 39706651
Thank you.
How do I open the google.muttrc file ao that I can configure it?
Are you saying thay I should still anticipate problems even if I uae the settings I provided you with with version 1.5.20 in connection with the certificates?
0
 
LVL 76

Accepted Solution

by:
arnold earned 500 total points
ID: 39707451
The file is of your creation, vi, nano, or any other editor
if you are in a graphical environment, you can use any text editor.

I think the issues you faced dealt with conflicting settings which is why I suggested to start a new file for this purpose.
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 

Author Comment

by:100questions
ID: 39707633
I decided to try another installation as follows. Not sure if this is a proper or safe way to install mutt:

sudo port install mutt-devel +compress+date_conditional+debug+deepif+gdbm+headercache+imap+sasl+smtp+ssl+xlabel

Then I configured the muttrc file to work with google mail.

Then I started mutt and I the following showed up.
I am not sure whether to accept these or not.

First page:


This certificate belongs to:
   GeoTrust Global CA
   Unknown
   GeoTrust Inc.
   Unknown
   Unknown

This certificate was issued by:
   Unknown
   Unknown
   Equifax
   Equifax Secure Certificate Authority
   Unknown

This certificate is valid
   from May 21 04:00:00 2002 GMT
     to Aug 21 04:00:00 2018 GMT

Fingerprint: fingerprint was here

Second page:

This certificate belongs to:
   Google Internet Authority G2
   Unknown
   Google Inc
   Unknown
   Unknown

This certificate was issued by:
   GeoTrust Global CA
   Unknown
   GeoTrust Inc.
   Unknown
   Unknown

This certificate is valid
   from Apr  5 15:15:55 2013 GMT
     to Apr  4 15:15:55 2015 GMT

Fingerprint: another fingerprint here

Third page:

This certificate belongs to:
   imap.gmail.com
   Unknown
   Google Inc
   Unknown
   Mountain View

This certificate was issued by:
   Google Internet Authority G2
   Unknown
   Google Inc
   Unknown
   Unknown

This certificate is valid
   from Sep 10 07:59:51 2013 GMT
     to Sep 10 07:59:51 2014 GMT

Fingerprint: another fingerprint here..

Was this a good way to install the development version of mutt?
Also, should I accept these pages?
0
 

Author Comment

by:100questions
ID: 39707723
Mutt seems to be working, however I want to try testing an email so that I don't have to typoe the body of the message in the mutt window.
Also, I wouldn't mind if I could script an email message as well.
0
 
LVL 76

Expert Comment

by:arnold
ID: 39707760
The prompt deals with certificate handling, mutt has an option to not check, but not sure what it is off the top of my head.  Back to your question, it is not an error but an information.  Once you accept the certificate future access attempts will not be there.

I'm sure there is a way to add requisite root/trusted certificates to avoid such future certificate confirming prompts.

You can install a local mail server (I'd recommend postfix as it is simpler to manage/administer).
The difficulty you'll face is that locally generated email using someone else's domain will/could be seen as spam and routed that way.
I.e. Gmail uses DKIM (domain keys).


The example to send an email without using an email client.
echo "To: recipient_address
From: your_own_email
Subject: test

Message body
" |/usr/sbin/sendmail -oi -fyour_own_email -t

Note the reference to sendmail in the example is because it is/was the standard mail server app and is maintained for backwards compatibility I.e. No matter which mail server you choose, it places a link named sendmail that will maintain the functionality.
0
 

Author Comment

by:100questions
ID: 39718688
With postfix can you use your own domain name, how will a rexipient be able fo reply?
0
 
LVL 76

Expert Comment

by:arnold
ID: 39718757
You can configure mutt with whatever address you want.  Note that the recipients to whom you will be sending the email are likely using anti-virus/anti-spam filtering techniques which could include the verification of the "sender" SPF, DomainKeys/DKIM, etc. and could label an email with the sender @gmail.com but the email based on SPF for gmail did not originate from GMAIL approved servers.


Yes, postfix is a full service mail server and can be configured with one or many domains email addresses.
There are many examples of configuring postfix.  Depending on how many of your own domains you have, there are simple to a more involved examples.

one or two, with a few email addresses, you could use the flat files to configure.

If you have more domains/email addresses, you could use mysql as the backend for domain/user management.
...
0
 

Author Closing Comment

by:100questions
ID: 39746714
I installed an new version of mutt.  Perhaps this helped.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

In this article we will discuss some EI Capitan Mail app issues and provide some manual process to resolve them.
Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
This Micro Tutorial will introduce a Google tool, which is a great way to learn more about dimensions in metrics in Google Analytics, even if you use the interface or the API.
This Micro Tutorial demonstrates in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now