vmail 2.8.1 → 2.8.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -63,8 +63,8 @@ during execution (see below).
63
63
  ## Configuration file
64
64
 
65
65
  To run Vmail, create a yaml file called `.vmailrc` and save it either in
66
- ~/.vmail/defaults/ or in your home directory. If you do the latter,
67
- Vmail will move the file to ~/.vmail/defaults/ when it starts up.
66
+ ~/.vmail/default/ or in your home directory. If you do the latter,
67
+ Vmail will move the file to ~/.vmail/default/ when it starts up.
68
68
 
69
69
  The `.vmailrc` file should look something like this. Substitute your own values.
70
70
 
@@ -29,6 +29,8 @@ module Vmail
29
29
 
30
30
  def initialize(config)
31
31
  @username, @password = config['username'], config['password']
32
+ #load user-specified value for from field
33
+ @from = config['from'] || config['username']
32
34
  @name = config['name']
33
35
  @signature = config['signature']
34
36
  @signature_script = config['signature_script']
@@ -241,7 +243,7 @@ module Vmail
241
243
  ''
242
244
  end
243
245
  rescue
244
- puts "VMAIL_ERROR: #{[$!.message, $!.backtrace].join("\n")}"
246
+ puts "VMAIL_ERROR: #{$!.class}\n#{[$!.message, $!.backtrace].join("\n")}"
245
247
  end
246
248
 
247
249
  # gets 100 messages prior to id
@@ -292,7 +294,8 @@ module Vmail
292
294
  end
293
295
 
294
296
  def new_message_template(subject = nil, append_signature = true)
295
- headers = {'from' => "#{@name} <#{@username}>",
297
+ #set from field to user-specified value
298
+ headers = {'from' => "#{@name} <#{@from}>",
296
299
  'to' => nil,
297
300
  'subject' => subject,
298
301
  'cc' => @always_cc,
@@ -12,7 +12,7 @@ module Vmail
12
12
  log "Using notify tool: #{n}"
13
13
  @notifier = case n
14
14
  when /notify-send/
15
- Proc.new {|t, m| `#{n} '#{t}' '#{m}'` }
15
+ Proc.new {|t, m| `#{n} -t 6000000 '#{t}' '#{m}'` }
16
16
  when /growlnotify/
17
17
  Proc.new {|t, m| `#{n} -t '#{t}' -m '#{m}'` }
18
18
  end
@@ -37,8 +37,9 @@ module Vmail
37
37
  new_ids = check_for_new_messages
38
38
  if !new_ids.empty?
39
39
  @ids = @ids + new_ids
40
- res = uncached_headers(new_ids).map {|m| m[:sender] }.join(", ")
41
- @notifier.call "Vmail: new email", "from #{res}"
40
+ # remove '<>' from email. libnotify can't print '<'
41
+ res = uncached_headers(new_ids).map {|m| m[:sender] }.join(", ").tr('<>','')
42
+ @notifier.call "Vmail: new email", "from " + res
42
43
  end
43
44
  rescue
44
45
  log "VMAIL_ERROR: #{[$!.message, $!.backtrace].join("\n")}"
@@ -27,7 +27,8 @@ module Vmail
27
27
 
28
28
  {
29
29
  'references' => current_message.message_id,
30
- 'from' => "#@name <#@username>",
30
+ # set 'from' to user-specified value
31
+ 'from' => "#@name <#@from>",
31
32
  'to' => reply_recipient,
32
33
  'cc' => reply_cc,
33
34
  'bcc' => @always_bcc,
@@ -1,3 +1,3 @@
1
1
  module Vmail
2
- VERSION = '2.8.1'
2
+ VERSION = '2.8.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vmail
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.8.1
4
+ version: 2.8.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-04 00:00:00.000000000 Z
12
+ date: 2013-03-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: mail