Project

General

Profile

« Previous | Next » 

Revision bdcaf541

Added by Marc Dequènes almost 7 years ago

updated Mail::GpgExtension to work with Ruby Mail in Stretch

View differences:

lib/mail/gpg.rb
# use untouched data, or verification will fail
content = pgp_signed_part.raw_source
# RFC3156: properly convert all EOL to CRLF
content.to_crlf
content = ::Mail::Utilities.to_crlf(content)
# XXX: ruby-mail strangely adds a CRLF at the begining of the part
content.sub!(/^\r\n/m, "")
......
# - remove lines containing only whitespaces
# - remove trailing whitespaces
# - properly convert all EOL to CRLF
prepared_data = self.encoded.split(/\r?\n/, -1).select do |l|
prepared_data = ::Mail::Utilities.to_crlf(self.encoded.split(/\r?\n/, -1).select do |l|
not l =~ /^ +$/
end.join("\n").gsub(/ +$/, "").to_crlf
end.join("\n").gsub(/ +$/, ""))
raise 'Mail ERROR: data to sign MUST be in 7bit format, using Quoted-Printable or Base64 encoding !' unless
prepared_data.ascii_only?

Also available in: Unified diff