vmail 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. data/.gitignore +3 -0
  2. data/NOTES +7 -2
  3. data/README.markdown +310 -72
  4. data/lib/vmail.rb +8 -0
  5. data/lib/vmail.vim +53 -21
  6. data/lib/vmail/imap_client.rb +19 -4
  7. data/lib/vmail/message_formatter.rb +32 -11
  8. data/lib/vmail/options.rb +14 -13
  9. data/lib/vmail/version.rb +1 -1
  10. data/test/fixtures/rfc_part.eml +306 -0
  11. data/test/message_formatter_test.rb +12 -1
  12. data/vmail.gemspec +3 -3
  13. data/website/.gitignore +1 -0
  14. data/website/bottom.markdown +20 -0
  15. data/website/gen.rb +22 -0
  16. data/website/images-vmail/1-small.png +0 -0
  17. data/website/images-vmail/1.png +0 -0
  18. data/website/images-vmail/attach-small.png +0 -0
  19. data/website/images-vmail/attach.png +0 -0
  20. data/website/images-vmail/autocomplete-small.png +0 -0
  21. data/website/images-vmail/autocomplete.png +0 -0
  22. data/website/lightbox2/css/lightbox.css +27 -0
  23. data/website/lightbox2/images/bullet.gif +0 -0
  24. data/website/lightbox2/images/close.gif +0 -0
  25. data/website/lightbox2/images/closelabel.gif +0 -0
  26. data/website/lightbox2/images/donate-button.gif +0 -0
  27. data/website/lightbox2/images/download-icon.gif +0 -0
  28. data/website/lightbox2/images/image-1.jpg +0 -0
  29. data/website/lightbox2/images/loading.gif +0 -0
  30. data/website/lightbox2/images/nextlabel.gif +0 -0
  31. data/website/lightbox2/images/prevlabel.gif +0 -0
  32. data/website/lightbox2/images/thumb-1.jpg +0 -0
  33. data/website/lightbox2/index.html +63 -0
  34. data/website/lightbox2/js/builder.js +136 -0
  35. data/website/lightbox2/js/effects.js +1122 -0
  36. data/website/lightbox2/js/lightbox.js +498 -0
  37. data/website/lightbox2/js/prototype.js +4221 -0
  38. data/website/lightbox2/js/scriptaculous.js +58 -0
  39. data/website/stylesheets-vmail/960.css +1 -0
  40. data/website/stylesheets-vmail/reset.css +1 -0
  41. data/website/stylesheets-vmail/site.css +59 -0
  42. data/website/stylesheets-vmail/syntax-colors.css +33 -0
  43. data/website/stylesheets-vmail/text.css +1 -0
  44. data/website/top.markdown +9 -0
  45. data/website/vmail-template.html +50 -0
  46. data/website/vmail.html +438 -0
  47. metadata +48 -10
  48. data/gmail.vim +0 -180
  49. data/wrapper.rb +0 -8
