Class: MailDude::AttachmentScrubber
- Inherits:
-
Object
- Object
- MailDude::AttachmentScrubber
- Defined in:
- lib/mail_dude/attachment_scrubber.rb
Constant Summary collapse
- RAW_SOURCE_OMITTED =
"MailDude omitted raw message source because attachment capture is disabled.\n"
Instance Method Summary collapse
-
#initialize(mail) ⇒ AttachmentScrubber
constructor
A new instance of AttachmentScrubber.
- #raw_source ⇒ Object
Constructor Details
#initialize(mail) ⇒ AttachmentScrubber
Returns a new instance of AttachmentScrubber.
7 8 9 |
# File 'lib/mail_dude/attachment_scrubber.rb', line 7 def initialize(mail) @mail = mail end |
Instance Method Details
#raw_source ⇒ Object
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/mail_dude/attachment_scrubber.rb', line 11 def raw_source source = mail&.to_s return RAW_SOURCE_OMITTED if source.blank? sanitized = Mail.read_from_string(source) (sanitized) sanitized.to_s rescue StandardError RAW_SOURCE_OMITTED end |