2014-02-03 19:23:00 +00:00
|
|
|
# Copyright (C) 2012-2014 Zammad Foundation, http://zammad-foundation.org/
|
2013-06-12 15:59:58 +00:00
|
|
|
|
2015-08-28 00:53:14 +00:00
|
|
|
class Channel::Driver::MailStdin < Channel::EmailParser
|
2015-09-02 07:14:48 +00:00
|
|
|
|
|
|
|
=begin
|
|
|
|
|
|
|
|
process emails from STDIN
|
|
|
|
|
|
|
|
cat /path/to/mail.eml | rails r 'Channel::Driver::MailStdin.new'
|
|
|
|
|
|
|
|
=end
|
|
|
|
|
2012-11-07 22:18:31 +00:00
|
|
|
def initialize
|
2015-05-04 19:34:04 +00:00
|
|
|
Rails.logger.info 'read main from STDIN'
|
2012-11-07 22:18:31 +00:00
|
|
|
|
|
|
|
msg = ARGF.read
|
|
|
|
|
|
|
|
process( {}, msg )
|
|
|
|
end
|
2013-06-12 15:59:58 +00:00
|
|
|
end
|