aboutsummaryrefslogtreecommitdiffstats
path: root/lib/mail_handler/backends/tmail_backend.rb
diff options
context:
space:
mode:
authorLouise Crow <louise.crow@gmail.com>2012-12-04 14:13:49 +0000
committerLouise Crow <louise.crow@gmail.com>2012-12-04 14:13:49 +0000
commit096c5c5613f426f2e5a73618e6a4e41bc06b57e2 (patch)
tree56834ba4aaf2b8551e8cf8398cc5d5efcc35ef59 /lib/mail_handler/backends/tmail_backend.rb
parent1d42085da0a439f51770e7816feeb949b936380e (diff)
Adding methods for getting the content type of a mail part, and getting header strings from a mail.
Diffstat (limited to 'lib/mail_handler/backends/tmail_backend.rb')
-rw-r--r--lib/mail_handler/backends/tmail_backend.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/mail_handler/backends/tmail_backend.rb b/lib/mail_handler/backends/tmail_backend.rb
index e725f7e9f..4b7291d00 100644
--- a/lib/mail_handler/backends/tmail_backend.rb
+++ b/lib/mail_handler/backends/tmail_backend.rb
@@ -75,6 +75,14 @@ module MailHandler
mail['auto-submitted'] ? mail['auto-submitted'].body : nil
end
+ def get_content_type(part)
+ part.content_type
+ end
+
+ def get_header_string(header, mail)
+ mail.header_string(header)
+ end
+
def address_from_name_and_email(name, email)
if !MySociety::Validate.is_valid_email(email)
raise "invalid email " + email + " passed to address_from_name_and_email"