Project

General

Profile

« Previous | Next » 

Revision a17cca3a

Added by Marc Dequènes over 14 years ago

  • ID a17cca3ab04f1ea40829b0124e7a57da22599acf

[fix] workaround a nasty TMail behavior: don't regenerate a new boundary when one already exist to avoid breaking GPG signatures

View differences:

lib/cyborghood/base/lang_additions.rb
encoded "\r\n", 'j', f
end
end
private
# reuse current boundary if already exist, not to break signed parts
def with_multipart_encoding( strategy )
if parts().empty? # DO NOT USE @parts
yield
else
bound = @header['content-type'].params['boundary'] || ::TMail.new_boundary
if @header.key? 'content-type'
@header['content-type'].params['boundary'] = bound
else
store 'Content-Type', %<multipart/mixed; boundary="#{bound}">
end
yield
parts().each do |tm|
strategy.puts
strategy.puts '--' + bound
tm.accept strategy
end
strategy.puts
strategy.puts '--' + bound + '--'
strategy.write epilogue()
end
end
end
end

Also available in: Unified diff