postfix-xforward 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
- = 0.1.1, release 2010-08-26
1
+ = 0.1.3, release 2010-08-26
2
2
 
3
- * fixed #xtext to allow non-string arguments (returns nil)
4
- * fixed it so XFORWARD attribute values explicitly set, but set to nil or the empty string will instead send '[UNAVAILABLE]' for the value
3
+ * fixed #xtext to allow non-string arguments (returns empty string)
4
+ * fixed it so that any provided XFORWARD attribute that are set to anything other than non-blank strings won't be sent
5
5
 
6
6
  = 0.1.0, release 2010-08-19
7
7
 
@@ -247,16 +247,15 @@ module PostfixXForward
247
247
  cmd = XCMD.dup
248
248
  cap = capable_xforward_attrs
249
249
  @xforward_attrs.each do |attr, value|
250
- if cap.include?(attr)
251
- value = '[UNAVAILABLE]' if value.nil? or value.empty?
252
- tmp = " #{attr}=#{Utils.xtext(value)}"
250
+ if cap.include?(attr) and value.is_a?(String) and value.strip != ''
251
+ tmp = " #{attr}=#{Utils.xtext(value.strip)}"
253
252
  if cmd.length + tmp.length > MAXLEN
254
253
  getok(cmd)
255
254
  cmd = XCMD.dup
256
255
  end
257
256
  cmd << tmp
258
257
  else
259
- logging("ignoring XFORWARD attribute '#{attr}': unsupported by server")
258
+ logging("ignoring XFORWARD attribute '#{attr}': unsupported by server or no valid value specified")
260
259
  end
261
260
  end
262
261
  getok(cmd) if cmd != XCMD
@@ -2,7 +2,7 @@ module PostfixXForward
2
2
  class Utils
3
3
  # Convert the txt string to "xtext" as defined in RFC 1891
4
4
  def Utils.xtext(txt)
5
- return nil unless txt.respond_to?(:gsub)
5
+ return '' unless txt.respond_to?(:gsub)
6
6
  txt.gsub(/[+=\x00-\x20\x7f-\xff]/) do |c|
7
7
  "+#{c.unpack('H2').first.upcase}"
8
8
  end
@@ -2,7 +2,7 @@ module PostfixXForward
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 1
5
- TINY = 2
5
+ TINY = 3
6
6
  STRING = [MAJOR, MINOR, TINY].join('.')
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: postfix-xforward
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 29
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 2
10
- version: 0.1.2
9
+ - 3
10
+ version: 0.1.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Kendall Gifford