Results for: "tally"

Raises an HTTP error if the response is not 2xx (success).

Sends a STARTTLS command to start TLS session.

Sends the GETQUOTAROOT command along with the specified mailbox. This command is generally available to both admin and user. If this mailbox exists, it returns an array containing objects of type Net::IMAP::MailboxQuotaRoot and Net::IMAP::MailboxQuota.

Sends the GETQUOTA command along with specified mailbox. If this mailbox exists, then an array containing a Net::IMAP::MailboxQuota object is returned. This command is generally only available to server admin.

Sends a SETQUOTA command along with the specified mailbox and quota. If quota is nil, then quota will be unset for that mailbox. Typically one needs to be logged in as a server admin for this to work. The IMAP quota commands are described in [RFC-2087].

Sends the SETACL command along with mailbox, user and the rights that user is to have on that mailbox. If rights is nil, then that user will be stripped of any rights to that mailbox. The IMAP ACL commands are described in [RFC-2086].

Send the GETACL command along with a specified mailbox. If this mailbox exists, an array containing objects of Net::IMAP::MailboxACLItem will be returned.

Sends a STATUS command, and returns the status of the indicated mailbox. attr is a list of one or more attributes whose statuses are to be requested. Supported attributes include:

MESSAGES:: the number of messages in the mailbox.
RECENT:: the number of recent messages in the mailbox.
UNSEEN:: the number of unseen messages in the mailbox.

The return value is a hash of attributes. For example:

p imap.status("inbox", ["MESSAGES", "RECENT"])
#=> {"RECENT"=>0, "MESSAGES"=>44}

A Net::IMAP::NoResponseError is raised if status values for mailbox cannot be returned; for instance, because it does not exist.

Creates a new POP3 object and open the connection. Equivalent to

Net::POP3.new(address, port, isapop).start(account, password)

If block is provided, yields the newly-opened POP3 object to it, and automatically closes it at the end of the session.

Example

Net::POP3.start(addr, port, account, password) do |pop|
  pop.each_mail do |m|
    file.write m.pop
    m.delete
  end
end

true if the POP3 session has started.

Starts a POP3 session.

When called with block, gives a POP3 object to the block and closes the session after block call finishes.

This method raises a POPAuthenticationError if authentication fails.

Returns truth value if this object uses STARTTLS. If this object always uses STARTTLS, returns :always. If this object uses STARTTLS when the server support TLS, returns :auto.

Creates a new Net::SMTP object and connects to the server.

This method is equivalent to:

Net::SMTP.new(address, port).start(helo: helo_domain, user: account, secret: password, authtype: authtype, tls_verify: flag, tls_hostname: hostname)

Example

Net::SMTP.start('your.smtp.server') do |smtp|
  smtp.send_message msgstr, 'from@example.com', ['dest@example.com']
end

Block Usage

If called with a block, the newly-opened Net::SMTP object is yielded to the block, and automatically closed when the block finishes. If called without a block, the newly-opened Net::SMTP object is returned to the caller, and it is the caller’s responsibility to close it when finished.

Parameters

address is the hostname or ip address of your smtp server.

port is the port to connect to; it defaults to port 25.

helo is the HELO domain provided by the client to the server (see overview comments); it defaults to ‘localhost’.

The remaining arguments are used for SMTP authentication, if required or desired. user is the account name; secret is your password or other authentication token; and authtype is the authentication type, one of :plain, :login, or :cram_md5. See the discussion of SMTP Authentication in the overview notes. If tls_verify is true, verify the server’s certificate. The default is true. If the hostname in the server certificate is different from address, it can be specified with tls_hostname.

Errors

This method may raise:

true if the SMTP session has been started.

Opens a TCP connection and starts the SMTP session.

Parameters

helo is the HELO domain that you’ll dispatch mails from; see the discussion in the overview notes.

If both of user and secret are given, SMTP authentication will be attempted using the AUTH command. authtype specifies the type of authentication to attempt; it must be one of :login, :plain, and :cram_md5. See the notes on SMTP Authentication in the overview. If tls_verify is true, verify the server’s certificate. The default is true. If the hostname in the server certificate is different from address, it can be specified with tls_hostname.

Block Usage

When this methods is called with a block, the newly-started SMTP object is yielded to the block, and automatically closed after the block call finishes. Otherwise, it is the caller’s responsibility to close the session when finished.

Example

This is very similar to the class method SMTP.start.

require 'net/smtp'
smtp = Net::SMTP.new('smtp.mail.server', 25)
smtp.start(helo: helo_domain, user: account, secret: password, authtype: authtype) do |smtp|
  smtp.send_message msgstr, 'from@example.com', ['dest@example.com']
end

The primary use of this method (as opposed to SMTP.start) is probably to set debugging (set_debug_output) or ESMTP (esmtp=), which must be done before the session is started.

Errors

If session has already been started, an IOError will be raised.

This method may raise:

No documentation available

This method sends a message. If msgstr is given, sends it as a message. If block is given, yield a message writer stream. You must write message before the block is closed.

# Example 1 (by string)
smtp.data(<<EndMessage)
From: john@example.com
To: betty@example.com
Subject: I found a bug

Check vm.c:58879.
EndMessage

# Example 2 (by block)
smtp.data {|f|
  f.puts "From: john@example.com"
  f.puts "To: betty@example.com"
  f.puts "Subject: I found a bug"
  f.puts ""
  f.puts "Check vm.c:58879."
}
No documentation available
No documentation available
No documentation available
No documentation available
No documentation available
No documentation available
No documentation available
No documentation available
Search took: 2ms  ·  Total Results: 1166