Project

General

Profile

« Previous | Next » 

Revision cdab9091

Added by Marc Dequènes almost 11 years ago

[evol] more TMail->Mail adaptations for main processing

View differences:

bin/postman
if reply_attachments.empty?
transcript_part = mail_reply
else
mail_reply.parts.clear
p = CyborgHood::Mail.blank
transcript_part = p
mail_reply.parts << p
transcript_part = ::Mail::Part.new
mail_reply.add_part(transcript_part)
reply_attachments.each do |attachment|
p = CyborgHood::Mail.blank
p.set_content_type("text", "plain", {'charset' => "utf-8"})
p.set_disposition("attachment", {'filename' => attachment.filename})
p.quoted_printable_body = attachment.content
mail_reply.parts << p
mail_reply.attachments[attachment.filename] = {
:mime_type => 'text/plain',
:content => attachment.content
}
end
end
# insert transcript
transcript_part.set_content_type("text", "plain", {'charset' => 'utf-8', 'format' => 'flowed'})
transcript_part.set_disposition("inline")
transcript_part.quoted_printable_body = reply_txt + mail_reply.default_body_signature
transcript_part.content_type = 'text/plain; charset="UTF-8"'
transcript_part.content_disposition = 'inline; format="flowed"'
transcript_part.body = reply_txt + mail_reply.default_body_signature
# send reply
logger.debug "Sending mail"
lib/cyborghood/mail.rb
end
end
def self.blank
m = self.new
m.clear
m
end
def self.read(path)
self.new(::Mail.read(path))
end
......
def create_simple_reject_reply(msg)
mail_reply = reply()
mail_reply.charset = "utf-8"
mail_reply.content_type = 'text/plain; charset="UTF-8"'
mail_reply.body = msg + self.default_body_signature
mail_reply.sign
mail_reply.crypt(mail_reply.user.keyFingerPrint) unless mail_reply.user.nil?

Also available in: Unified diff