Saturday, August 22, 2009
An easier way to compose Thunderbird mail from the command line
For sometime, I had wished for an easier way to attach the output of diff to a new Thunderbird mail than the following:
To get over this mess, and sort out my original problem with the attachments, I wrote a small script called tb-compose:
Moreover, if
And if
Makes my life a little easier :-)
diff -u file1 file2 >/tmp/mypatch
- Switch to Thunderbird
- Click the "Write" icon
- Click the "Attach" icon in the compose mail window
- Browse to the file
- Click the "Open" button to finally attach the file
thunderbird
. However, passing the mail parameters like "to", "subject", "attachment", etc. via this command is quite ugly:thunderbird -compose "to='john@example.com',subject='dinner',body='How about dinner tonight?',attachment='file:///tmp/food.doc'"
To get over this mess, and sort out my original problem with the attachments, I wrote a small script called tb-compose:
http://github.com/chaitanyagupta/misc-utils/blob/master/tb-composeExample usage:
tb-compose --to john@example.com --subject dinner --body "How about dinner tonight?" --attachment /tmp/food.doc
Moreover, if
-
is passed as a value for --attachment
, the contents of standard input are attached to the mail.diff -u file1 file2 | tb-compose --attachment -
And if
--attachment-name
is used when stdin is being attached, the given name is used as the name for the attached file.diff -u file1 file2 | tb-compose --attachment - --attachment-name mypatch
Makes my life a little easier :-)
Labels: command-line, thunderbird
Subscribe to Posts [Atom]