Handle non-multipart email
This commit is contained in:
parent
d88ada0d11
commit
2b86f8cab2
1 changed files with 6 additions and 1 deletions
|
@ -19,7 +19,12 @@ end
|
||||||
exit 0 unless recipient[3] == digest[0,6]
|
exit 0 unless recipient[3] == digest[0,6]
|
||||||
|
|
||||||
mail = Mail.new(STDIN.readlines.join)
|
mail = Mail.new(STDIN.readlines.join)
|
||||||
|
|
||||||
|
if mail.multipart?
|
||||||
body = mail.html_part || mail.text_part
|
body = mail.html_part || mail.text_part
|
||||||
|
else
|
||||||
|
body = mail.body
|
||||||
|
end
|
||||||
|
|
||||||
message = Message.new(:sender => from, :recipient => to,
|
message = Message.new(:sender => from, :recipient => to,
|
||||||
:sent_on => mail.date.new_offset(0),
|
:sent_on => mail.date.new_offset(0),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue