commit 46bd79ce6515e9349193e3a8219af2b9ad42abb6
parent 235498fa2b01e5c317157eabaf1e22124ad0bacb
Author: William Morgan <wmorgan-sup@masanjin.net>
Date: Sat, 26 Sep 2009 18:37:03 -0700
bugfix^3: yet more fiddling with content_type and case-insensitivity
Patch thanks to Michael Stapelberg
Diffstat:
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/lib/sup/message.rb b/lib/sup/message.rb
@@ -374,12 +374,12 @@ private
end
## this probably will never happen
- if payload.header.content_type.downcase == "application/pgp-signature"
+ if payload.header.content_type && payload.header.content_type.downcase == "application/pgp-signature"
warn "multipart/signed with payload content type #{payload.header.content_type}"
return
end
- if signature.header.content_type.downcase != "application/pgp-signature"
+ if signature.header.content_type && signature.header.content_type.downcase != "application/pgp-signature"
## unknown signature type; just ignore.
#warn "multipart/signed with signature content type #{signature.header.content_type}"
return
@@ -400,12 +400,12 @@ private
return
end
- if payload.header.downcase.content_type != "application/octet-stream"
+ if payload.header.content_type && payload.header.content_type.downcase != "application/octet-stream"
warn "multipart/encrypted with payload content type #{payload.header.content_type}"
return
end
- if control.header.downcase.content_type != "application/pgp-encrypted"
+ if control.header.content_type && control.header.content_type.downcase != "application/pgp-encrypted"
warn "multipart/encrypted with control content type #{signature.header.content_type}"
return
end
@@ -436,7 +436,7 @@ private
end
chunks
- elsif m.header.content_type.downcase == "message/rfc822"
+ elsif m.header.content_type && m.header.content_type.downcase == "message/rfc822"
if m.body
payload = RMail::Parser.read(m.body)
from = payload.header.from.first ? payload.header.from.first.format : ""
@@ -456,7 +456,7 @@ private
debug "no body for message/rfc822 enclosure; skipping"
[]
end
- elsif m.header.content_type.downcase == "application/pgp" && m.body
+ elsif m.header.content_type && m.header.content_type.downcase == "application/pgp" && m.body
## apparently some versions of Thunderbird generate encryped email that
## does not follow RFC3156, e.g. messages with X-Enigmail-Version: 0.95.0
## they have no MIME multipart and just set the body content type to