@@ -672,31 +672,64 @@ class Envelope < Struct.new(:date, :subject, :from, :sender, :reply_to,
672
672
# call-seq: date -> string
673
673
#
674
674
# Returns a string that represents the +Date+ header.
675
+ #
676
+ # [Note]
677
+ # For a well-formed [RFC5322[https://tools.ietf.org/html/rfc5322]]
678
+ # message, the #date field must not be +nil+. However it can be +nil+
679
+ # for a malformed or draft message.
675
680
676
681
##
677
682
# method: subject
678
683
# call-seq: subject -> string or nil
679
684
#
680
685
# Returns a string that represents the +Subject+ header, if it is present.
686
+ #
687
+ # [Note]
688
+ # Servers should return +nil+ when the header is absent and an empty
689
+ # string when it is present but empty. Some servers may return a +nil+
690
+ # envelope member in the "present but empty" case. Clients should treat
691
+ # +nil+ and empty string as identical.
681
692
682
693
##
683
694
# method: from
684
695
# call-seq: from -> array of Net::IMAP::Address or nil
685
696
#
686
697
# Returns an array of Address that represents the +From+ header.
698
+ #
699
+ # If the +From+ header is absent, or is present but empty, the server
700
+ # returns +nil+ for this envelope field.
701
+ #
702
+ # [Note]
703
+ # For a well-formed [RFC5322[https://tools.ietf.org/html/rfc5322]]
704
+ # message, the #from field must not be +nil+. However it can be +nil+
705
+ # for a malformed or draft message.
687
706
688
707
##
689
708
# method: sender
690
709
# call-seq: sender -> array of Net::IMAP::Address or nil
691
710
#
692
711
# Returns an array of Address that represents the +Sender+ header.
712
+ #
713
+ # [Note]
714
+ # If the <tt>Sender</tt> header is absent, or is present but empty, the
715
+ # server sets this field to be the same value as #from. Therefore, in a
716
+ # well-formed [RFC5322[https://tools.ietf.org/html/rfc5322]] message,
717
+ # the #sender envelope field must not be +nil+. However it can be
718
+ # +nil+ for a malformed or draft message.
693
719
694
720
##
695
721
# method: reply_to
696
722
# call-seq: reply_to -> array of Net::IMAP::Address or nil
697
723
#
698
724
# Returns an array of Address that represents the <tt>Reply-To</tt>
699
725
# header.
726
+ #
727
+ # [Note]
728
+ # If the <tt>Reply-To</tt> header is absent, or is present but empty,
729
+ # the server sets this field to be the same value as #from. Therefore,
730
+ # in a well-formed [RFC5322[https://tools.ietf.org/html/rfc5322]]
731
+ # message, the #reply_to envelope field must not be +nil+. However it
732
+ # can be +nil+ for a malformed or draft message.
700
733
701
734
##
702
735
# method: to
@@ -721,12 +754,32 @@ class Envelope < Struct.new(:date, :subject, :from, :sender, :reply_to,
721
754
# call-seq: in_reply_to -> string
722
755
#
723
756
# Returns a string that represents the <tt>In-Reply-To</tt> header.
757
+ #
758
+ # [Note]
759
+ # For a well-formed [RFC5322[https://tools.ietf.org/html/rfc5322]]
760
+ # message, the #in_reply_to field, if present, must not be empty. But
761
+ # it can still return an empty string for malformed messages.
762
+ #
763
+ # Servers should return +nil+ when the header is absent and an empty
764
+ # string when it is present but empty. Some servers may return a +nil+
765
+ # envelope member in the "present but empty" case. Clients should treat
766
+ # +nil+ and empty string as identical.
724
767
725
768
##
726
769
# method: message_id
727
770
# call-seq: message_id -> string
728
771
#
729
772
# Returns a string that represents the <tt>Message-ID</tt>.
773
+ #
774
+ # [Note]
775
+ # For a well-formed [RFC5322[https://tools.ietf.org/html/rfc5322]]
776
+ # message, the #message_id field, if present, must not be empty. But it
777
+ # can still return an empty string for malformed messages.
778
+ #
779
+ # Servers should return +nil+ when the header is absent and an empty
780
+ # string when it is present but empty. Some servers may return a +nil+
781
+ # envelope member in the "present but empty" case. Clients should treat
782
+ # +nil+ and empty string as identical.
730
783
end
731
784
732
785
#
0 commit comments