lib/mailarchiva/message.rb in mailarchiva-0.0.11 vs lib/mailarchiva/message.rb in mailarchiva-0.0.12

- old
+ new

@@ -37,11 +37,11 @@ @to end def to if undisclosed_recipients? - mail_message.header.fields.select{|field| field.name =~ /received/i && field.value =~ /\sfor\s<(.*)>/i }.collect{|field| field.value.match(/\sfor\s<(.*)>/).captures.first}.uniq.join + mail_message.header.fields.select{|field| field.name =~ /received/i && field.value =~ /\sfor\s\W?([\w\._\-]+@[\w\._\-]+)\W/i }.collect{|field| field.value.match( /\sfor\s\W?([\w\._\-]+@[\w\._\-]+)\W/).captures.first}.uniq.join elsif raw_to raw_to.match(/<(.*)>/).captures.first end end @@ -52,10 +52,10 @@ def mail_message @mail_message ||= @client.get_mail_message(@blob_id, @volume_id) end def undisclosed_recipients? - (raw_to =~ /undisclosed-recipients/i) == 1 + raw_to.nil? || (raw_to =~ /undisclosed-recipients/i) == 1 end end end \ No newline at end of file