Class: MailAutoconfig::Server
- Inherits:
-
Object
- Object
- MailAutoconfig::Server
- Defined in:
- lib/mail_autoconfig/server.rb
Overview
Superclass for IncomingServer and OutgoingServer. Never used directly.
Direct Known Subclasses
Instance Attribute Summary (collapse)
-
- (Object) config
readonly
Returns the value of attribute config.
Instance Method Summary (collapse)
-
- (String) authentication
The authentication type for this server.
-
- (String) hostname
The hostname for this server.
-
- (Server) initialize(config)
constructor
A new instance of Server.
-
- (Integer) port
The port to connect ot this server on.
-
- (String) protocol
Returns the protocol of the mail server e.g.
-
- (String) socket_type
The connection type for this server.
-
- (String) username
Return the username format for this server.
Constructor Details
- (Server) initialize(config)
Returns a new instance of Server
9 10 11 |
# File 'lib/mail_autoconfig/server.rb', line 9 def initialize(config) @config = config end |
Instance Attribute Details
- (Object) config (readonly)
Returns the value of attribute config
6 7 8 |
# File 'lib/mail_autoconfig/server.rb', line 6 def config @config end |
Instance Method Details
- (String) authentication
The authentication type for this server. Valid responses:
password-cleartext
, NTLM
, GSSAPI
, client-IP-address
, TLS-client-cert
, none
49 50 51 |
# File 'lib/mail_autoconfig/server.rb', line 49 def authentication @authentication ||= config.xpath('authentication').first.content end |
- (String) hostname
Returns The hostname for this server
20 21 22 |
# File 'lib/mail_autoconfig/server.rb', line 20 def hostname @hostname ||= config.xpath('hostname').first.content end |
- (Integer) port
Returns The port to connect ot this server on
25 26 27 |
# File 'lib/mail_autoconfig/server.rb', line 25 def port @port ||= config.xpath('port').first.content.to_i end |
- (String) protocol
Returns the protocol of the mail server e.g. smtp
, pop3
, imap
15 16 17 |
# File 'lib/mail_autoconfig/server.rb', line 15 def protocol @protocol ||= config.attr('type') end |
- (String) socket_type
The connection type for this server. plain
, STARTTLS
, SSL
are acceptable
31 32 33 |
# File 'lib/mail_autoconfig/server.rb', line 31 def socket_type @socket_type ||= config.xpath('socketType').first.content end |
- (String) username
Return the username format for this server. There are substitutions that can be made.
%EMAILADDRESS%
- full email address of the user, usually entered by the user%EMAILLOCALPART%
- email address, part before @%EMAILDOMAIN%
- email address, part after @
42 43 44 |
# File 'lib/mail_autoconfig/server.rb', line 42 def username @username ||= config.xpath('username').first.content end |