Sha256: 285e48779d26568ae7c289b2cc5fec6e8e93062c2e7f063265ccde7d3f40ac3a
Contents?: true
Size: 644 Bytes
Versions: 18
Compression:
Stored size: 644 Bytes
Contents
module Email; end class Email::Provider GMAIL_IMAP_SERVER = "imap.gmail.com".freeze 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 {port: 993, ssl: {ssl_version: :TLSv1_2}} end def host case provider when :gmail GMAIL_IMAP_SERVER when :fastmail "imap.fastmail.com" end end end
Version data entries
18 entries across 18 versions & 1 rubygems