Bzr Send with Gmail
It would be nice if it was possible to 'bzr send' and have a gmail compose window pop up in firefox complete with an attachment and subject. However, there is no easy way to automatically add an attachment to a gmail message from the command line. Instead, with the SMTP gmail backend, we can achieve almost the same thing.
There are a couple of ways to do this; the first way is the simplest, but requires storing your gmail password in plaintext, or typing it every time. The second is slightly harder to setup and only works on gnome, but will store your gmail password in the gnome keyring.
bzr send via editor and gmail
Edit bazaar.conf, set up SMTP and set the mail client to editor
mail_client = editor smtp_server = smtp.gmail.com smtp_username = firstname.lastname@example.org
This way you will be prompted to type in your password at each send. If you don't mind storing your password in plaintext, you can also add
smtp_password = my_fancy_password123
so you you don't have to type your password in every time.
Then you should be able to send via bzr send; it will invoke your editor of choice and allow you to type in a message before it is sent.
bzr send via mutt and gmail
With the following method, you avoid typing your password every time, and also get to use Mutt. Mutt is a far more capable MUA than the simple editor interface, while being just as quick.
Get a copy of gsendmail: bzr branch http://bazaar.launchpad.net/~mierle/gsendmail/trunk gsendmail
Run gsendmail.py --setup and enter your gmail user and password. They will be stored in the gnome keyring.
Add set sendmail="~/path/to/gsendmail" to your ~/.muttrc.
Download and apply this bundle to your local bzr. It adds support for mutt. It may be merged by the time you read this.
Edit ~/.bazaar/bazaar.conf and add mail_client = mutt under DEFAULT.
You should now be able to hack away, run bzr send --email@example.com
Suggested .muttrc additions
The following make the process of sending mail via mutt faster, because it avoids prompting you.
# Most important line: (correct it to wherever gsend.py is on your machine) set sendmail="~/wrk/gsend/gsendmail.py" # These make the process of sending much faster (no prompting) set autoedit set edit_headers set confirmcreate=no # Add a From: header. This is editable per-message via edit_headrs set use_from set from="\"John Doe\" <firstname.lastname@example.org>" # For vimmers: This puts the cursor on line 5 (Subject:) and starts insert. # Depending on your mutt setup, you may have to change the 5 to something else set editor="vim +5 +startinsert!"
If you have any problems, mail me; my gmail is my last name (mierle).