Move SMTP server from messages plugin into core

This commit is contained in:
Patrick Gansterer 2017-08-19 15:45:48 +02:00
parent 2264351cf5
commit 7d594bf391
9 changed files with 117 additions and 92 deletions

View file

@ -43,6 +43,21 @@ namespace :foodsoft do
rake_say "created until #{created_until}"
end
end
desc "Parse incoming email on stdin (options: RECIPIENT=foodcoop.handling)"
task :parse_reply_email => :environment do
FoodsoftMailReceiver.received ENV['RECIPIENT'], STDIN.read
end
desc "Start STMP server for incoming email (options: SMTP_SERVER_PORT=2525, SMTP_SERVER_HOST=0.0.0.0)"
task :reply_email_smtp_server => :environment do
port = ENV['SMTP_SERVER_PORT'].present? ? ENV['SMTP_SERVER_PORT'].to_i : 2525
host = ENV['SMTP_SERVER_HOST']
rake_say "Started SMTP server for incoming email on port #{port}."
server = FoodsoftMailReceiver.new port, host
server.start
server.join
end
end
# Helper