Wakes up the first thread in line waiting for this lock.
A setter to toggle transfers in binary mode. newmode
is either true
or false
Puts the connection into binary (image) mode, issues the given command, and fetches the data returned, passing it to the associated block in chunks of blocksize
characters. Note that cmd
is a server command (such as “RETR myfile”).
Puts the connection into binary (image) mode, issues the given server-side command (such as “STOR myfile”), and sends the contents of the file named file
to the server. If the optional block is given, it also passes it the data, in chunks of blocksize
characters.
Retrieves remotefile
in binary mode, storing the result in localfile
. If localfile
is nil, returns retrieved data. If a block is supplied, it is passed the retrieved data in blocksize
chunks.
Transfers localfile
to the server in binary mode, storing the result in remotefile
. If a block is supplied, calls it, passing in the transmitted data in blocksize
chunks.
Returns the last modification time of the (remote) file. If local
is true
, it is returned as a local time, otherwise it’s a UTC time.
Returns the status (STAT command). pathname - when stat is invoked with pathname as a parameter it acts like
list but alot faster and over the same tcp session.
Sends a CAPABILITY command, and returns an array of capabilities that the server supports. Each capability is a string. See [IMAP] for a list of possible capabilities.
Note that the Net::IMAP
class does not modify its behaviour according to the capabilities of the server; it is up to the user of the class to ensure that a certain capability is supported by a server before using it.
Sends a EXAMINE command to select a mailbox
so that messages in the mailbox
can be accessed. Behaves the same as select()
, except that the selected mailbox
is identified as read-only.
A Net::IMAP::NoResponseError
is raised if the mailbox does not exist or is for some reason non-examinable.
Sends a CREATE command to create a new mailbox
.
A Net::IMAP::NoResponseError
is raised if a mailbox with that name cannot be created.
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.
Similar to search()
, but returns message sequence numbers in threaded format, as a Net::IMAP::ThreadMember
tree. The supported algorithms are:
split into single-level threads according to subject, ordered by date.
split into threads by parent/child relationships determined by which message is a reply to which.
Unlike search()
, charset
is a required argument. US-ASCII and UTF-8 are sample values.
See [SORT-THREAD-EXT] for more details.
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." }
Adds sw
according to sopts
, lopts
and nlopts
.
sw
OptionParser::Switch
instance to be added.
sopts
Short style option list.
lopts
Long style option list.
nlopts
Negated long style options list.
Completion
for hash key.
Default stringizing method to emit standard error message.
Sets the resolver timeouts. This may be a single positive number or an array of positive numbers representing timeouts in seconds. If an array is specified, a DNS
request will retry and wait for each successive interval in the array until a successful response is received. Specifying nil
reverts to the default timeouts:
Example:
dns.timeouts = 3
Creates a new IPv6
address from arg
which may be:
IPv6
returns arg
.
arg
must match one of the IPv6::Regex* constants
Sets the element of which this object is an attribute. Normally, this is not directly called.
Returns this attribute
Sets the parent of this child to the supplied argument.
Must be a Parent
object. If this object is the same object as the existing parent of this child, no action is taken. Otherwise, this child is removed from the current parent (if one exists), and is added to the new parent.
The parent added
the document this child belongs to, or nil if this child
belongs to no document