3 require File.dirname(__FILE__) + '/../config/environment'
6 exit 0 unless recipient = ARGV[0].match(/^([cm])-(\d+)-(.*)$/)
9 comment = DiaryComment.find(recipient[2])
10 digest = comment.digest
11 from = comment.diary_entry.user
13 subject = mail.subject
15 message = Message.find(recipient[2])
16 digest = message.digest
17 from = message.recipient
19 subject = mail.subject.sub(/\[OpenStreetMap\] */, "")
22 exit 0 unless recipient[3] == digest[0,6]
24 mail = TMail::Mail.parse(STDIN.readlines.join)
26 message = Message.new(:sender => from, :recipient => to,
27 :sent_on => Time.now.getutc,
32 Notifier::deliver_message_notification(message)