Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I use Gmail and Mac's Mail for emails. It seems that you can use git am only with a terminal's Mail in OS X/Ubuntu.

I apparently need to set up my ~/.mailrc such that

# gmail account
account gmail {
set from="masi.masi@gmail.com (Masi Masi)"
set sendmail="/usr/bin/msmtp"
set message-sendmail-extra-arguments="-a gmail"
}

I run

mail bill.bill@yahoo.com

I get

Unknown command: "account"

How can you use Gmail for Mail such that I get my mails' patches to git am?

share|improve this question

3 Answers 3

up vote 2 down vote accepted

You could use fetchmail to get the emails from your google account into mbox/maildir .

share|improve this answer
    

Reply to the answer:

I found that I need to have the .fetchmailrc such that

set postmaster "masi"
set bouncemail

poll pop.gmail.com proto pop3
     user 'masi.masi@gmail.com' there with password 'secret' is masi here
share|improve this answer

Have you tried having Mail export the messages to an mbox file?

  1. Select the messages in Mail.
  2. File > Save As…
    • Format: Raw Message Source

The result should be an mbox file.


In Mail's help, I found the following under “Backing up your email” (first result when searching for “mbox”):

To create an mbox file with just some of your messages, select the messages, then choose File > Save As. In the Format pop-up menu, choose Raw Message Source, then enter a name and save the file.


There are some reports of the resulting file not being in a true mbox format (there are actually several not-quite compatible mbox formats).

The reported problem was that "From " lines in the content of plain-text messages were not escaped. For such lines my version of Mail writes " From " instead of the more typical ">From ", but they are escaped. In the context of emailed Git patches, this should only be a problem for the commit message, but you might look out for it all the same (no matter which path you take to get your emails into mbox format for git am).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.