Project

General

Profile

« Previous | Next » 

Revision 960c259e

Added by Marc Dequènes almost 16 years ago

  • ID 960c259e23a88e40cbcfd210fbc8cc052eb7bb5a

[evol] handle incoming encrypted messages

View differences:

postman
mail = Mail.new(msg.content)
logger.info "Received mail with ID '#{mail.message_id}': #{mail.from_addrs} -> #{mail.to_addrs} (#{mail.subject})"
# ignore mails not signed
unless mail.is_pgp_signed?
logger.info "Mail not signed or not RFC3156 compliant, ignoring..."
# ignore mails not signed or encrypted
unless mail.is_pgp_signed? or mail.is_pgp_encrypted?
logger.info "Mail not signed/encrypted or not RFC3156 compliant, ignoring..."
msg.delete
next
end
logger.debug "Signed content detected"
logger.debug "RFC3156 content detected"
begin
order = mail.parse
rescue CyberError => e
......
msg.delete
next
elsif not order.ok
logger.info "Sending reply for rejected message (#{order.msg})"
mail_reply = mail.create_reply
mail_reply.quoted_printable_body = "A message (ID: #{mail.message_id}) apparently from you was rejected for the following reason:\n #{order.msg}"
mail_reply.deliver
......
next
end
logger.info "Message accepted, processing orders..."
result_list = CommandParser.run(order)
# create reply

Also available in: Unified diff