@@ -0,0 +1,58 @@
1
+ // script.aculo.us scriptaculous.js v1.8.1, Thu Jan 03 22:07:12 -0500 2008
2
+
3
+ // Copyright (c) 2005-2007 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
4
+ //
5
+ // Permission is hereby granted, free of charge, to any person obtaining
6
+ // a copy of this software and associated documentation files (the
7
+ // "Software"), to deal in the Software without restriction, including
8
+ // without limitation the rights to use, copy, modify, merge, publish,
9
+ // distribute, sublicense, and/or sell copies of the Software, and to
10
+ // permit persons to whom the Software is furnished to do so, subject to
11
+ // the following conditions:
12
+ //
13
+ // The above copyright notice and this permission notice shall be
14
+ // included in all copies or substantial portions of the Software.
15
+ //
16
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23
+ //
24
+ // For details, see the script.aculo.us web site: http://script.aculo.us/
25
+
26
+ var Scriptaculous = {
27
+ Version: '1.8.1',
28
+ require: function(libraryName) {
29
+ // inserting via DOM fails in Safari 2.0, so brute force approach
30
+ document.write('<script type="text/javascript" src="'+libraryName+'"><\/script>');
31
+ },
32
+ REQUIRED_PROTOTYPE: '1.6.0',
33
+ load: function() {
34
+ function convertVersionString(versionString){
35
+ var r = versionString.split('.');
36
+ return parseInt(r[0])*100000 + parseInt(r[1])*1000 + parseInt(r[2]);
37
+ }
38
+
39
+ if((typeof Prototype=='undefined') ||
40
+ (typeof Element == 'undefined') ||
41
+ (typeof Element.Methods=='undefined') ||
42
+ (convertVersionString(Prototype.Version) <
43
+ convertVersionString(Scriptaculous.REQUIRED_PROTOTYPE)))
44
+ throw("script.aculo.us requires the Prototype JavaScript framework >= " +
45
+ Scriptaculous.REQUIRED_PROTOTYPE);
46
+
47
+ $A(document.getElementsByTagName("script")).findAll( function(s) {
48
+ return (s.src && s.src.match(/scriptaculous\.js(\?.*)?$/))
49
+ }).each( function(s) {
50
+ var path = s.src.replace(/scriptaculous\.js(\?.*)?$/,'');
51
+ var includes = s.src.match(/\?.*load=([a-z,]*)/);
52
+ (includes ? includes[1] : 'builder,effects,dragdrop,controls,slider,sound').split(',').each(
53
+ function(include) { Scriptaculous.require(path+include+'.js') });
54
+ });
55
+ }
56
+ }
57
+
58
+ Scriptaculous.load();
@@ -0,0 +1 @@
1
+ .container_12,.container_16{margin-left:auto;margin-right:auto;width:960px}.grid_1,.grid_2,.grid_3,.grid_4,.grid_5,.grid_6,.grid_7,.grid_8,.grid_9,.grid_10,.grid_11,.grid_12,.grid_13,.grid_14,.grid_15,.grid_16{display:inline;float:left;position:relative;margin-left:10px;margin-right:10px}.container_12 .grid_3,.container_16 .grid_4{width:220px}.container_12 .grid_6,.container_16 .grid_8{width:460px}.container_12 .grid_9,.container_16 .grid_12{width:700px}.container_12 .grid_12,.container_16 .grid_16{width:940px}.alpha{margin-left:0}.omega{margin-right:0}.container_12 .grid_1{width:60px}.container_12 .grid_2{width:140px}.container_12 .grid_4{width:300px}.container_12 .grid_5{width:380px}.container_12 .grid_7{width:540px}.container_12 .grid_8{width:620px}.container_12 .grid_10{width:780px}.container_12 .grid_11{width:860px}.container_16 .grid_1{width:40px}.container_16 .grid_2{width:100px}.container_16 .grid_3{width:160px}.container_16 .grid_5{width:280px}.container_16 .grid_6{width:340px}.container_16 .grid_7{width:400px}.container_16 .grid_9{width:520px}.container_16 .grid_10{width:580px}.container_16 .grid_11{width:640px}.container_16 .grid_13{width:760px}.container_16 .grid_14{width:820px}.container_16 .grid_15{width:880px}.container_12 .prefix_3,.container_16 .prefix_4{padding-left:240px}.container_12 .prefix_6,.container_16 .prefix_8{padding-left:480px}.container_12 .prefix_9,.container_16 .prefix_12{padding-left:720px}.container_12 .prefix_1{padding-left:80px}.container_12 .prefix_2{padding-left:160px}.container_12 .prefix_4{padding-left:320px}.container_12 .prefix_5{padding-left:400px}.container_12 .prefix_7{padding-left:560px}.container_12 .prefix_8{padding-left:640px}.container_12 .prefix_10{padding-left:800px}.container_12 .prefix_11{padding-left:880px}.container_16 .prefix_1{padding-left:60px}.container_16 .prefix_2{padding-left:120px}.container_16 .prefix_3{padding-left:180px}.container_16 .prefix_5{padding-left:300px}.container_16 .prefix_6{padding-left:360px}.container_16 .prefix_7{padding-left:420px}.container_16 .prefix_9{padding-left:540px}.container_16 .prefix_10{padding-left:600px}.container_16 .prefix_11{padding-left:660px}.container_16 .prefix_13{padding-left:780px}.container_16 .prefix_14{padding-left:840px}.container_16 .prefix_15{padding-left:900px}.container_12 .suffix_3,.container_16 .suffix_4{padding-right:240px}.container_12 .suffix_6,.container_16 .suffix_8{padding-right:480px}.container_12 .suffix_9,.container_16 .suffix_12{padding-right:720px}.container_12 .suffix_1{padding-right:80px}.container_12 .suffix_2{padding-right:160px}.container_12 .suffix_4{padding-right:320px}.container_12 .suffix_5{padding-right:400px}.container_12 .suffix_7{padding-right:560px}.container_12 .suffix_8{padding-right:640px}.container_12 .suffix_10{padding-right:800px}.container_12 .suffix_11{padding-right:880px}.container_16 .suffix_1{padding-right:60px}.container_16 .suffix_2{padding-right:120px}.container_16 .suffix_3{padding-right:180px}.container_16 .suffix_5{padding-right:300px}.container_16 .suffix_6{padding-right:360px}.container_16 .suffix_7{padding-right:420px}.container_16 .suffix_9{padding-right:540px}.container_16 .suffix_10{padding-right:600px}.container_16 .suffix_11{padding-right:660px}.container_16 .suffix_13{padding-right:780px}.container_16 .suffix_14{padding-right:840px}.container_16 .suffix_15{padding-right:900px}.container_12 .push_3,.container_16 .push_4{left:240px}.container_12 .push_6,.container_16 .push_8{left:480px}.container_12 .push_9,.container_16 .push_12{left:720px}.container_12 .push_1{left:80px}.container_12 .push_2{left:160px}.container_12 .push_4{left:320px}.container_12 .push_5{left:400px}.container_12 .push_7{left:560px}.container_12 .push_8{left:640px}.container_12 .push_10{left:800px}.container_12 .push_11{left:880px}.container_16 .push_1{left:60px}.container_16 .push_2{left:120px}.container_16 .push_3{left:180px}.container_16 .push_5{left:300px}.container_16 .push_6{left:360px}.container_16 .push_7{left:420px}.container_16 .push_9{left:540px}.container_16 .push_10{left:600px}.container_16 .push_11{left:660px}.container_16 .push_13{left:780px}.container_16 .push_14{left:840px}.container_16 .push_15{left:900px}.container_12 .pull_3,.container_16 .pull_4{left:-240px}.container_12 .pull_6,.container_16 .pull_8{left:-480px}.container_12 .pull_9,.container_16 .pull_12{left:-720px}.container_12 .pull_1{left:-80px}.container_12 .pull_2{left:-160px}.container_12 .pull_4{left:-320px}.container_12 .pull_5{left:-400px}.container_12 .pull_7{left:-560px}.container_12 .pull_8{left:-640px}.container_12 .pull_10{left:-800px}.container_12 .pull_11{left:-880px}.container_16 .pull_1{left:-60px}.container_16 .pull_2{left:-120px}.container_16 .pull_3{left:-180px}.container_16 .pull_5{left:-300px}.container_16 .pull_6{left:-360px}.container_16 .pull_7{left:-420px}.container_16 .pull_9{left:-540px}.container_16 .pull_10{left:-600px}.container_16 .pull_11{left:-660px}.container_16 .pull_13{left:-780px}.container_16 .pull_14{left:-840px}.container_16 .pull_15{left:-900px}.clear{clear:both;display:block;overflow:hidden;visibility:hidden;width:0;height:0}.clearfix:after{clear:both;content:' ';display:block;font-size:0;line-height:0;visibility:hidden;width:0;height:0}* html .clearfix{height:1%}
@@ -0,0 +1 @@
1
+ html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,font,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td{margin:0;padding:0;border:0;outline:0;font-size:100%;vertical-align:baseline;background:transparent}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:'';content:none}:focus{outline:0}ins{text-decoration:none}del{text-decoration:line-through}table{border-collapse:collapse;border-spacing:0}
@@ -0,0 +1,59 @@
1
+ body {
2
+ -moz-background-clip:border;
3
+ -moz-background-inline-policy:continuous;
4
+ -moz-background-origin:padding;
5
+ border-top:5px solid #000000;
6
+ padding:20px 0;
7
+ font-family: Verdana, Arial, sans;
8
+ font-size: 14px;
9
+ }
10
+ #main {
11
+ padding-bottom: 40px;
12
+ }
13
+ hr {
14
+ margin-top: 28px;
15
+ }
16
+ p {
17
+ }
18
+ img.screenshot {
19
+ margin-bottom: 20px;
20
+ width: 260px;
21
+ }
22
+ .sidebar {
23
+ width: 100%;
24
+ padding: 0 10px;
25
+ }
26
+ .sidebar h4 {
27
+ font-size: 16px;
28
+ margin-bottom: 0.75em;
29
+ clear:left;
30
+ margin-top: 1.25em;
31
+ }
32
+ .sidebar ul {
33
+ list-style: none;
34
+ margin-left: 0;
35
+ }
36
+ .sidebar ul li {
37
+ margin-left: 0;
38
+ font-weight: bold;
39
+ }
40
+ table.pin td {
41
+ vertical-align: top;
42
+ padding-bottom: 10px;
43
+ }
44
+ .red { color: red; font-weight:bold }
45
+ .green {color:green; font-weight:bold}
46
+ .purple {color:purple; font-weight:bold}
47
+ .blue {color:blue; font-weight:bold}
48
+
49
+ #main img {
50
+ width: 250px;
51
+ }
52
+ pre {
53
+ background-color: #ECECEC;
54
+ }
55
+ code {
56
+ background-color: #ECECEC;
57
+ font-size: 15px;
58
+ }
59
+
@@ -0,0 +1,33 @@
1
+ pre {
2
+ background-color: #f1f1f3;
3
+ color: #112;
4
+ padding: 10px;
5
+ font-size: 13px;
6
+ overflow: auto;
7
+ margin: 4px 0px;
8
+ width: 97%;
9
+ overflow-x: auto;
10
+ overflow-y: hidden;
11
+ margin-top: 12px;
12
+ }
13
+
14
+
15
+ /* Syntax highlighting */
16
+ pre .normal {}
17
+ pre .comment { color: #005; font-style: italic; }
18
+ pre .keyword { color: #A00; font-weight: bold; }
19
+ pre .method { color: #077; }
20
+ pre .class { color: #074; }
21
+ pre .module { color: #050; }
22
+ pre .punct { color: #447; font-weight: bold; }
23
+ pre .symbol { color: #099; }
24
+ pre .string { color: #944; background: #FFE; }
25
+ pre .char { color: #F07; }
26
+ pre .ident { color: #004; }
27
+ pre .constant { color: #07F; }
28
+ pre .regex { color: #B66; background: #FEF; }
29
+ pre .number { color: #F99; }
30
+ pre .attribute { color: #5bb; }
31
+ pre .global { color: #7FB; }
32
+ pre .expr { color: #227; }
33
+ pre .escape { color: #277; }
@@ -0,0 +1 @@
1
+ body{font:13px/1.5 'Helvetica Neue',Arial,'Liberation Sans',FreeSans,sans-serif}a:focus{outline:1px dotted}hr{border:0 #ccc solid;border-top-width:1px;clear:both;height:0}h1{font-size:25px}h2{font-size:23px}h3{font-size:21px}h4{font-size:19px}h5{font-size:17px}h6{font-size:15px}ol{list-style:decimal}ul{list-style:disc}li{margin-left:30px}p,dl,hr,h1,h2,h3,h4,h5,h6,ol,ul,pre,table,address,fieldset{margin-bottom:20px}
@@ -0,0 +1,9 @@
1
+ # vmail
2
+
3
+ vmail is a Vim interface to Gmail. Here are some screenshots:
4
+
5
+ <a href="images-vmail/1.png" rel="lightbox[screens]"><img src="images-vmail/1-small.png" /></a>
6
+ <a href="images-vmail/autocomplete.png" rel="lightbox[screens]"><img src="images-vmail/autocomplete-small.png" /></a>
7
+ <a href="images-vmail/attach.png" rel="lightbox[screens]"><img src="images-vmail/attach-small.png" /></a>
8
+
9
+
@@ -0,0 +1,50 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta http-equiv="content-type" content="text/html; charset=utf-8" />
5
+ <title>Vmail</title>
6
+ <link href="stylesheets-vmail/reset.css?{{timestamp}}" media="screen" rel="stylesheet" type="text/css" />
7
+ <link href="stylesheets-vmail/960.css?{{timestamp}}" media="screen" rel="stylesheet" type="text/css" />
8
+ <link href="stylesheets-vmail/text.css?{{timestamp}}" media="screen" rel="stylesheet" type="text/css" />
9
+ <link href="stylesheets-vmail/site.css?{{timestamp}}" media="screen" rel="stylesheet" type="text/css" />
10
+ <script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script><script type="text/javascript">stLight.options({publisher:'8579b5f8-0860-4ea6-9ef1-6f0f58359a99'});</script>
11
+ <script type="text/javascript" src="lightbox2/js/prototype.js"></script>
12
+ <script type="text/javascript" src="lightbox2/js/scriptaculous.js?load=effects,builder"></script>
13
+ <script type="text/javascript" src="lightbox2/js/lightbox.js"></script>
14
+ <link rel="stylesheet" href="lightbox2/css/lightbox.css" type="text/css" media="screen" />
15
+
16
+ </head>
17
+ <body>
18
+ <div class="container_12">
19
+ <div class="grid_10 alpha" id="main">
20
+ {{content}}
21
+ </div>
22
+ <div class="grid_2 omega">
23
+
24
+ <div class="sidebar">
25
+
26
+ <h4>share this</h4>
27
+
28
+ <span class="st_twitter_large" displayText="Tweet"></span><span class="st_facebook_large" displayText="Facebook"></span><span class="st_ybuzz_large" displayText="Yahoo! Buzz"></span><span class="st_gbuzz_large" displayText="Google Buzz"></span><span class="st_email_large" displayText="Email"></span><span class="st_sharethis_large" displayText="ShareThis"></span>
29
+
30
+ <h4>links</h4>
31
+ <ul>
32
+ <li><a href="https://github.com/danchoi/vmail">github repo</a></li>
33
+ <li><a href="https://rubygems.org/gems/vmail">rubygems page</a></li>
34
+ </ul>
35
+ </div>
36
+
37
+ </div>
38
+ </div>
39
+
40
+ <script type="text/javascript">
41
+ var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
42
+ document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
43
+ </script>
44
+ <script type="text/javascript">
45
+ var pageTracker = _gat._getTracker("UA-4028996-5");
46
+ pageTracker._initData();
47
+ pageTracker._trackPageview();
48
+ </script>
49
+ </body>
50
+ </html>
@@ -0,0 +1,438 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta http-equiv="content-type" content="text/html; charset=utf-8" />
5
+ <title>Vmail</title>
6
+ <link href="stylesheets-vmail/reset.css?1292349581" media="screen" rel="stylesheet" type="text/css" />
7
+ <link href="stylesheets-vmail/960.css?1292349581" media="screen" rel="stylesheet" type="text/css" />
8
+ <link href="stylesheets-vmail/text.css?1292349581" media="screen" rel="stylesheet" type="text/css" />
9
+ <link href="stylesheets-vmail/site.css?1292349581" media="screen" rel="stylesheet" type="text/css" />
10
+ <script type="text/javascript" src="http://w.sharethis.com/button/buttons.js"></script><script type="text/javascript">stLight.options({publisher:'8579b5f8-0860-4ea6-9ef1-6f0f58359a99'});</script>
11
+ <script type="text/javascript" src="lightbox2/js/prototype.js"></script>
12
+ <script type="text/javascript" src="lightbox2/js/scriptaculous.js?load=effects,builder"></script>
13
+ <script type="text/javascript" src="lightbox2/js/lightbox.js"></script>
14
+ <link rel="stylesheet" href="lightbox2/css/lightbox.css" type="text/css" media="screen" />
15
+
16
+ </head>
17
+ <body>
18
+ <div class="container_12">
19
+ <div class="grid_10 alpha" id="main">
20
+ <h1>vmail</h1>
21
+
22
+ <p>vmail is a Vim interface to Gmail. Here are some screenshots:</p>
23
+
24
+ <p><a href="images-vmail/1.png" rel="lightbox[screens]"><img src="images-vmail/1-small.png" /></a>
25
+ <a href="images-vmail/autocomplete.png" rel="lightbox[screens]"><img src="images-vmail/autocomplete-small.png" /></a>
26
+ <a href="images-vmail/attach.png" rel="lightbox[screens]"><img src="images-vmail/attach-small.png" /></a></p>
27
+
28
+
29
+ <p>Why vmail? Because every minute you spend fumbling around in a web browser is a
30
+ minute you're not experiencing the Zen of using a real text editor and staying
31
+ close to the Unix command line.</p>
32
+
33
+ <h2>Prerequisites</h2>
34
+
35
+ <ul>
36
+ <li>a Gmail account</li>
37
+ <li>a relatively recent version of Vim (vmail is developed against Vim 7.3)</li>
38
+ <li>Ruby (vmail is developed using Ruby 1.9.2)</li>
39
+ <li>RubyGems (if Ruby version is older than 1.9)</li>
40
+ <li>the <code>lynx</code> text-only-mode web browser is required to view HTML mail parts in vmail</li>
41
+ </ul>
42
+
43
+
44
+ <p>The current version of vmail assumes a Unix environment. I'll try to make later versions accommodate Windows.</p>
45
+
46
+ <h2>Installation</h2>
47
+
48
+ <pre><code>gem install vmail
49
+ </code></pre>
50
+
51
+ <h2>Configuration file</h2>
52
+
53
+ <p>To run vmail, create a yaml file called <code>.vmailrc</code> and save it either in the
54
+ current directory (the directory from which you launch vmail) or in your home
55
+ directory.</p>
56
+
57
+ <p>The <code>.vmailrc</code> file should look something like this. Substitute your own values.</p>
58
+
59
+ <pre><code>username: dhchoi@gmail.com
60
+ password: password
61
+ name: Daniel Choi
62
+ signature: |
63
+ --
64
+ Sent via vmail. http://danielchoi.com/software/vmail.html
65
+ </code></pre>
66
+
67
+ <p>This file should be formatted in <a href="https://github.com/danchoi/vmail">YAML syntax</a>.</p>
68
+
69
+ <p>You can omit the password key-value pair if you'd rather not have the password
70
+ saved in the file. In that case, you'll prompted for the password each time you
71
+ start vmail.</p>
72
+
73
+ <h2>Contacts autocompletion</h2>
74
+
75
+ <p>vmail uses vim autocompletion to help you auto-complete email addresses.
76
+ To use this feature, generate a <code>vmail-contacts.txt</code> file in the current or
77
+ home directory. This is a simple list of your email contacts.
78
+ Invoking vmail with the <code>-g</code> option generates this file for you by
79
+ collecting all the recipients and cc's from your last 500 sent
80
+ emails. You can adjust this number by using <code>-g</code> with a number argument.</p>
81
+
82
+ <p>After vmail generates this file for you, you can edit it however and whenever
83
+ you want, as long as there is one address per line.</p>
84
+
85
+ <h2>Starting vmail</h2>
86
+
87
+ <p>Once you've created the configuration file and (optionally) the contacts file,
88
+ you can start vmail with</p>
89
+
90
+ <pre><code>vmail
91
+ </code></pre>
92
+
93
+ <p>This opens the vmail/vim interface and shows you the last 100 messages in your
94
+ Gmail inbox.</p>
95
+
96
+ <p>You can have vmail show messages from any other mailbox (a.k.a. label) on
97
+ startup by passing in the mailbox name as an argument:</p>
98
+
99
+ <pre><code>vmail starred
100
+ </code></pre>
101
+
102
+ <p>You can also pass in search parameters:</p>
103
+
104
+ <pre><code>vmail important from barackobama@whitehouse.gov
105
+ </code></pre>
106
+
107
+ <p>On startup, vmail loads 100 messages by default. You can increase or decrease
108
+ this number by passing in a number after the mailbox name:</p>
109
+
110
+ <pre><code>vmail inbox 700 subject unix
111
+ </code></pre>
112
+
113
+ <h2>Viewing messages</h2>
114
+
115
+ <p>The first screen vmail shows you is a list of messages. You can view a message
116
+ by moving the cursor line to it and pressing ENTER. This will split the screen
117
+ and show the message content in the bottom pane.</p>
118
+
119
+ <p>To full-screen the message, press SPACE when the cursor is the message window.
120
+ To go back to the split view, press ENTER.</p>
121
+
122
+ <p>You can full-screen the list window by pressing SPACE while the cursor is in it.</p>
123
+
124
+ <p>In the split view, you can jump between the two panes by just pressing ENTER
125
+ from either window.</p>
126
+
127
+ <p>vmail loads a certain number messages at a time, starting with the most recent.
128
+ If there are more messages that vmail hasn't loaded, you'll see a line at the
129
+ top of the list that looks something like this:</p>
130
+
131
+ <pre><code>&gt; Load 100 more messages. 156 remaining.
132
+ </code></pre>
133
+
134
+ <p>Put the cursor on this line and press ENTER to load more of these messages.</p>
135
+
136
+ <p>Unread messages are marked with a <code>[+]</code> symbol.</p>
137
+
138
+ <p>To view the raw RFC822 version of a message, type <code>,R</code> while viewing the message.</p>
139
+
140
+ <h2>Starring, deleting, archiving, marking spam</h2>
141
+
142
+ <p>To star a message, put the cursor on it and type <code>,*</code> or alternatively <code>s</code>.
143
+ Starring a message copies it to the <code>starred</code> mailbox. Starred messages are
144
+ marked with a <code>[*]</code> symbol and color-highlighted.</p>
145
+
146
+ <p>To delete a message, put the cursor on it and type <code>,#</code> or alternatively <code>,d</code>.
147
+ Deleting a message puts it in the <code>trash</code> mailbox. Deleting a message from the
148
+ <code>trash</code> mailbox deletes it permanently.</p>
149
+
150
+ <p>To archive a message, put the cursor on it and type <code>,e</code>. Archiving a message
151
+ moves it to the <code>all</code> mailbox.</p>
152
+
153
+ <p>To mark a message spam, put the cursor on it and type <code>,!</code>. This moves the
154
+ message to to the <code>spam</code> mailbox.</p>
155
+
156
+ <p>You can use range selections in the message list when you star, delete, mark as
157
+ spam, or archive. Use <code>&lt;C-v&gt;</code> to start marking a range of lines (the vertical
158
+ position of the cursor doesn't matter). Then type any of the above commands to
159
+ perform an action on all the messages you selected.</p>
160
+
161
+ <h2>Switching mailboxes, moving messages, copying messages to another mailbox</h2>
162
+
163
+ <p>To switch mailboxes, type <code>,m</code>. You'll see an autocomplete window appear at the top.
164
+ The standard vim autocomplete keystrokes apply:</p>
165
+
166
+ <ul>
167
+ <li><code>C-p</code> and <code>C-n</code> move you up and down the match list</li>
168
+ <li><code>C-e</code> closes the match list and lets you continue typing</li>
169
+ <li><code>C-u</code>: when the match list is active, cycles forward through the match list and what you've typed so far; when the match list is inactive, erases what you've typed.</li>
170
+ <li><code>C-x C-u</code> finds matches for what you've typed so far (when the match list window is closed)</li>
171
+ <li><code>C-y</code> selects the highlighted match without triggering ENTER</li>
172
+ <li>ENTER selects the highlighted match from the match list</li>
173
+ </ul>
174
+
175
+
176
+ <p>Tip: start typing the first 1-3 characters of the mailbox name, then press
177
+ <code>C-u</code> or <code>C-p</code> until you highlight the right match, and finally press ENTER to
178
+ select.</p>
179
+
180
+ <p>To move a message to another mailbox, put the cursor on the message in the
181
+ message list, and type <code>,b</code>. You'll be prompted to select the target mailbox.</p>
182
+
183
+ <p>To copy a message to another mailbox, put the cursor on the message in the
184
+ message list, and type <code>,B</code>. You'll be prompted to select the target mailbox.</p>
185
+
186
+ <h2>Composing messages</h2>
187
+
188
+ <p>To start writing a new a email message, type <code>,c</code>.</p>
189
+
190
+ <p>To reply to a message, type <code>,r</code>.</p>
191
+
192
+ <p>To reply-all to a message, type <code>,a</code>.</p>
193
+
194
+ <p>To forward a message, type <code>,f</code>.</p>
195
+
196
+ <p>All these command open a message composition window. At the top, you will see
197
+ mail headers like this:</p>
198
+
199
+ <pre><code>from: Daniel Choi &lt;dhchoi@gmail.com&gt;
200
+ to:
201
+ subject:
202
+ </code></pre>
203
+
204
+ <p>The <code>from:</code> field will be pre-filled from your <code>.vmailrc</code> configuration.
205
+ You're responsible for fill in the <code>to:</code> and the <code>subject:</code> fields.
206
+ You can add a <code>cc:</code> and <code>bcc:</code> field if you want.</p>
207
+
208
+ <p>When you fill in the recipient addresses, you can use vim autocompletion if you
209
+ generated a <code>vmail-contacts.txt</code> file. Start typing a name or email address, then press <code>C-x C-u</code>
210
+ to invoke autocompletion.</p>
211
+
212
+ <p>Tip: Use <code>C-y</code> instead of ENTER to select a match. This will prevent you from
213
+ creating a blank line in the middle of the email headers.</p>
214
+
215
+ <p>Make sure your email addresses are separated by commas and that they all
216
+ ultimately appear on the <strong>same, unbroken line</strong> for each field. Vim will
217
+ probably break long lines automatically as you type them, so for now (pending a
218
+ future enhancement), you'll have to rejoin the lines if breaks get inserted.</p>
219
+
220
+ <p>After you fill in the headers, write your message. Make sure there is a
221
+ blank line between the headers and the body of your message.</p>
222
+
223
+ <p>When you're done writing, send the message by typing <code>,vs</code> in normal mode.</p>
224
+
225
+ <p>You can save the message as a draft in your draft mailbox by typing <code>,vd</code> in
226
+ normal mode.</p>
227
+
228
+ <p>At any point, you can quit the composition window by typing <code>q</code> in normal mode.</p>
229
+
230
+ <h2>Attachments</h2>
231
+
232
+ <p>The current version of vmail can handle attachments to a certain extent.</p>
233
+
234
+ <p>When you're viewing a message with attachments, you'll see something like this
235
+ at the top of the message window:</p>
236
+
237
+ <pre><code>INBOX 2113 4 kb
238
+ - image/png; name=canada.png
239
+ - image/gif; name=arrow_right.gif
240
+ ---------------------------------------
241
+ from: Daniel Choi &lt;dhchoi@gmail.com&gt;
242
+ date: Sun, Dec 12 08:39 AM -05:00 2010
243
+ to: Daniel Choi &lt;dhchoi@gmail.com&gt;
244
+ subject: attachment test
245
+
246
+
247
+
248
+ see attached
249
+ </code></pre>
250
+
251
+ <p>To download these attachments to a local directory, type <code>,A</code>. You'll be
252
+ prompted for a directory path. Then vmail will save all the attachments in the
253
+ message to this directory.</p>
254
+
255
+ <p>To send attachments, add something like this to your new message in the message
256
+ composition window:</p>
257
+
258
+ <pre><code>from: Daniel Choi &lt;dhchoi@gmail.com&gt;
259
+ to: barackobama@whitehouse.gov
260
+ subject: look at this!
261
+
262
+
263
+
264
+ attach:
265
+ - images/middle-east-map.png
266
+ - images/policypaper.pdf
267
+ - docs/
268
+
269
+
270
+
271
+ I think you'll find this stuff interesting.
272
+ </code></pre>
273
+
274
+ <p>The <code>attach:</code> block is a YAML list. The items are paths (either relative or
275
+ absolute) to the files you want to attach to your message. Note that you can
276
+ also specify a directory, in which case vmail attaches every file it finds in
277
+ that directory.</p>
278
+
279
+ <p>One thing vmail doesn't do yet is let you forward a message with all its
280
+ attachments intact. This feature will be implemented in the near future.</p>
281
+
282
+ <h2>Printing messages to a file</h2>
283
+
284
+ <p><code>,vp</code> from the message list prints (appends) the text content of all the selected
285
+ messages to a file.</p>
286
+
287
+ <h2>Invoking your web browser</h2>
288
+
289
+ <p>When you're reading a message, <code>,o</code> opens the first hyperlink in the document
290
+ on or after the cursor in your normal web browser.</p>
291
+
292
+ <p>When you're reading a message with an html mail part, <code>,h</code> saves that part to a
293
+ local file (<code>vmail-htmlpart.html</code>) and opens it in your normal web browser.</p>
294
+
295
+ <p>By default, the command vmail uses to open your web browser is <code>open</code>. In OS X,
296
+ this opens URLs and HTML files in the default web browser. You can change the
297
+ browser vmail invokes by setting the VMAIL_BROWSER environmental variable
298
+ before you start vmail, e.g.:</p>
299
+
300
+ <pre><code>export VMAIL_BROWSER='elinks'
301
+ </code></pre>
302
+
303
+ <h2>Search queries</h2>
304
+
305
+ <p>vmail can generate a message list by performing an IMAP search on the current mailbox.
306
+ From the message list window, type <code>,s</code>. This will prompt you for a search query.
307
+ The search query is an optional number specifying the number of messages to return,
308
+ followed by a valid IMAP search query.</p>
309
+
310
+ <p>Here are some example search queries.</p>
311
+
312
+ <pre><code># the default
313
+ 100 all
314
+
315
+
316
+
317
+ # all messages from thematrix.com domain
318
+ from thematrix.com
319
+
320
+
321
+
322
+ # all messages from this person
323
+ from barackobama@whitehouse.gov
324
+
325
+
326
+
327
+ # subject field search; use double quotes to enclose multiple words
328
+ subject "unix philosophy"
329
+
330
+
331
+
332
+ # example of date range and multiple conditions
333
+ before 30-Nov-2010 since 1-Nov-2010 from prx.org
334
+ </code></pre>
335
+
336
+ <p>Tip: When you're entering your search query, <code>&lt;C-u&gt;</code> clears the query line.</p>
337
+
338
+ <p>Power-Tip: <code>&lt;C-f&gt;</code> opens a mini-editor that contains the current query plus a history of
339
+ previous vmail search queries. You can edit any line in this mini-editor and
340
+ press ENTER to perform the query on that line.</p>
341
+
342
+ <h2>Using vmail with MacVim</h2>
343
+
344
+ <p>vmail uses standard Vim by default, but vmail also works with MacVim, but not
345
+ perfectly. In particular, there seems to be a bug in MacVim that prevents
346
+ vmail's status line activity messages from appearing properly. Nonetheless,
347
+ most of vmail is functional in MacVim.</p>
348
+
349
+ <p>To use MacVim as your vmail Vim engine, <code>export VMAIL_VIM=mvim</code> before startin
350
+ vmail.</p>
351
+
352
+ <p>Note that when vmail uses MacVim, the terminal window in which you invoke vmail
353
+ will show vmail's logging output while MacVim is running. To quit vmail in
354
+ MacVim mode, you will have to press CTRL-c in this window to stop the vmail
355
+ process.</p>
356
+
357
+ <h2>vmail file byproducts</h2>
358
+
359
+ <p>vmail generates a few file byproducts when it is running. It generates a
360
+ temporary <code>vmailbuffer.txt</code> file in the current directory to hold the message
361
+ list. This should get deleted automatically when vmail quits.</p>
362
+
363
+ <p>vmail also creates a <code>vmail-htmlpart.html</code> file in the current directory if you
364
+ open an HTML mail part from vmail.</p>
365
+
366
+ <p>Finally, vmail logs output to a <code>vmail.log</code> file which it creates in the
367
+ current directory. You can tail this file in a separate terminal window to see
368
+ what's going on behind the scenes as you use vmail.</p>
369
+
370
+ <h2>Is my gmail password secure?</h2>
371
+
372
+ <p>In short, yes. vmail uses TLS (<a href="https://github.com/danchoi/vmail">Transport Layer Security</a>) to perform IMAP
373
+ and SMTP authentication. So vmail transmits your password securely over the
374
+ network.</p>
375
+
376
+ <p>You can also be sure that the vmail code doesn't do anything nefarious with your
377
+ Gmail password because vmail is open source. Anyone can inspect the source code
378
+ of the copy fo vmail that runs on your computer and inspect the code at the
379
+ <a href="https://github.com/danchoi/vmail">github repository</a> and at <a href="https://rubygems.org/gems/vmail">rubygems.org</a> (where the vmail gem is
380
+ downloaded from).</p>
381
+
382
+ <h2>Bug reports, feature requests</h2>
383
+
384
+ <p>Please file bug reports and features requests in the <a href="https://github.com/danchoi/vmail">vmail github issue tracker</a>.</p>
385
+
386
+ <h2>How to contact the developer</h2>
387
+
388
+ <p>My name is Daniel Choi. I am based in Cambridge, MA, and you can email me at dhchoi@gmail.com.</p>
389
+
390
+
391
+ <h2>How to support the vmail project</h2>
392
+
393
+ <p>If you find vmail very useful, feel free to drop me a note to say so. If you have
394
+ a bug to report or a good feature to suggest, please file it on the <a href="https://github.com/danchoi/vmail/issues">issue tracker</a>.
395
+ Few things make this software developer happier than knowing that people find my
396
+ software useful.</p>
397
+
398
+ <p>Please do not feel obligated to donate money simply because you use vmail. But if you
399
+ want to donate some money to support the independent software developer behind
400
+ vmail, use this PayPal button:</p>
401
+
402
+ <p><form action="https://www.paypal.com/cgi-bin/webscr" method="post">
403
+ <input type="hidden" name="cmd" value="_s-xclick">
404
+ <input type="hidden" name="hosted_button_id" value="YC3S3D5RFMJSC">
405
+ <input type="image" src="https://www.paypal.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
406
+ <img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
407
+ </form></p>
408
+
409
+ </div>
410
+ <div class="grid_2 omega">
411
+
412
+ <div class="sidebar">
413
+
414
+ <h4>share this</h4>
415
+
416
+ <span class="st_twitter_large" displayText="Tweet"></span><span class="st_facebook_large" displayText="Facebook"></span><span class="st_ybuzz_large" displayText="Yahoo! Buzz"></span><span class="st_gbuzz_large" displayText="Google Buzz"></span><span class="st_email_large" displayText="Email"></span><span class="st_sharethis_large" displayText="ShareThis"></span>
417
+
418
+ <h4>links</h4>
419
+ <ul>
420
+ <li><a href="https://github.com/danchoi/vmail">github repo</a></li>
421
+ <li><a href="https://rubygems.org/gems/vmail">rubygems page</a></li>
422
+ </ul>
423
+ </div>
424
+
425
+ </div>
426
+ </div>
427
+
428
+ <script type="text/javascript">
429
+ var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
430
+ document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
431
+ </script>
432
+ <script type="text/javascript">
433
+ var pageTracker = _gat._getTracker("UA-4028996-5");
434
+ pageTracker._initData();
435
+ pageTracker._trackPageview();
436
+ </script>
437
+ </body>
438
+ </html>