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
14 message = Message.find(recipient[2])
15 digest = message.digest
16 from = message.recipient
18 subject = message.subject.sub(/\[OpenStreetMap\] */, "")
21 exit 0 unless recipient[3] == digest[0,6]
23 mail = TMail::Mail.parse(STDIN.readlines.join)
25 message = Message.new(:sender => from, :recipient => to,
26 :sent_on => Time.now.getutc,
31 Notifier::deliver_message_notification(message)