trabajo-afectivo/app/models/channel/driver/mail_stdin.rb

29 lines
594 B
Ruby
Raw Normal View History

2016-10-19 03:11:36 +00:00
# Copyright (C) 2012-2016 Zammad Foundation, http://zammad-foundation.org/
2015-08-28 00:53:14 +00:00
class Channel::Driver::MailStdin < Channel::EmailParser
=begin
process emails from STDIN
cat /path/to/mail.eml | rails r 'Channel::Driver::MailStdin.new'
e. g.
cat test/data/mail/mail001.box | rails r 'Channel::Driver::MailStdin.new'
e. g. if you want to trust on mail headers
cat test/data/mail/mail001.box | rails r 'Channel::Driver::MailStdin.new(trusted: true)'
=end
def initialize(params = {})
2015-05-04 19:34:04 +00:00
Rails.logger.info 'read main from STDIN'
msg = ARGF.read
process(params, msg)
end
end