mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 07:53:49 +08:00
Importer for nabble
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user