Importer for nabble

This commit is contained in:
Robin Ward
2015-05-22 15:40:26 -04:00
parent 3677c56267
commit ab50d039bb
2 changed files with 150 additions and 1 deletions

View File

@ -24,8 +24,9 @@ module Email
attr_reader :body, :email_log
def initialize(raw)
def initialize(raw, opts=nil)
@raw = raw
@opts = opts || {}
end
def process
@ -135,6 +136,8 @@ module Email
body = fix_charset message
end
return body if @opts[:skip_sanity_check]
# Certain trigger phrases that means we didn't parse correctly
if body =~ /Content\-Type\:/ || body =~ /multipart\/alternative/ || body =~ /text\/plain/
raise EmptyEmailError