vmail 1.2.5 → 1.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.markdown +21 -13
- data/lib/vmail/imap_client.rb +5 -3
- data/lib/vmail/version.rb +1 -1
- metadata +3 -3
data/README.markdown
CHANGED
@@ -410,35 +410,37 @@ navigate the search query history. `<C-f>` opens a mini-editor that contains
|
|
410
410
|
the current query plus a history of previous vmail search queries. You can edit
|
411
411
|
any line in this mini-editor and press ENTER to perform the query on that line.
|
412
412
|
|
413
|
-
## Command
|
413
|
+
## Command-line mode and batch processing
|
414
414
|
|
415
|
-
You can invoke vmail in non-interactive mode
|
416
|
-
processing
|
415
|
+
You can invoke vmail in non-interactive command-line mode. This is very
|
416
|
+
useful for batch processing and for using vmail in Unix pipelines and
|
417
|
+
automated scripts.
|
417
418
|
|
418
|
-
If you redirect vmail's output from STDOUT to a file, vmail will
|
419
|
-
the message list resulting from a search query to a file.
|
419
|
+
If you redirect vmail's output from STDOUT to a file or a program, vmail will
|
420
|
+
output the message list resulting from a search query to a file.
|
420
421
|
|
421
|
-
vmail inbox 100 from monit >
|
422
|
+
vmail inbox 100 from monit > message-list.txt
|
422
423
|
|
423
424
|
You can open this file in any text editor to make sure that the search
|
424
425
|
query produced the expected result. Then you can perform the following
|
425
426
|
batch operations on the message list:
|
426
427
|
|
427
428
|
# deletes all the messages in the message list
|
428
|
-
vmail rm <
|
429
|
+
vmail rm < message-list.txt
|
429
430
|
|
430
431
|
# marks all the messages in the message list as spam
|
431
|
-
vmail spam <
|
432
|
+
vmail spam < message-list.txt
|
432
433
|
|
433
434
|
# moves all the messages in the message list to the 'monit' mailbox
|
434
|
-
vmail mv monit <
|
435
|
+
vmail mv monit < message-list.txt
|
435
436
|
|
436
437
|
# copies all the messages in the message list to the 'monit' mailbox
|
437
|
-
vmail cp monit <
|
438
|
+
vmail cp monit < message-list.txt
|
438
439
|
|
439
|
-
#
|
440
|
-
vmail print
|
440
|
+
# appends the text content of all the messages in the message list to messages.txt
|
441
|
+
vmail print messages.txt < message-list.txt
|
441
442
|
|
443
|
+
Non-interactive mode assumes that `.vmailrc` contains your Gmail password.
|
442
444
|
|
443
445
|
## Getting help
|
444
446
|
|
@@ -525,6 +527,12 @@ A big shout out goes to my funny, smart, and supportive fellow hacker alums of
|
|
525
527
|
|
526
528
|
[betahouse]:http://betahouse.org/
|
527
529
|
|
528
|
-
|
529
530
|
[twitter]:http://twitter.com/#!/danchoi
|
530
531
|
|
532
|
+
## Help wanted: screencaster
|
533
|
+
|
534
|
+
The vmail project needs someone to make a good screencast introduction to
|
535
|
+
vmail. (I'm very bad at making screencasts.) Please let me know once you've
|
536
|
+
posted it somewhere so I can link to it. Feel free to put a plug in the
|
537
|
+
screencast for your own company or blog.
|
538
|
+
|
data/lib/vmail/imap_client.rb
CHANGED
@@ -274,7 +274,8 @@ module Vmail
|
|
274
274
|
FLAGMAP = {:Flagged => '*'}
|
275
275
|
# flags is an array like [:Flagged, :Seen]
|
276
276
|
def format_flags(flags)
|
277
|
-
|
277
|
+
# other flags like "Old" should be hidden here
|
278
|
+
flags = flags.map {|flag| FLAGMAP[flag]}
|
278
279
|
if flags.delete(:Seen).nil?
|
279
280
|
flags << '+' # unread
|
280
281
|
end
|
@@ -448,17 +449,18 @@ module Vmail
|
|
448
449
|
end
|
449
450
|
# USE THIS
|
450
451
|
size = fetch_data.attr["RFC822.SIZE"]
|
452
|
+
flags = fetch_data.attr["FLAGS"]
|
451
453
|
mail = Mail.new(fetch_data.attr['RFC822'])
|
452
454
|
formatter = Vmail::MessageFormatter.new(mail)
|
453
455
|
message_text = <<-EOF
|
454
|
-
#{@mailbox} uid:#{uid} #{number_to_human_size size} #{format_parts_info(formatter.list_parts)}
|
456
|
+
#{@mailbox} uid:#{uid} #{number_to_human_size size} #{flags.inspect} #{format_parts_info(formatter.list_parts)}
|
455
457
|
#{divider '-'}
|
456
458
|
#{format_headers(formatter.extract_headers)}
|
457
459
|
|
458
460
|
#{formatter.process_body}
|
459
461
|
EOF
|
460
462
|
# log "storing message_cache[[#{@mailbox}, #{uid}]]"
|
461
|
-
d = {:mail => mail, :size => size, :message_text => message_text, :seqno => fetch_data.seqno}
|
463
|
+
d = {:mail => mail, :size => size, :message_text => message_text, :seqno => fetch_data.seqno, :flags => flags}
|
462
464
|
message_cache[[@mailbox, uid]] = d
|
463
465
|
rescue
|
464
466
|
msg = "Error encountered parsing message uid #{uid}:\n#{$!}\n#{$!.backtrace.join("\n")}" +
|
data/lib/vmail/version.rb
CHANGED
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 1
|
7
7
|
- 2
|
8
|
-
-
|
9
|
-
version: 1.2.
|
8
|
+
- 6
|
9
|
+
version: 1.2.6
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Daniel Choi
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2011-01-
|
17
|
+
date: 2011-01-10 00:00:00 -05:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|