migrate lib/tasks/mail.rake for MidiSmtpServer 3

see https://midi-smtp-server.readthedocs.io/appendix_upgrade/
This commit is contained in:
JuliusR 2021-12-18 15:24:08 +01:00
parent c7a74c8e7d
commit 952aecfb40

View file

@ -101,10 +101,10 @@ namespace :mail do
desc "Start STMP server for incoming email (options: SMTP_SERVER_PORT=2525, SMTP_SERVER_HOST=127.0.0.1)" desc "Start STMP server for incoming email (options: SMTP_SERVER_PORT=2525, SMTP_SERVER_HOST=127.0.0.1)"
task :smtp_server => :environment do task :smtp_server => :environment do
port = (ENV['SMTP_SERVER_PORT'] || 2525).to_i port = ENV['SMTP_SERVER_PORT'] || '2525'
host = ENV['SMTP_SERVER_HOST'] || '127.0.0.1' host = ENV['SMTP_SERVER_HOST'] || '127.0.0.1'
rake_say "Started SMTP server for incoming email on #{host}:#{port}." rake_say "Started SMTP server for incoming email on #{host}:#{port}."
server = ReplyEmailSmtpServer.new(port, host) server = ReplyEmailSmtpServer.new(ports: port, hosts: host)
server.start server.start
server.join server.join
end end