bin/rumble in rumble-0.7.0 vs bin/rumble in rumble-0.8.0
- old
+ new
@@ -1,7 +1,7 @@
#!/usr/bin/env ruby
-# Copyright (c) 2018-2022 Yegor Bugayenko
+# Copyright (c) 2018-2024 Yegor Bugayenko
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the 'Software'), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@@ -21,11 +21,10 @@
STDOUT.sync = true
require 'slop'
require 'mail'
-require 'net/smtp/proxy'
require_relative '../lib/rumble'
require_relative '../lib/rumble/version'
require_relative '../lib/rumble/cli'
begin
@@ -97,35 +96,19 @@
raise '--host is required' unless opts[:host]
raise '--port is required' unless opts[:port]
raise '--user is required' unless opts[:user]
raise '--password is required' unless opts[:password]
from = Mail::Address.new(opts[:from])
- if opts[:proxy]
- scheme, host, port = opts[:proxy].strip.split(':')
- delivery_method Net::SMTP::Proxy::DeliveryMethod, {
- domain: from.domain,
- address: opts[:host],
- port: opts[:port],
- proxy_address: "#{scheme}://#{host}",
- proxy_port: port.to_i,
- authentication: 'plain',
- openssl_verify_mode: OpenSSL::SSL::VERIFY_NONE,
- enable_starttls_auto: true,
- enable_starttls: true,
- user_name: opts[:user],
- password: opts[:password]
- }
- else
- delivery_method :smtp, {
- domain: from.domain,
- address: opts[:host],
- port: opts[:port],
- user_name: opts[:user],
- password: opts[:password],
- enable_starttls: true,
- enable_starttls_auto: true
- }
- end
+ raise 'The --proxy option is not supporte' if opts[:proxy]
+ delivery_method :smtp, {
+ domain: from.domain,
+ address: opts[:host],
+ port: opts[:port],
+ user_name: opts[:user],
+ password: opts[:password],
+ enable_starttls: true,
+ enable_starttls_auto: true
+ }
else
raise "Delivery method #{opts[:method]} is not supported"
end
end
Rumble::CLI.new(opts).send