]> git.openstreetmap.org Git - rails.git/blobdiff - script/deliver-message
Update Potlatch 2 to 2.3-208-g7b7f802 build
[rails.git] / script / deliver-message
index b6c679b0a6cf3e863f9e765eed61d78915f6bb09..669e54a667fef1459b1e9c206d76c8affc4333f7 100755 (executable)
@@ -23,13 +23,16 @@ mail = Mail.new(STDIN.readlines.join)
 if mail.multipart?
   body = mail.html_part || mail.text_part
 else
-  body = mail.body
+  body = mail
 end
 
-message = Message.new(:sender => from, :recipient => to,
-                      :sent_on => mail.date.new_offset(0),
-                      :title => mail.subject.sub(/\[OpenStreetMap\] */, ""),
-                      :body => body.decoded)
+message = Message.new({
+  :sender => from,
+  :recipient => to,
+  :sent_on => mail.date.new_offset(0),
+  :title => mail.subject.sub(/\[OpenStreetMap\] */, ""),
+  :body => body.decoded
+}, :without_protection => true)
 message.save!
 
 Notifier.message_notification(message).deliver