vmail 0.5.9 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ begin
4
+ require 'vmail/sender'
5
+ rescue LoadError
6
+ require 'rubygems'
7
+ require 'vmail/sender'
8
+ end
9
+
10
+ Vmail::Sender.send
11
+
@@ -146,8 +146,8 @@ module Vmail
146
146
  each {|old_row_data| old_row_data[:row_text] = new_row_data[:row_text]}
147
147
  }
148
148
  else
149
- # put new rows before the current ones
150
- @message_list.unshift(*new_message_rows)
149
+ # put new rows after the current ones
150
+ @message_list = @message_list.concat new_message_rows
151
151
  end
152
152
  log "returning #{new_message_rows.size} new rows"
153
153
  return new_message_rows.
@@ -201,7 +201,9 @@ module Vmail
201
201
  (date_formatted || '').col(14),
202
202
  address.col(address_col_width),
203
203
  subject.col(subject_col_width),
204
- number_to_human_size(size).rcol(6) ].join(' ')
204
+ number_to_human_size(size).rcol(6),
205
+ "#{seqno}:#{uid}"
206
+ ].join(' ')
205
207
  {:uid => uid, :seqno => seqno, :row_text => row_text}
206
208
  rescue
207
209
  log "error extracting header for uid #{uid} seqno #{seqno}: #$!"
@@ -339,10 +341,13 @@ module Vmail
339
341
  log "showing message at #{index}"
340
342
  return @current_mail.to_s if raw
341
343
  index = index.to_i
342
- return @current_message if index == @current_message_index
344
+ if index == @current_message_index
345
+ return @current_message
346
+ end
343
347
  envelope_data = @message_list[index]
348
+ seqno = envelope_data[:seqno]
344
349
  uid = envelope_data[:uid]
345
- log "fetching uid #{uid}"
350
+ log "showing message seqno: #{seqno} uid #{uid}"
346
351
  fetch_data = reconnect_if_necessary do
347
352
  @imap.uid_fetch(uid, ["FLAGS", "RFC822", "RFC822.SIZE"])[0]
348
353
  end
@@ -571,14 +576,6 @@ EOF
571
576
  "message '#{mail.subject}' sent"
572
577
  end
573
578
 
574
- # TODO
575
- def resume_draft
576
- # chop off top three lines (this is hackey, fix later)
577
- # text = text.split("\n")[3..-1].join("\n")
578
- # delete date: field
579
- # text = text.sub("^date:\s*$", "")
580
- end
581
-
582
579
  def new_mail_from_input(text)
583
580
  require 'mail'
584
581
  mail = Mail.new
@@ -23,11 +23,6 @@ module Vmail
23
23
  {'from' => "#@name <#@username>", 'to' => primary_recipient, 'cc' => cc, 'subject' => subject, :body => body}
24
24
  end
25
25
 
26
- # just stick this here
27
- def forward_headers
28
-
29
- end
30
-
31
26
  def primary_recipient
32
27
  from = @mail.header['from']
33
28
  reply_to = @mail.header['reply-to']
@@ -0,0 +1,15 @@
1
+ require 'vmail/imap_client'
2
+
3
+ module Vmail
4
+ class Sender
5
+ extend self
6
+
7
+ def send
8
+ opts = Vmail::Options.new(ARGV)
9
+ config = opts.config.merge 'logile' => STDERR
10
+ imap_client = Vmail::ImapClient.new config
11
+ imap_client.deliver STDIN.read
12
+ end
13
+ end
14
+ end
15
+
@@ -1,3 +1,3 @@
1
1
  module Vmail
2
- VERSION = "0.5.9"
2
+ VERSION = "0.6.0"
3
3
  end
metadata CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 0
7
- - 5
8
- - 9
9
- version: 0.5.9
7
+ - 6
8
+ - 0
9
+ version: 0.6.0
10
10
  platform: ruby
11
11
  authors:
12
12
  - Daniel Choi
@@ -53,6 +53,7 @@ email:
53
53
  executables:
54
54
  - vmail
55
55
  - vmail_client
56
+ - vmailsend
56
57
  extensions: []
57
58
 
58
59
  extra_rdoc_files: []
@@ -65,6 +66,7 @@ files:
65
66
  - Rakefile
66
67
  - bin/vmail
67
68
  - bin/vmail_client
69
+ - bin/vmailsend
68
70
  - lib/vmail.rb
69
71
  - lib/vmail.vim
70
72
  - lib/vmail/contacts_extractor.rb
@@ -72,6 +74,7 @@ files:
72
74
  - lib/vmail/message_formatter.rb
73
75
  - lib/vmail/options.rb
74
76
  - lib/vmail/reply_template.rb
77
+ - lib/vmail/sender.rb
75
78
  - lib/vmail/string_ext.rb
76
79
  - lib/vmail/version.rb
77
80
  - test/base64_test.rb