+ m.header["Content-Type"] = "text/plain; charset=#{$encoding}"
+ m.body = @body.join
+ m.body = m.body
+ m.body += sig_lines.join("\n") unless $config[:edit_signature]
+
+ ## there are attachments, so wrap body in an attachment of its own
+ unless @attachments.empty?
+ body_m = m
+ body_m.header["Content-Disposition"] = "inline"
+ m = RMail::Message.new
+
+ m.add_part body_m
+ @attachments.each { |a| m.add_part a }
+ end
+
+ ## do whatever crypto transformation is necessary
+ if @crypto_selector && @crypto_selector.val != :none
+ from_email = PersonManager.person_for(@header["From"]).email
+ to_email = [@header["To"], @header["Cc"], @header["Bcc"]].flatten.compact.map { |p| PersonManager.person_for(p).email }
+
+ m = CryptoManager.send @crypto_selector.val, from_email, to_email, m
+ end
+
+ ## finally, set the top-level headers