class Net::IMAP::Envelope - net-imap: Ruby Standard Library Documentation

# class Net::IMAP::Envelope

`Net::IMAP::Envelope` represents envelope structures of messages.

Note

  When the `sender` and `reply_to` fields are absent or empty, they will return the same value as `from`. Also, fields may return values that are invalid for well-formed [RFC5322] messages when the message is malformed or a draft message.

See [IMAP4rev1 §7.4.2] and [IMAP4rev2 §7.5.2] for full description of the envelope fields, and Message envelope and body structure at `Net::IMAP` for other relevant RFCs.

Returned by `FetchData#envelope`

### Public Instance Methods

bcc → array of Net::IMAP::Address click to toggle source

Returns an array of `Address` that represents the `Bcc` header.

    # File net-imap-0.5.4/lib/net/imap/response_data.rb, line 655

cc → array of Net::IMAP::Address click to toggle source

Returns an array of `Address` that represents the `Cc` header.

    # File net-imap-0.5.4/lib/net/imap/response_data.rb, line 649

date → string click to toggle source

Returns a string that represents the `Date` header.

Note

  For a well-formed [RFC5322] message, the `date` field must not be `nil`. However it can be `nil` for a malformed or draft message.

    # File net-imap-0.5.4/lib/net/imap/response_data.rb, line 579

from → array of Net::IMAP::Address or nil click to toggle source

Returns an array of `Address` that represents the `From` header.

If the `From` header is absent, or is present but empty, the server returns `nil` for this envelope field.

Note

  For a well-formed [RFC5322] message, the `from` field must not be `nil`. However it can be `nil` for a malformed or draft message.

    # File net-imap-0.5.4/lib/net/imap/response_data.rb, line 602

in_reply_to → string click to toggle source

Returns a string that represents the `In-Reply-To` header.

Note

  For a well-formed [RFC5322] message, the `in_reply_to` field, if present, must not be empty. But it can still return an empty string for malformed messages.

  Servers should return `nil` when the header is absent and an empty string when it is present but empty. Some servers may return a `nil` envelope member in the “present but empty” case. Clients should treat `nil` and empty string as identical.

    # File net-imap-0.5.4/lib/net/imap/response_data.rb, line 661

message_id → string click to toggle source

Returns a string that represents the `Message-ID`.

Note

  For a well-formed [RFC5322] message, the `message_id` field, if present, must not be empty. But it can still return an empty string for malformed messages.

  Servers should return `nil` when the header is absent and an empty string when it is present but empty. Some servers may return a `nil` envelope member in the “present but empty” case. Clients should treat `nil` and empty string as identical.

    # File net-imap-0.5.4/lib/net/imap/response_data.rb, line 677

reply_to → array of Net::IMAP::Address or nil click to toggle source

Returns an array of `Address` that represents the `Reply-To` header.

Note

  If the `Reply-To` header is absent, or is present but empty, the server sets this field to be the same value as `from`. Therefore, in a well-formed [RFC5322] message, the `reply_to` envelope field must not be `nil`. However it can be `nil` for a malformed or draft message.

    # File net-imap-0.5.4/lib/net/imap/response_data.rb, line 629

sender → array of Net::IMAP::Address or nil click to toggle source

Returns an array of `Address` that represents the `Sender` header.

Note

  If the `Sender` header is absent, or is present but empty, the server sets this field to be the same value as `from`. Therefore, in a well-formed [RFC5322] message, the `sender` envelope field must not be `nil`. However it can be `nil` for a malformed or draft message.

    # File net-imap-0.5.4/lib/net/imap/response_data.rb, line 616

subject → string or nil click to toggle source

Returns a string that represents the `Subject` header, if it is present.

Note

  Servers should return `nil` when the header is absent and an empty string when it is present but empty. Some servers may return a `nil` envelope member in the “present but empty” case. Clients should treat `nil` and empty string as identical.

    # File net-imap-0.5.4/lib/net/imap/response_data.rb, line 590

to → array of Net::IMAP::Address click to toggle source

Returns an array of `Address` that represents the `To` header.

    # File net-imap-0.5.4/lib/net/imap/response_data.rb, line 643