Project

General

Profile

« Previous | Next » 

Revision c9e31672

Added by Marc Dequènes over 9 years ago

[fix] add some quick checks for the main headers (as a stopgap)

View differences:

bin/postman
def process_message(msg)
mail = Mail.new(msg.content)
{:from => "From", :to => "To"}.each_pair do |key, header|
if mail[key].nil?
logger.info "Mail does not have a valid %s, ignoring..." % header
msg.delete
return true
end
end
logger.info "Received mail with ID '#{mail.message_id}': #{mail[:from].decoded} -> #{mail[:to].decoded} (#{mail.subject})"
# ignore mails not signed or encrypted

Also available in: Unified diff