rack-mail_exception 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.document +5 -0
- data/.gitignore +22 -0
- data/LICENSE +20 -0
- data/README.rdoc +38 -0
- data/Rakefile +56 -0
- data/VERSION +1 -0
- data/lib/rack/mail_exception.rb +103 -0
- data/test/helper.rb +13 -0
- data/test/test_rack_mail_exception.rb +93 -0
- data/vendor/mail/.bundle/config +2 -0
- data/vendor/mail/CHANGELOG.rdoc +370 -0
- data/vendor/mail/Dependencies.txt +3 -0
- data/vendor/mail/Gemfile +17 -0
- data/vendor/mail/README.rdoc +572 -0
- data/vendor/mail/ROADMAP +92 -0
- data/vendor/mail/Rakefile +41 -0
- data/vendor/mail/TODO.rdoc +9 -0
- data/vendor/mail/lib/mail.rb +76 -0
- data/vendor/mail/lib/mail/attachments_list.rb +99 -0
- data/vendor/mail/lib/mail/body.rb +287 -0
- data/vendor/mail/lib/mail/configuration.rb +67 -0
- data/vendor/mail/lib/mail/core_extensions/blank.rb +26 -0
- data/vendor/mail/lib/mail/core_extensions/nil.rb +11 -0
- data/vendor/mail/lib/mail/core_extensions/string.rb +27 -0
- data/vendor/mail/lib/mail/elements.rb +14 -0
- data/vendor/mail/lib/mail/elements/address.rb +306 -0
- data/vendor/mail/lib/mail/elements/address_list.rb +74 -0
- data/vendor/mail/lib/mail/elements/content_disposition_element.rb +30 -0
- data/vendor/mail/lib/mail/elements/content_location_element.rb +25 -0
- data/vendor/mail/lib/mail/elements/content_transfer_encoding_element.rb +24 -0
- data/vendor/mail/lib/mail/elements/content_type_element.rb +35 -0
- data/vendor/mail/lib/mail/elements/date_time_element.rb +26 -0
- data/vendor/mail/lib/mail/elements/envelope_from_element.rb +34 -0
- data/vendor/mail/lib/mail/elements/message_ids_element.rb +29 -0
- data/vendor/mail/lib/mail/elements/mime_version_element.rb +26 -0
- data/vendor/mail/lib/mail/elements/phrase_list.rb +21 -0
- data/vendor/mail/lib/mail/elements/received_element.rb +30 -0
- data/vendor/mail/lib/mail/encodings.rb +258 -0
- data/vendor/mail/lib/mail/encodings/7bit.rb +31 -0
- data/vendor/mail/lib/mail/encodings/8bit.rb +31 -0
- data/vendor/mail/lib/mail/encodings/base64.rb +33 -0
- data/vendor/mail/lib/mail/encodings/binary.rb +31 -0
- data/vendor/mail/lib/mail/encodings/quoted_printable.rb +38 -0
- data/vendor/mail/lib/mail/encodings/transfer_encoding.rb +58 -0
- data/vendor/mail/lib/mail/envelope.rb +35 -0
- data/vendor/mail/lib/mail/field.rb +223 -0
- data/vendor/mail/lib/mail/field_list.rb +33 -0
- data/vendor/mail/lib/mail/fields.rb +35 -0
- data/vendor/mail/lib/mail/fields/bcc_field.rb +56 -0
- data/vendor/mail/lib/mail/fields/cc_field.rb +55 -0
- data/vendor/mail/lib/mail/fields/comments_field.rb +41 -0
- data/vendor/mail/lib/mail/fields/common/address_container.rb +16 -0
- data/vendor/mail/lib/mail/fields/common/common_address.rb +125 -0
- data/vendor/mail/lib/mail/fields/common/common_date.rb +42 -0
- data/vendor/mail/lib/mail/fields/common/common_field.rb +50 -0
- data/vendor/mail/lib/mail/fields/common/common_message_id.rb +43 -0
- data/vendor/mail/lib/mail/fields/common/parameter_hash.rb +52 -0
- data/vendor/mail/lib/mail/fields/content_description_field.rb +19 -0
- data/vendor/mail/lib/mail/fields/content_disposition_field.rb +69 -0
- data/vendor/mail/lib/mail/fields/content_id_field.rb +63 -0
- data/vendor/mail/lib/mail/fields/content_location_field.rb +42 -0
- data/vendor/mail/lib/mail/fields/content_transfer_encoding_field.rb +50 -0
- data/vendor/mail/lib/mail/fields/content_type_field.rb +185 -0
- data/vendor/mail/lib/mail/fields/date_field.rb +55 -0
- data/vendor/mail/lib/mail/fields/from_field.rb +55 -0
- data/vendor/mail/lib/mail/fields/in_reply_to_field.rb +55 -0
- data/vendor/mail/lib/mail/fields/keywords_field.rb +44 -0
- data/vendor/mail/lib/mail/fields/message_id_field.rb +83 -0
- data/vendor/mail/lib/mail/fields/mime_version_field.rb +53 -0
- data/vendor/mail/lib/mail/fields/optional_field.rb +13 -0
- data/vendor/mail/lib/mail/fields/received_field.rb +67 -0
- data/vendor/mail/lib/mail/fields/references_field.rb +55 -0
- data/vendor/mail/lib/mail/fields/reply_to_field.rb +55 -0
- data/vendor/mail/lib/mail/fields/resent_bcc_field.rb +55 -0
- data/vendor/mail/lib/mail/fields/resent_cc_field.rb +55 -0
- data/vendor/mail/lib/mail/fields/resent_date_field.rb +35 -0
- data/vendor/mail/lib/mail/fields/resent_from_field.rb +55 -0
- data/vendor/mail/lib/mail/fields/resent_message_id_field.rb +34 -0
- data/vendor/mail/lib/mail/fields/resent_sender_field.rb +62 -0
- data/vendor/mail/lib/mail/fields/resent_to_field.rb +55 -0
- data/vendor/mail/lib/mail/fields/return_path_field.rb +64 -0
- data/vendor/mail/lib/mail/fields/sender_field.rb +67 -0
- data/vendor/mail/lib/mail/fields/structured_field.rb +51 -0
- data/vendor/mail/lib/mail/fields/subject_field.rb +16 -0
- data/vendor/mail/lib/mail/fields/to_field.rb +55 -0
- data/vendor/mail/lib/mail/fields/unstructured_field.rb +166 -0
- data/vendor/mail/lib/mail/header.rb +262 -0
- data/vendor/mail/lib/mail/mail.rb +234 -0
- data/vendor/mail/lib/mail/message.rb +1867 -0
- data/vendor/mail/lib/mail/network.rb +9 -0
- data/vendor/mail/lib/mail/network/delivery_methods/file_delivery.rb +40 -0
- data/vendor/mail/lib/mail/network/delivery_methods/sendmail.rb +62 -0
- data/vendor/mail/lib/mail/network/delivery_methods/smtp.rb +110 -0
- data/vendor/mail/lib/mail/network/delivery_methods/test_mailer.rb +40 -0
- data/vendor/mail/lib/mail/network/retriever_methods/imap.rb +18 -0
- data/vendor/mail/lib/mail/network/retriever_methods/pop3.rb +149 -0
- data/vendor/mail/lib/mail/parsers/address_lists.rb +64 -0
- data/vendor/mail/lib/mail/parsers/address_lists.treetop +19 -0
- data/vendor/mail/lib/mail/parsers/content_disposition.rb +387 -0
- data/vendor/mail/lib/mail/parsers/content_disposition.treetop +46 -0
- data/vendor/mail/lib/mail/parsers/content_location.rb +139 -0
- data/vendor/mail/lib/mail/parsers/content_location.treetop +20 -0
- data/vendor/mail/lib/mail/parsers/content_transfer_encoding.rb +162 -0
- data/vendor/mail/lib/mail/parsers/content_transfer_encoding.treetop +20 -0
- data/vendor/mail/lib/mail/parsers/content_type.rb +539 -0
- data/vendor/mail/lib/mail/parsers/content_type.treetop +58 -0
- data/vendor/mail/lib/mail/parsers/date_time.rb +114 -0
- data/vendor/mail/lib/mail/parsers/date_time.treetop +11 -0
- data/vendor/mail/lib/mail/parsers/envelope_from.rb +194 -0
- data/vendor/mail/lib/mail/parsers/envelope_from.treetop +32 -0
- data/vendor/mail/lib/mail/parsers/message_ids.rb +45 -0
- data/vendor/mail/lib/mail/parsers/message_ids.treetop +15 -0
- data/vendor/mail/lib/mail/parsers/mime_version.rb +144 -0
- data/vendor/mail/lib/mail/parsers/mime_version.treetop +19 -0
- data/vendor/mail/lib/mail/parsers/phrase_lists.rb +45 -0
- data/vendor/mail/lib/mail/parsers/phrase_lists.treetop +15 -0
- data/vendor/mail/lib/mail/parsers/received.rb +71 -0
- data/vendor/mail/lib/mail/parsers/received.treetop +11 -0
- data/vendor/mail/lib/mail/parsers/rfc2045.rb +464 -0
- data/vendor/mail/lib/mail/parsers/rfc2045.treetop +36 -0
- data/vendor/mail/lib/mail/parsers/rfc2822.rb +5318 -0
- data/vendor/mail/lib/mail/parsers/rfc2822.treetop +410 -0
- data/vendor/mail/lib/mail/parsers/rfc2822_obsolete.rb +3757 -0
- data/vendor/mail/lib/mail/parsers/rfc2822_obsolete.treetop +241 -0
- data/vendor/mail/lib/mail/part.rb +102 -0
- data/vendor/mail/lib/mail/parts_list.rb +34 -0
- data/vendor/mail/lib/mail/patterns.rb +30 -0
- data/vendor/mail/lib/mail/utilities.rb +181 -0
- data/vendor/mail/lib/mail/version.rb +10 -0
- data/vendor/mail/lib/mail/version_specific/ruby_1_8.rb +97 -0
- data/vendor/mail/lib/mail/version_specific/ruby_1_9.rb +87 -0
- data/vendor/mail/lib/tasks/corpus.rake +125 -0
- data/vendor/mail/lib/tasks/treetop.rake +10 -0
- data/vendor/mail/mail.gemspec +20 -0
- data/vendor/mail/reference/US ASCII Table.txt +130 -0
- data/vendor/mail/reference/rfc1035 Domain Implementation and Specification.txt +3083 -0
- data/vendor/mail/reference/rfc1049 Content-Type Header Field for Internet Messages.txt +451 -0
- data/vendor/mail/reference/rfc1344 Implications of MIME for Internet Mail Gateways.txt +586 -0
- data/vendor/mail/reference/rfc1345 Character Mnemonics & Character Sets.txt +5761 -0
- data/vendor/mail/reference/rfc1524 A User Agent Configuration Mechanism For Multimedia Mail Format Information.txt +675 -0
- data/vendor/mail/reference/rfc1652 SMTP Service Extension for 8bit-MIMEtransport.txt +339 -0
- data/vendor/mail/reference/rfc1892 Multipart Report .txt +227 -0
- data/vendor/mail/reference/rfc1893 Mail System Status Codes.txt +843 -0
- data/vendor/mail/reference/rfc2045 Multipurpose Internet Mail Extensions (1).txt +1739 -0
- data/vendor/mail/reference/rfc2046 Multipurpose Internet Mail Extensions (2).txt +2467 -0
- data/vendor/mail/reference/rfc2047 Multipurpose Internet Mail Extensions (3).txt +843 -0
- data/vendor/mail/reference/rfc2048 Multipurpose Internet Mail Extensions (4).txt +1180 -0
- data/vendor/mail/reference/rfc2049 Multipurpose Internet Mail Extensions (5).txt +1347 -0
- data/vendor/mail/reference/rfc2111 Content-ID and Message-ID URLs.txt +283 -0
- data/vendor/mail/reference/rfc2183 Content-Disposition Header Field.txt +675 -0
- data/vendor/mail/reference/rfc2231 MIME Parameter Value and Encoded Word Extensions.txt +563 -0
- data/vendor/mail/reference/rfc2387 MIME Multipart-Related Content-type.txt +563 -0
- data/vendor/mail/reference/rfc2821 Simple Mail Transfer Protocol.txt +3711 -0
- data/vendor/mail/reference/rfc2822 Internet Message Format.txt +2859 -0
- data/vendor/mail/reference/rfc3462 Reporting of Mail System Administrative Messages.txt +396 -0
- data/vendor/mail/reference/rfc3696 Checking and Transformation of Names.txt +898 -0
- data/vendor/mail/reference/rfc4155 The application-mbox Media Type.txt +502 -0
- data/vendor/mail/reference/rfc4234 Augmented BNF for Syntax Specifications: ABNF.txt +899 -0
- data/vendor/mail/reference/rfc822 Standard for the Format of ARPA Internet Text Messages.txt +2900 -0
- data/vendor/mail/spec/environment.rb +15 -0
- data/vendor/mail/spec/features/making_a_new_message.feature +14 -0
- data/vendor/mail/spec/features/steps/env.rb +6 -0
- data/vendor/mail/spec/features/steps/making_a_new_message_steps.rb +11 -0
- data/vendor/mail/spec/fixtures/attachments/basic_email.eml +31 -0
- data/vendor/mail/spec/fixtures/attachments/test.gif +0 -0
- data/vendor/mail/spec/fixtures/attachments/test.jpg +0 -0
- data/vendor/mail/spec/fixtures/attachments/test.pdf +0 -0
- data/vendor/mail/spec/fixtures/attachments/test.png +0 -0
- data/vendor/mail/spec/fixtures/attachments/test.tiff +0 -0
- data/vendor/mail/spec/fixtures/attachments/test.zip +0 -0
- data/vendor/mail/spec/fixtures/attachments//343/201/246/343/201/231/343/201/250.txt +2 -0
- data/vendor/mail/spec/fixtures/emails/attachment_emails/attachment_content_disposition.eml +29 -0
- data/vendor/mail/spec/fixtures/emails/attachment_emails/attachment_content_location.eml +32 -0
- data/vendor/mail/spec/fixtures/emails/attachment_emails/attachment_message_rfc822.eml +92 -0
- data/vendor/mail/spec/fixtures/emails/attachment_emails/attachment_only_email.eml +17 -0
- data/vendor/mail/spec/fixtures/emails/attachment_emails/attachment_pdf.eml +70 -0
- data/vendor/mail/spec/fixtures/emails/attachment_emails/attachment_with_encoded_name.eml +47 -0
- data/vendor/mail/spec/fixtures/emails/attachment_emails/attachment_with_quoted_filename.eml +60 -0
- data/vendor/mail/spec/fixtures/emails/error_emails/cant_parse_from.eml +33 -0
- data/vendor/mail/spec/fixtures/emails/error_emails/content_transfer_encoding_7-bit.eml +231 -0
- data/vendor/mail/spec/fixtures/emails/error_emails/content_transfer_encoding_empty.eml +33 -0
- data/vendor/mail/spec/fixtures/emails/error_emails/content_transfer_encoding_plain.eml +148 -0
- data/vendor/mail/spec/fixtures/emails/error_emails/content_transfer_encoding_qp_with_space.eml +53 -0
- data/vendor/mail/spec/fixtures/emails/error_emails/content_transfer_encoding_spam.eml +44 -0
- data/vendor/mail/spec/fixtures/emails/error_emails/content_transfer_encoding_text-html.eml +50 -0
- data/vendor/mail/spec/fixtures/emails/error_emails/content_transfer_encoding_with_8bits.eml +770 -0
- data/vendor/mail/spec/fixtures/emails/error_emails/content_transfer_encoding_with_semi_colon.eml +269 -0
- data/vendor/mail/spec/fixtures/emails/error_emails/content_transfer_encoding_x_uuencode.eml +79 -0
- data/vendor/mail/spec/fixtures/emails/error_emails/empty_group_lists.eml +162 -0
- data/vendor/mail/spec/fixtures/emails/error_emails/header_fields_with_empty_values.eml +33 -0
- data/vendor/mail/spec/fixtures/emails/error_emails/missing_body.eml +16 -0
- data/vendor/mail/spec/fixtures/emails/error_emails/missing_content_disposition.eml +43 -0
- data/vendor/mail/spec/fixtures/emails/error_emails/multiple_content_types.eml +25 -0
- data/vendor/mail/spec/fixtures/emails/mime_emails/raw_email11.eml +34 -0
- data/vendor/mail/spec/fixtures/emails/mime_emails/raw_email12.eml +32 -0
- data/vendor/mail/spec/fixtures/emails/mime_emails/raw_email2.eml +114 -0
- data/vendor/mail/spec/fixtures/emails/mime_emails/raw_email4.eml +59 -0
- data/vendor/mail/spec/fixtures/emails/mime_emails/raw_email7.eml +66 -0
- data/vendor/mail/spec/fixtures/emails/mime_emails/raw_email_encoded_stack_level_too_deep.eml +53 -0
- data/vendor/mail/spec/fixtures/emails/mime_emails/raw_email_with_illegal_boundary.eml +58 -0
- data/vendor/mail/spec/fixtures/emails/mime_emails/raw_email_with_mimepart_without_content_type.eml +94 -0
- data/vendor/mail/spec/fixtures/emails/mime_emails/raw_email_with_multipart_mixed_quoted_boundary.eml +50 -0
- data/vendor/mail/spec/fixtures/emails/mime_emails/raw_email_with_nested_attachment.eml +100 -0
- data/vendor/mail/spec/fixtures/emails/mime_emails/raw_email_with_quoted_illegal_boundary.eml +58 -0
- data/vendor/mail/spec/fixtures/emails/mime_emails/sig_only_email.eml +29 -0
- data/vendor/mail/spec/fixtures/emails/mime_emails/two_from_in_message.eml +42 -0
- data/vendor/mail/spec/fixtures/emails/multi_charset/japanese.eml +9 -0
- data/vendor/mail/spec/fixtures/emails/multi_charset/japanese_attachment.eml +27 -0
- data/vendor/mail/spec/fixtures/emails/multi_charset/japanese_attachment_long_name.eml +44 -0
- data/vendor/mail/spec/fixtures/emails/multipart_report_emails/multi_address_bounce1.eml +179 -0
- data/vendor/mail/spec/fixtures/emails/multipart_report_emails/multi_address_bounce2.eml +179 -0
- data/vendor/mail/spec/fixtures/emails/multipart_report_emails/report_422.eml +98 -0
- data/vendor/mail/spec/fixtures/emails/multipart_report_emails/report_530.eml +97 -0
- data/vendor/mail/spec/fixtures/emails/plain_emails/basic_email.eml +31 -0
- data/vendor/mail/spec/fixtures/emails/plain_emails/raw_email.eml +14 -0
- data/vendor/mail/spec/fixtures/emails/plain_emails/raw_email10.eml +20 -0
- data/vendor/mail/spec/fixtures/emails/plain_emails/raw_email5.eml +19 -0
- data/vendor/mail/spec/fixtures/emails/plain_emails/raw_email6.eml +20 -0
- data/vendor/mail/spec/fixtures/emails/plain_emails/raw_email8.eml +47 -0
- data/vendor/mail/spec/fixtures/emails/plain_emails/raw_email_bad_time.eml +62 -0
- data/vendor/mail/spec/fixtures/emails/plain_emails/raw_email_double_at_in_header.eml +14 -0
- data/vendor/mail/spec/fixtures/emails/plain_emails/raw_email_incorrect_header.eml +28 -0
- data/vendor/mail/spec/fixtures/emails/plain_emails/raw_email_multiple_from.eml +30 -0
- data/vendor/mail/spec/fixtures/emails/plain_emails/raw_email_quoted_with_0d0a.eml +14 -0
- data/vendor/mail/spec/fixtures/emails/plain_emails/raw_email_reply.eml +32 -0
- data/vendor/mail/spec/fixtures/emails/plain_emails/raw_email_simple.eml +11 -0
- data/vendor/mail/spec/fixtures/emails/plain_emails/raw_email_string_in_date_field.eml +17 -0
- data/vendor/mail/spec/fixtures/emails/plain_emails/raw_email_trailing_dot.eml +21 -0
- data/vendor/mail/spec/fixtures/emails/plain_emails/raw_email_with_bad_date.eml +48 -0
- data/vendor/mail/spec/fixtures/emails/plain_emails/raw_email_with_partially_quoted_subject.eml +14 -0
- data/vendor/mail/spec/fixtures/emails/rfc2822/example01.eml +8 -0
- data/vendor/mail/spec/fixtures/emails/rfc2822/example02.eml +9 -0
- data/vendor/mail/spec/fixtures/emails/rfc2822/example03.eml +7 -0
- data/vendor/mail/spec/fixtures/emails/rfc2822/example04.eml +7 -0
- data/vendor/mail/spec/fixtures/emails/rfc2822/example05.eml +8 -0
- data/vendor/mail/spec/fixtures/emails/rfc2822/example06.eml +10 -0
- data/vendor/mail/spec/fixtures/emails/rfc2822/example07.eml +9 -0
- data/vendor/mail/spec/fixtures/emails/rfc2822/example08.eml +12 -0
- data/vendor/mail/spec/fixtures/emails/rfc2822/example09.eml +15 -0
- data/vendor/mail/spec/fixtures/emails/rfc2822/example10.eml +15 -0
- data/vendor/mail/spec/fixtures/emails/rfc2822/example11.eml +6 -0
- data/vendor/mail/spec/fixtures/emails/rfc2822/example12.eml +8 -0
- data/vendor/mail/spec/fixtures/emails/rfc2822/example13.eml +10 -0
- data/vendor/mail/spec/fixtures/emails/sample_output_multipart +0 -0
- data/vendor/mail/spec/mail/attachments_list_spec.rb +214 -0
- data/vendor/mail/spec/mail/body_spec.rb +385 -0
- data/vendor/mail/spec/mail/configuration_spec.rb +19 -0
- data/vendor/mail/spec/mail/core_extensions/string_spec.rb +62 -0
- data/vendor/mail/spec/mail/core_extensions_spec.rb +99 -0
- data/vendor/mail/spec/mail/elements/address_list_spec.rb +109 -0
- data/vendor/mail/spec/mail/elements/address_spec.rb +609 -0
- data/vendor/mail/spec/mail/elements/date_time_element_spec.rb +20 -0
- data/vendor/mail/spec/mail/elements/envelope_from_element_spec.rb +31 -0
- data/vendor/mail/spec/mail/elements/message_ids_element_spec.rb +43 -0
- data/vendor/mail/spec/mail/elements/phrase_list_spec.rb +22 -0
- data/vendor/mail/spec/mail/elements/received_element_spec.rb +34 -0
- data/vendor/mail/spec/mail/encoding_spec.rb +189 -0
- data/vendor/mail/spec/mail/encodings/base64_spec.rb +25 -0
- data/vendor/mail/spec/mail/encodings/quoted_printable_spec.rb +25 -0
- data/vendor/mail/spec/mail/encodings_spec.rb +664 -0
- data/vendor/mail/spec/mail/example_emails_spec.rb +303 -0
- data/vendor/mail/spec/mail/field_list_spec.rb +33 -0
- data/vendor/mail/spec/mail/field_spec.rb +198 -0
- data/vendor/mail/spec/mail/fields/bcc_field_spec.rb +89 -0
- data/vendor/mail/spec/mail/fields/cc_field_spec.rb +79 -0
- data/vendor/mail/spec/mail/fields/comments_field_spec.rb +25 -0
- data/vendor/mail/spec/mail/fields/common/address_container_spec.rb +18 -0
- data/vendor/mail/spec/mail/fields/common/common_address_spec.rb +132 -0
- data/vendor/mail/spec/mail/fields/common/common_date_spec.rb +25 -0
- data/vendor/mail/spec/mail/fields/common/common_field_spec.rb +69 -0
- data/vendor/mail/spec/mail/fields/common/common_message_id_spec.rb +30 -0
- data/vendor/mail/spec/mail/fields/common/parameter_hash_spec.rb +56 -0
- data/vendor/mail/spec/mail/fields/content_description_field_spec.rb +39 -0
- data/vendor/mail/spec/mail/fields/content_disposition_field_spec.rb +55 -0
- data/vendor/mail/spec/mail/fields/content_id_field_spec.rb +117 -0
- data/vendor/mail/spec/mail/fields/content_location_field_spec.rb +46 -0
- data/vendor/mail/spec/mail/fields/content_transfer_encoding_field_spec.rb +113 -0
- data/vendor/mail/spec/mail/fields/content_type_field_spec.rb +678 -0
- data/vendor/mail/spec/mail/fields/date_field_spec.rb +73 -0
- data/vendor/mail/spec/mail/fields/envelope_spec.rb +48 -0
- data/vendor/mail/spec/mail/fields/from_field_spec.rb +89 -0
- data/vendor/mail/spec/mail/fields/in_reply_to_field_spec.rb +62 -0
- data/vendor/mail/spec/mail/fields/keywords_field_spec.rb +66 -0
- data/vendor/mail/spec/mail/fields/message_id_field_spec.rb +147 -0
- data/vendor/mail/spec/mail/fields/mime_version_field_spec.rb +166 -0
- data/vendor/mail/spec/mail/fields/received_field_spec.rb +44 -0
- data/vendor/mail/spec/mail/fields/references_field_spec.rb +35 -0
- data/vendor/mail/spec/mail/fields/reply_to_field_spec.rb +67 -0
- data/vendor/mail/spec/mail/fields/resent_bcc_field_spec.rb +66 -0
- data/vendor/mail/spec/mail/fields/resent_cc_field_spec.rb +66 -0
- data/vendor/mail/spec/mail/fields/resent_date_field_spec.rb +39 -0
- data/vendor/mail/spec/mail/fields/resent_from_field_spec.rb +66 -0
- data/vendor/mail/spec/mail/fields/resent_message_id_field_spec.rb +24 -0
- data/vendor/mail/spec/mail/fields/resent_sender_field_spec.rb +58 -0
- data/vendor/mail/spec/mail/fields/resent_to_field_spec.rb +66 -0
- data/vendor/mail/spec/mail/fields/return_path_field_spec.rb +52 -0
- data/vendor/mail/spec/mail/fields/sender_field_spec.rb +58 -0
- data/vendor/mail/spec/mail/fields/structured_field_spec.rb +72 -0
- data/vendor/mail/spec/mail/fields/to_field_spec.rb +92 -0
- data/vendor/mail/spec/mail/fields/unstructured_field_spec.rb +134 -0
- data/vendor/mail/spec/mail/header_spec.rb +578 -0
- data/vendor/mail/spec/mail/mail_spec.rb +34 -0
- data/vendor/mail/spec/mail/message_spec.rb +1409 -0
- data/vendor/mail/spec/mail/mime_messages_spec.rb +435 -0
- data/vendor/mail/spec/mail/multipart_report_spec.rb +112 -0
- data/vendor/mail/spec/mail/network/delivery_methods/file_delivery_spec.rb +79 -0
- data/vendor/mail/spec/mail/network/delivery_methods/sendmail_spec.rb +125 -0
- data/vendor/mail/spec/mail/network/delivery_methods/smtp_spec.rb +133 -0
- data/vendor/mail/spec/mail/network/delivery_methods/test_mailer_spec.rb +57 -0
- data/vendor/mail/spec/mail/network/retriever_methods/pop3_spec.rb +180 -0
- data/vendor/mail/spec/mail/network_spec.rb +359 -0
- data/vendor/mail/spec/mail/parsers/address_lists_parser_spec.rb +15 -0
- data/vendor/mail/spec/mail/parsers/content_transfer_encoding_parser_spec.rb +72 -0
- data/vendor/mail/spec/mail/part_spec.rb +129 -0
- data/vendor/mail/spec/mail/parts_list_spec.rb +12 -0
- data/vendor/mail/spec/mail/round_tripping_spec.rb +44 -0
- data/vendor/mail/spec/mail/utilities_spec.rb +327 -0
- data/vendor/mail/spec/mail/version_specific/escape_paren_1_8_spec.rb +32 -0
- data/vendor/mail/spec/matchers/break_down_to.rb +35 -0
- data/vendor/mail/spec/spec_helper.rb +163 -0
- metadata +442 -0
@@ -0,0 +1,675 @@
|
|
1
|
+
|
2
|
+
|
3
|
+
|
4
|
+
|
5
|
+
|
6
|
+
|
7
|
+
Network Working Group N. Borenstein
|
8
|
+
Request for Comments: 1524 Bellcore
|
9
|
+
Category: Informational September 1993
|
10
|
+
|
11
|
+
|
12
|
+
A User Agent Configuration Mechanism
|
13
|
+
For Multimedia Mail Format Information
|
14
|
+
|
15
|
+
Status of This Memo
|
16
|
+
|
17
|
+
This memo provides information for the Internet community. It does
|
18
|
+
not specify an Internet standard. Distribution of this memo is
|
19
|
+
unlimited.
|
20
|
+
|
21
|
+
Abstract
|
22
|
+
|
23
|
+
This memo suggests a file format to be used to inform multiple mail
|
24
|
+
reading user agent programs about the locally-installed facilities
|
25
|
+
for handling mail in various formats. The mechanism is explicitly
|
26
|
+
designed to work with mail systems based Internet mail as defined by
|
27
|
+
RFC's 821 (STD 10), 822 (STD 11), 934, 1049 (STD 11), 1113, and the
|
28
|
+
Multipurpose Internet Mail Extensions, known as MIME. However, with
|
29
|
+
some extensions it could probably be made to work for X.400-based
|
30
|
+
mail systems as well. The format and mechanism are proposed in a
|
31
|
+
manner that is generally operating-system independent. However,
|
32
|
+
certain implementation details will inevitably reflect operating
|
33
|
+
system differences, some of which will have to be handled in a
|
34
|
+
uniform manner for each operating system. This memo makes such
|
35
|
+
situations explicit, and, in an appendix, suggests a standard
|
36
|
+
behavior under the UNIX operating system.
|
37
|
+
|
38
|
+
Introduction
|
39
|
+
|
40
|
+
The electronic mail world is in the midst of a transition from
|
41
|
+
single-part text-only mail to multi-part, multi-media mail. In
|
42
|
+
support of this transition, various extensions to RFC 821 and RFC 822
|
43
|
+
have been proposed and/or adopted, notably including MIME [RFC-1521].
|
44
|
+
Various parties have demonstrated extremely high-functionality
|
45
|
+
multimedia mail, but the problem of mail interchange between
|
46
|
+
different user agents has been severe. In general, only text
|
47
|
+
messages have been shared between user agents that were not
|
48
|
+
explicitly designed to work together. This limitation is not
|
49
|
+
compatible with a smooth transition to a multi-media mail world.
|
50
|
+
|
51
|
+
One approach to this transition is to modify diverse sets of mail
|
52
|
+
reading user agents so that, when they need to display mail of an
|
53
|
+
unfamiliar (non-text) type, they consult an external file for
|
54
|
+
information on how to display that file. That file might say, for
|
55
|
+
|
56
|
+
|
57
|
+
|
58
|
+
Borenstein [Page 1]
|
59
|
+
|
60
|
+
RFC 1524 Multimedia Mail Configuration September 1993
|
61
|
+
|
62
|
+
|
63
|
+
example, that if the content-type of a message is "foo" it can be
|
64
|
+
displayed to the user via the "displayfoo" program.
|
65
|
+
|
66
|
+
This approach means that, with a one-time modification, a wide
|
67
|
+
variety of mail reading programs can be given the ability to display
|
68
|
+
a wide variety of types of message. Moreover, extending the set of
|
69
|
+
media types supported at a site becomes a simple matter of installing
|
70
|
+
a binary and adding a single line to a configuration file. Crucial
|
71
|
+
to this scheme, however, is that all of the user agents agree on a
|
72
|
+
common representation and source for the configuration file. This
|
73
|
+
memo proposes such a common representation.
|
74
|
+
|
75
|
+
Location of Configuration Information
|
76
|
+
|
77
|
+
Each user agent must clearly obtain the configuration information
|
78
|
+
from a common location, if the same information is to be used to
|
79
|
+
configure all user agents. However, individual users should be able
|
80
|
+
to override or augment a site's configuration. The configuration
|
81
|
+
information should therefore be obtained from a designated set of
|
82
|
+
locations. The overall configuration will be obtained through the
|
83
|
+
virtual concatenation of several individual configuration files known
|
84
|
+
as mailcap files. The configuration information will be obtained
|
85
|
+
from the FIRST matching entry in a mailcap file, where "matching"
|
86
|
+
depends on both a matching content-type specification, an entry
|
87
|
+
containing sufficient information for the purposes of the application
|
88
|
+
doing the searching, and the success of any test in the "test="
|
89
|
+
field, if present.
|
90
|
+
|
91
|
+
The precise location of the mailcap files is operating-system
|
92
|
+
dependent. A standard location for UNIX is specified in Appendix A.
|
93
|
+
|
94
|
+
Overall Format of a Mailcap File
|
95
|
+
|
96
|
+
Each mailcap file consists of a set of entries that describe the
|
97
|
+
proper handling of one media type at the local site.
|
98
|
+
|
99
|
+
For example, one line might tell how to display a message in Group
|
100
|
+
III fax format. A mailcap file consists of a sequence of such
|
101
|
+
individual entries, separated by newlines (according to the operating
|
102
|
+
system's newline conventions). Blank lines and lines that start with
|
103
|
+
the "#" character (ASCII 35) are considered comments, and are
|
104
|
+
ignored. Long entries may be continued on multiple lines if each
|
105
|
+
non-terminal line ends with a backslash character ('\', ASCII 92), in
|
106
|
+
which case the multiple lines are to be treated as a single mailcap
|
107
|
+
entry. Note that for such "continued" lines, the backslash must be
|
108
|
+
the last character on the line to be continued.
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
|
114
|
+
Borenstein [Page 2]
|
115
|
+
|
116
|
+
RFC 1524 Multimedia Mail Configuration September 1993
|
117
|
+
|
118
|
+
|
119
|
+
Thus the overall format of a mailcap file is given, in the modified
|
120
|
+
BNF of RFC 822, as:
|
121
|
+
|
122
|
+
Mailcap-File = *Mailcap-Line
|
123
|
+
|
124
|
+
Mailcap-Line = Comment / Mailcap-Entry
|
125
|
+
|
126
|
+
Comment = NEWLINE / "#" *CHAR NEWLINE
|
127
|
+
|
128
|
+
NEWLINE = <newline as defined by OS convention>
|
129
|
+
|
130
|
+
Note that the above specification implies that comments must appear
|
131
|
+
on lines all to themselves, with a "#" character as the first
|
132
|
+
character on each comment line.
|
133
|
+
|
134
|
+
Format of a Mailcap Entry
|
135
|
+
|
136
|
+
Each mailcap entry consists of a number of fields, separated by
|
137
|
+
semi-colons. The first two fields are required, and must occur in
|
138
|
+
the specified order. The remaining fields are optional, and may
|
139
|
+
appear in any order.
|
140
|
+
|
141
|
+
The first field is the content-type, which indicates the type of data
|
142
|
+
this mailcap entry describes how to handle. It is to be matched
|
143
|
+
against the type/subtype specification in the "Content-Type" header
|
144
|
+
field of an Internet mail message. If the subtype is specified as
|
145
|
+
"*", it is intended to match all subtypes of the named content-type.
|
146
|
+
|
147
|
+
The second field, view-command, is a specification of how the message
|
148
|
+
or body part can be viewed at the local site. Although the syntax of
|
149
|
+
this field is fully specified, the semantics of program execution are
|
150
|
+
necessarily somewhat operating system dependent. UNIX semantics are
|
151
|
+
given in Appendix A.
|
152
|
+
|
153
|
+
The optional fields, which may be given in any order, are as follows:
|
154
|
+
|
155
|
+
-- The "compose" field may be used to specify a program that can be
|
156
|
+
used to compose a new body or body part in the given format. Its
|
157
|
+
intended use is to support mail composing agents that support the
|
158
|
+
composition of multiple types of mail using external composing
|
159
|
+
agents. As with the view-command, the semantics of program
|
160
|
+
execution are operating system dependent, with UNIX semantics
|
161
|
+
specified in Appendix A. The result of the composing program may
|
162
|
+
be data that is not yet suitable for mail transport -- that is, a
|
163
|
+
Content-Transfer-Encoding may need to be applied to the data.
|
164
|
+
|
165
|
+
-- The "composetyped" field is similar to the "compose" field, but is
|
166
|
+
to be used when the composing program needs to specify the
|
167
|
+
|
168
|
+
|
169
|
+
|
170
|
+
Borenstein [Page 3]
|
171
|
+
|
172
|
+
RFC 1524 Multimedia Mail Configuration September 1993
|
173
|
+
|
174
|
+
|
175
|
+
Content-type header field to be applied to the composed data. The
|
176
|
+
"compose" field is simpler, and is preferred for use with existing
|
177
|
+
(non-mail-oriented) programs for composing data in a given format.
|
178
|
+
The "composetyped" field is necessary when the Content-type
|
179
|
+
information must include auxilliary parameters, and the
|
180
|
+
composition program must then know enough about mail formats to
|
181
|
+
produce output that includes the mail type information.
|
182
|
+
|
183
|
+
-- The "edit" field may be used to specify a program that can be used
|
184
|
+
to edit a body or body part in the given format. In many cases,
|
185
|
+
it may be identical in content to the "compose" field, and shares
|
186
|
+
the operating-system dependent semantics for program execution.
|
187
|
+
|
188
|
+
-- The "print" field may be used to specify a program that can be
|
189
|
+
used to print a message or body part in the given format. As with
|
190
|
+
the view-command, the semantics of program execution are operating
|
191
|
+
system dependent, with UNIX semantics specified in Appendix A.
|
192
|
+
|
193
|
+
-- The "test" field may be used to test some external condition
|
194
|
+
(e.g., the machine architecture, or the window system in use) to
|
195
|
+
determine whether or not the mailcap line applies. It specifies a
|
196
|
+
program to be run to test some condition. The semantics of
|
197
|
+
execution and of the value returned by the test program are
|
198
|
+
operating system dependent, with UNIX semantics specified in
|
199
|
+
Appendix A. If the test fails, a subsequent mailcap entry should
|
200
|
+
be sought. Multiple test fields are not permitted -- since a test
|
201
|
+
can call a program, it can already be arbitrarily complex.
|
202
|
+
|
203
|
+
-- The "needsterminal" field indicates that the view-command must be
|
204
|
+
run on an interactive terminal. This is needed to inform window-
|
205
|
+
oriented user agents that an interactive terminal is needed. (The
|
206
|
+
decision is not left exclusively to the view-command because in
|
207
|
+
some circumstances it may not be possible for such programs to
|
208
|
+
tell whether or not they are on interactive terminals.) The
|
209
|
+
needsterminal command should be assumed to apply to the compose
|
210
|
+
and edit commands, too, if they exist. Note that this is NOT a
|
211
|
+
test -- it is a requirement for the environment in which the
|
212
|
+
program will be executed, and should typically cause the creation
|
213
|
+
of a terminal window when not executed on either a real terminal
|
214
|
+
or a terminal window.
|
215
|
+
|
216
|
+
-- The "copiousoutput" field indicates that the output from the
|
217
|
+
view-command will be an extended stream of output, and is to be
|
218
|
+
interpreted as advice to the UA (User Agent mail-reading program)
|
219
|
+
that the output should be either paged or made scrollable. Note
|
220
|
+
that it is probably a mistake if needsterminal and copiousoutput
|
221
|
+
are both specified.
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
|
226
|
+
Borenstein [Page 4]
|
227
|
+
|
228
|
+
RFC 1524 Multimedia Mail Configuration September 1993
|
229
|
+
|
230
|
+
|
231
|
+
-- The "description" field simply provides a textual description,
|
232
|
+
optionally quoted, that describes the type of data, to be used
|
233
|
+
optionally by mail readers that wish to describe the data before
|
234
|
+
offering to display it.
|
235
|
+
|
236
|
+
-- The "textualnewlines" field, if set to any non-zero value,
|
237
|
+
indicates that this type of data is line-oriented and that, if
|
238
|
+
encoded in base64, all newlines should be converted to canonical
|
239
|
+
form (CRLF) before encoding, and will be in that form after
|
240
|
+
decoding. In general, this field is needed only if there is
|
241
|
+
line-oriented data of some type other than text/* or non-line-
|
242
|
+
oriented data that is a subtype of text.
|
243
|
+
|
244
|
+
-- The "x11-bitmap" field names a file, in X11 bitmap (xbm) format,
|
245
|
+
which points to an appropriate icon to be used to visually denote
|
246
|
+
the presence of this kind of data.
|
247
|
+
|
248
|
+
-- The "nametemplate" field gives a file name format, in which %s
|
249
|
+
will be replaced by a short unique string to give the name of the
|
250
|
+
temporary file to be passed to the viewing command. This is only
|
251
|
+
expected to be relevant in environments where filename extensions
|
252
|
+
are meaningful, e.g., one coulld specify that a GIF file being
|
253
|
+
passed to a gif viewer should have a name eding in ".gif" by using
|
254
|
+
"nametemplate=%s.gif".
|
255
|
+
|
256
|
+
Any other fields beginning with "x-" may be included for local or
|
257
|
+
mailer-specific extensions of this format. Implementations should
|
258
|
+
simply ignore all such unrecognized fields to permit such extensions,
|
259
|
+
some of which might be standardized in a future version of this
|
260
|
+
document.
|
261
|
+
|
262
|
+
Some of the fields above, such as "needsterminal", apply to the
|
263
|
+
actions of the view-command, edit-command, and compose-command,
|
264
|
+
alike. In some unusual cases, this may not be desirable, but
|
265
|
+
differentiation can be accomplished via separate mailcap entries,
|
266
|
+
taking advantage of the fact that subsequent mailcap entries are
|
267
|
+
searched if an earlier mailcap entry does not provide enough
|
268
|
+
information:
|
269
|
+
|
270
|
+
application/postscript; ps-to-terminal %s;\ needsterminal
|
271
|
+
application/postscript; ps-to-terminal %s; \compose=idraw %s
|
272
|
+
|
273
|
+
In RFC 822 modified BNF, the following grammar describes a mailcap
|
274
|
+
entry:
|
275
|
+
|
276
|
+
|
277
|
+
|
278
|
+
|
279
|
+
|
280
|
+
|
281
|
+
|
282
|
+
Borenstein [Page 5]
|
283
|
+
|
284
|
+
RFC 1524 Multimedia Mail Configuration September 1993
|
285
|
+
|
286
|
+
|
287
|
+
Mailcap-Entry = typefield ; view-command
|
288
|
+
[";" 1#field]
|
289
|
+
|
290
|
+
typefield = propertype / implicit-wild
|
291
|
+
|
292
|
+
propertype = type "/" wildsubtype
|
293
|
+
|
294
|
+
implicitwild = type
|
295
|
+
|
296
|
+
wildsubtype = subtype / "*"
|
297
|
+
|
298
|
+
view-command = mtext
|
299
|
+
|
300
|
+
mtext = *mchar
|
301
|
+
|
302
|
+
mchar = schar / qchar
|
303
|
+
|
304
|
+
schar = * <any CHAR except ";","\", and CTLS>
|
305
|
+
|
306
|
+
qchar = "\" CHAR ; may quote any char
|
307
|
+
|
308
|
+
field = flag / namedfield
|
309
|
+
|
310
|
+
namedfield = fieldname "=" mtext
|
311
|
+
|
312
|
+
flag = "needsterminal" ; All these literals are to
|
313
|
+
/ "copiousoutput" ; be interpreted as
|
314
|
+
/ x-token ; case-insensitive
|
315
|
+
|
316
|
+
fieldname = / "compose" ;Also all of these
|
317
|
+
/ "composetyped" ;are case-insensitive.
|
318
|
+
/ "print"
|
319
|
+
/ "edit"
|
320
|
+
/ "test"
|
321
|
+
/ "x11-bitmap"
|
322
|
+
/ "textualnewlines"
|
323
|
+
/ "description"
|
324
|
+
/ x-token
|
325
|
+
|
326
|
+
Note that "type", "subtype", and "x-token" are defined in MIME. Note
|
327
|
+
also that while the definition of "schar" includes the percent sign,
|
328
|
+
"%", this character has a special meaning in at least the UNIX
|
329
|
+
semantics, and will therefore need to be quoted as a qchar to be used
|
330
|
+
literally.
|
331
|
+
|
332
|
+
|
333
|
+
|
334
|
+
|
335
|
+
|
336
|
+
|
337
|
+
|
338
|
+
Borenstein [Page 6]
|
339
|
+
|
340
|
+
RFC 1524 Multimedia Mail Configuration September 1993
|
341
|
+
|
342
|
+
|
343
|
+
Acknowledgements
|
344
|
+
|
345
|
+
The author wishes to thank Malcolm Bjorn Gillies, Dan Heller, Olle
|
346
|
+
Jaernefors, Keith Moore, Luc Rooijakkers, and the other members of
|
347
|
+
the IETF task force on mail extensions for their comments on earlier
|
348
|
+
versions of this draft. If other acknowledgements were neglected,
|
349
|
+
please let me know, as it was surely accidental.
|
350
|
+
|
351
|
+
Security Considerations
|
352
|
+
|
353
|
+
Security issues are not discussed in this memo. However, the use of
|
354
|
+
the mechanisms described in this memo can make it easier for
|
355
|
+
implementations to slip into the kind of security problems discussed
|
356
|
+
in the MIME document. Implementors and mailcap administrators should
|
357
|
+
be aware of these security considerations, and in particular should
|
358
|
+
exercise caution in the choice of programs to be listed in a mailcap
|
359
|
+
file for automatic execution.
|
360
|
+
|
361
|
+
Author's Address
|
362
|
+
|
363
|
+
Nathaniel S. Borenstein
|
364
|
+
MRE 2D-296, Bellcore
|
365
|
+
445 South St.
|
366
|
+
Morristown, NJ 07962-1910
|
367
|
+
|
368
|
+
EMail: nsb@bellcore.com
|
369
|
+
Phone: +1 201 829 4270
|
370
|
+
Fax: +1 201 829 7019
|
371
|
+
|
372
|
+
|
373
|
+
|
374
|
+
|
375
|
+
|
376
|
+
|
377
|
+
|
378
|
+
|
379
|
+
|
380
|
+
|
381
|
+
|
382
|
+
|
383
|
+
|
384
|
+
|
385
|
+
|
386
|
+
|
387
|
+
|
388
|
+
|
389
|
+
|
390
|
+
|
391
|
+
|
392
|
+
|
393
|
+
|
394
|
+
Borenstein [Page 7]
|
395
|
+
|
396
|
+
RFC 1524 Multimedia Mail Configuration September 1993
|
397
|
+
|
398
|
+
|
399
|
+
Appendix A: Implementation Details for UNIX
|
400
|
+
|
401
|
+
Although this memo fully specifies a syntax for "mailcap" files, the
|
402
|
+
semantics of the mailcap file are of necessity operating-system
|
403
|
+
dependent in four respects. In order to clarify the intent, and to
|
404
|
+
promote a standard usage, this appendix proposes a UNIX semantics for
|
405
|
+
these four cases. If a mailcap mechanism is implemented on non-UNIX
|
406
|
+
systems, similar semantic decisions should be made and published.
|
407
|
+
|
408
|
+
Location of the Mailcap File(s)
|
409
|
+
|
410
|
+
For UNIX, a path search of mailcap files is specified. The default
|
411
|
+
path search is specified as including at least the following:
|
412
|
+
|
413
|
+
$HOME/.mailcap:/etc/mailcap:/usr/etc/mailcap:/usr/local/etc/mailcap
|
414
|
+
|
415
|
+
However, this path may itself be overridden by a path specified by
|
416
|
+
the MAILCAPS environment variable.
|
417
|
+
|
418
|
+
Semantics of executable commands
|
419
|
+
|
420
|
+
Several portions of a mailcap entry specify commands to be executed.
|
421
|
+
In particular, the mandatory second fie ld, the view-command, takes a
|
422
|
+
command to be executed, as do the optional print, edit, test, and
|
423
|
+
compose fields.
|
424
|
+
|
425
|
+
On a UNIX system, such commands will each be a full shell command
|
426
|
+
line, including the path name for a program and its arguments.
|
427
|
+
(Because of differences in shells and the implementation and behavior
|
428
|
+
of the same shell from one system to another, it is specified that
|
429
|
+
the command line be intended as input to the Bourne shell, i.e., that
|
430
|
+
it is implicitly preceded by "/bin/sh -c " on the command line.)
|
431
|
+
|
432
|
+
The two characters "%s", if used, will be replaced by the name of a
|
433
|
+
file for the actual mail body data. In the case of the edit adn
|
434
|
+
view-command, the body part will be passed to this command as
|
435
|
+
standard input unless one or more instances of "%s" appear in the
|
436
|
+
view-command, in which case %s will be replaced by the name of a file
|
437
|
+
containing the body part, a file which may have to be created before
|
438
|
+
the view-command program is executed. (Such files cannot be presumed
|
439
|
+
to continue to exist after the view-command program exits. Thus a
|
440
|
+
view-command that wishes to exit and continue processing in the
|
441
|
+
background should take care to save the data first.) In the case of
|
442
|
+
the compose and composetyped commands, %s should be replaced by the
|
443
|
+
name of a file to which the composed data should be written by the
|
444
|
+
programs named in the compose or composedtyped commands. Thus, the
|
445
|
+
calling program will look in that file later in order to retrieve the
|
446
|
+
composed data. If %s does not appear in the compose or composetyped
|
447
|
+
|
448
|
+
|
449
|
+
|
450
|
+
Borenstein [Page 8]
|
451
|
+
|
452
|
+
RFC 1524 Multimedia Mail Configuration September 1993
|
453
|
+
|
454
|
+
|
455
|
+
commands, then the composed data will be assumed to be written by the
|
456
|
+
composing programs to standard output.
|
457
|
+
|
458
|
+
Furthermore, any occurrence of "%t" will be replaced by the content-
|
459
|
+
type and subtype specification. (That is, if the content-type is
|
460
|
+
"text/plain", then %t will be replaced by "text/plain".) A literal %
|
461
|
+
character may be quoted as \%. Finally, named parameters from the
|
462
|
+
Content-type field may be placed in the command execution line using
|
463
|
+
"%{" followed by the parameter name and a closing "}" character. The
|
464
|
+
entire parameter should appear as a single command line argument,
|
465
|
+
regardless of embedded spaces. Thus, if the message has a Content-
|
466
|
+
type line of:
|
467
|
+
|
468
|
+
Content-type: multipart/mixed; boundary=42
|
469
|
+
|
470
|
+
and the mailcap file has a line of:
|
471
|
+
|
472
|
+
multipart/*; /usr/local/bin/showmulti \
|
473
|
+
%t %{boundary}
|
474
|
+
|
475
|
+
then the equivalent of the following command should be
|
476
|
+
executed:
|
477
|
+
|
478
|
+
/usr/local/bin/showmulti multipart/mixed 42
|
479
|
+
|
480
|
+
If the content-type is "multipart" (any subtype), then the two
|
481
|
+
characters "%n" will be replaced by an integer giving the number of
|
482
|
+
sub-parts within the multipart entity. Also, the two characters "%F"
|
483
|
+
will be replaced by a set of arguments, twice as many arguments as
|
484
|
+
the number of sub-parts, consisting of alternating content-types and
|
485
|
+
file names for each part in turn. Thus if multipart entity has three
|
486
|
+
parts, "%F" will be replaced by the equivalent of "content-type1
|
487
|
+
file-name1 content-type2 file-name2 content-type3 file-name3".
|
488
|
+
|
489
|
+
Semantics of the "test" field
|
490
|
+
|
491
|
+
The "test" field specifies a program to be used to test whether or
|
492
|
+
not the current mailcap line applies. This can be used, for example,
|
493
|
+
to have a mailcap line that only applies if the X window system is
|
494
|
+
running, or if the user is running on a SPARCstation with a
|
495
|
+
/dev/audio. The value of the "test" field is a program to run to
|
496
|
+
test such a condition. The precise program to run and arguments to
|
497
|
+
give it are determined as specified in the previous section. The
|
498
|
+
test program should return an exit code of zero if the condition is
|
499
|
+
true, and a non-zero code otherwise.
|
500
|
+
|
501
|
+
|
502
|
+
|
503
|
+
|
504
|
+
|
505
|
+
|
506
|
+
Borenstein [Page 9]
|
507
|
+
|
508
|
+
RFC 1524 Multimedia Mail Configuration September 1993
|
509
|
+
|
510
|
+
|
511
|
+
Semantics of the "compose" field
|
512
|
+
|
513
|
+
On UNIX, the composing program is expected to produce a data stream
|
514
|
+
for such a body part as its standard output. The program will be
|
515
|
+
executed with the command line arguments determined as specified
|
516
|
+
above. The data returned via its standard output will be given a
|
517
|
+
Content-Type field that has no supplementary parameters. For
|
518
|
+
example, the following mailcap entry:
|
519
|
+
|
520
|
+
audio/basic; /usr/local/bin/showaudio %t
|
521
|
+
compose = /usr/local/bin/recordaudio
|
522
|
+
|
523
|
+
would result in tagging the data composed by the "recordaudio"
|
524
|
+
program as:
|
525
|
+
|
526
|
+
Content-Type: audio/basic
|
527
|
+
|
528
|
+
If this is unacceptable -- for example, in the case of multipart mail
|
529
|
+
a "boundary" parameter is required -- then the "compose" field cannot
|
530
|
+
be used. Instead, the "composetyped" field should be used in the
|
531
|
+
mailcap file.
|
532
|
+
|
533
|
+
Semantics of the "composetyped" field
|
534
|
+
|
535
|
+
The "composetyped" filed is much like the "compose" field, except
|
536
|
+
that it names a composition program that produces, not raw data, but
|
537
|
+
data that includes a MIME-conformant type specification. The program
|
538
|
+
will be executed with the command line arguments determined as
|
539
|
+
specified above. The data returned via its standard output must
|
540
|
+
begin with a Content-Type header, followed optionally by other
|
541
|
+
Content-* headers, and then by a blank line and the data. For
|
542
|
+
example, the following mailcap entry:
|
543
|
+
|
544
|
+
multipart/mixed; /usr/local/bin/showmulti %t \
|
545
|
+
%{boundary}; \
|
546
|
+
composetyped = /usr/local/bin/makemulti
|
547
|
+
|
548
|
+
would result in executing the "makemulti" program, which would be
|
549
|
+
expected to begin its output with a line of the form:
|
550
|
+
|
551
|
+
Content-Type: multipart/mixed; boundary=foobar
|
552
|
+
|
553
|
+
Note that a composition program need not encode binary data in base64
|
554
|
+
or quoted-printable. It remains the responsibility of the software
|
555
|
+
calling the composition program to encode such data as necessary.
|
556
|
+
However, if a composing program does encode data, which is not
|
557
|
+
encouraged, it should announce that fact using a Content-Transfer-
|
558
|
+
Encoding header in the standard manner defined by MIME. Because such
|
559
|
+
|
560
|
+
|
561
|
+
|
562
|
+
Borenstein [Page 10]
|
563
|
+
|
564
|
+
RFC 1524 Multimedia Mail Configuration September 1993
|
565
|
+
|
566
|
+
|
567
|
+
encodings must be announced by such a header, they are an option only
|
568
|
+
for composetyped programs, not for compose programs.
|
569
|
+
|
570
|
+
Appendix B: Sample Mailcap File
|
571
|
+
|
572
|
+
The following is an example of a mailcap file for UNIX that
|
573
|
+
demonstrates most of the syntax above. It contains explanatory
|
574
|
+
comments where necessary.
|
575
|
+
|
576
|
+
# Mailcap file for Bellcore lab 214.
|
577
|
+
#
|
578
|
+
# The next line sends "richtext" to the richtext
|
579
|
+
program
|
580
|
+
text/richtext; richtext %s; copiousoutput
|
581
|
+
#
|
582
|
+
# Next, basic u-law audio
|
583
|
+
audio/*; showaudio; test=/usr/local/bin/hasaudio
|
584
|
+
#
|
585
|
+
# Next, use the xview program to handle several image
|
586
|
+
formats
|
587
|
+
image/*; xview %s; test=/usr/local/bin/RunningX
|
588
|
+
#
|
589
|
+
# The ATOMICMAIL interpreter uses curses, so needs a
|
590
|
+
terminal
|
591
|
+
application/atomicmail; /usr/local/bin/atomicmail %s; \
|
592
|
+
needsterminal
|
593
|
+
#
|
594
|
+
# The next line handles Andrew format,
|
595
|
+
# if ez and ezview are installed
|
596
|
+
x-be2; /usr/andrew/bin/ezview %s; \
|
597
|
+
print=/usr/andrew/bin/ezprint %s ; \
|
598
|
+
compose=/usr/andrew/bin/ez -d %s \;
|
599
|
+
edit=/usr/andrew/bin/ez -d %s; \;
|
600
|
+
copiousoutput
|
601
|
+
#
|
602
|
+
# The next silly example demonstrates the use of
|
603
|
+
quoting
|
604
|
+
application/*; echo "This is \"%t\" but \
|
605
|
+
is 50 \% Greek to me" \; cat %s; copiousoutput
|
606
|
+
|
607
|
+
|
608
|
+
|
609
|
+
|
610
|
+
|
611
|
+
|
612
|
+
|
613
|
+
|
614
|
+
|
615
|
+
|
616
|
+
|
617
|
+
|
618
|
+
Borenstein [Page 11]
|
619
|
+
|
620
|
+
RFC 1524 Multimedia Mail Configuration September 1993
|
621
|
+
|
622
|
+
|
623
|
+
Appendix C: A Note on Format Translation
|
624
|
+
|
625
|
+
It has been suggested that another function of a mailcap-like
|
626
|
+
mechanism might be to specify the locally available tools for
|
627
|
+
document format translation. For example, the file could designate a
|
628
|
+
program for translating from format A to format B, another for
|
629
|
+
translating from format B to format C, and finally a mechanism for
|
630
|
+
displaying format C. Although this mechanism would be somewhat
|
631
|
+
richer than the current mailcap file, and might conceivably also have
|
632
|
+
utility at the message transport layer, it significantly complicates
|
633
|
+
the processing effort necessary for a user agent that simply wants to
|
634
|
+
display a message in format A. Using the current, simpler, mailcap
|
635
|
+
scheme, a single line could tell such a user agent to display A-
|
636
|
+
format mail using a pipeline of translators and the C-format viewer.
|
637
|
+
This memo resists the temptation to complicate the necessary
|
638
|
+
processing for a user agent to accomplish this task. Using the
|
639
|
+
mailcap format defined here, it is only necessary to find the correct
|
640
|
+
single line in a mailcap file, and to execute the command given in
|
641
|
+
that line.
|
642
|
+
|
643
|
+
References
|
644
|
+
|
645
|
+
[RFC-822] Crocker, D., "Standard for the format of ARPA Internet
|
646
|
+
text messages", STD 11, RFC 822, UDEL, August 1982.
|
647
|
+
|
648
|
+
[RFC-1521] Borenstein, N., and N. Freed, "MIME (Multipurpose
|
649
|
+
Internet Mail Extensions) Part One: Mechanisms for Specifying and
|
650
|
+
Describing the Format of Internet Message Bodies", RFC 1521,
|
651
|
+
Bellcore, Innosoft, September 1993.
|
652
|
+
|
653
|
+
|
654
|
+
|
655
|
+
|
656
|
+
|
657
|
+
|
658
|
+
|
659
|
+
|
660
|
+
|
661
|
+
|
662
|
+
|
663
|
+
|
664
|
+
|
665
|
+
|
666
|
+
|
667
|
+
|
668
|
+
|
669
|
+
|
670
|
+
|
671
|
+
|
672
|
+
|
673
|
+
|
674
|
+
Borenstein [Page 12]
|
675
|
+
|