Sha256: 1cd91d1791c407dc0ce3aab446a6fbd83af4acaeede41a99ce0903630d5950e5
Contents?: true
Size: 726 Bytes
Versions: 1
Compression:
Stored size: 726 Bytes
Contents
module Email; end class Email::Provider def self.for_address(address) case when address.end_with?("@fastmail.com") new(:fastmail) when address.end_with?("@gmail.com") new(:gmail) when address.end_with?("@fastmail.fm") new(:fastmail) else new(:default) end end attr_reader :provider def initialize(provider) @provider = provider end def options case provider when :gmail {port: 993, ssl: {ssl_version: :TLSv1_2}} when :fastmail {port: 993, ssl: true} else {port: 993, ssl: true} end end def host case provider when :gmail "imap.gmail.com" when :fastmail "imap.fastmail.com" end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
imap-backup-2.0.0.rc3 | lib/email/provider.rb |