summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilipp Korber <p.korber@1aim.com>2018-11-16 15:46:43 +0100
committerPhilipp Korber <p.korber@1aim.com>2018-11-16 15:46:43 +0100
commit652d6f0ffeee7302a2cb51059bef75d8b0bb50be (patch)
treec3851592642938172f280f7428d43e08b0fe2cbe
parent0947fe8996149fe20a6d47a793f9555790eb2eae (diff)
refactor: merged sources of mail-headers,mail-internals,mail-core, mail
Originally it was palaned to do a merge with `--allow-unrelated-history` but this can not be doesn as `mail-core` has a "invalid" history which has a merge conflict **with itself**. So even rewinding the history on a empty repo is not possible. Instead the code was directly coppied over losing history. But the history is still available in the different `history-backup-*` branches. It is just that the past history is decoupled from the current history.
-rw-r--r--.gitignore5
-rw-r--r--Cargo.toml7
-rw-r--r--LICENSE-APACHE201
-rw-r--r--LICENSE-MIT25
-rw-r--r--core/Cargo.toml43
-rw-r--r--core/README.md94
-rw-r--r--core/examples/readme.rs57
-rw-r--r--core/notes/features/archive_resources.md34
-rw-r--r--core/notes/notes.md334
-rw-r--r--core/notes/structure.md157
-rw-r--r--core/src/compose.rs430
-rw-r--r--core/src/context.rs328
-rw-r--r--core/src/default_impl/cpupool.rs47
-rw-r--r--core/src/default_impl/fs.rs262
-rw-r--r--core/src/default_impl/message_id_gen.rs154
-rw-r--r--core/src/default_impl/mod.rs42
-rw-r--r--core/src/default_impl/mux.rs64
-rw-r--r--core/src/default_impl/simple_context.rs85
-rw-r--r--core/src/encode.rs203
-rw-r--r--core/src/error.rs293
-rw-r--r--core/src/iri.rs276
-rw-r--r--core/src/lib.rs63
-rw-r--r--core/src/macros.rs52
-rw-r--r--core/src/mail.rs906
-rw-r--r--core/src/mime.rs121
-rw-r--r--core/src/resource/data.rs348
-rw-r--r--core/src/resource/mod.rs181
-rw-r--r--core/src/resource/source.rs71
-rw-r--r--core/src/utils.rs33
-rwxr-xr-xcore/test.sh8
-rw-r--r--core/test_resources/img.jpgbin0 -> 630 bytes
-rw-r--r--core/test_resources/img.pngbin0 -> 324 bytes
-rw-r--r--core/test_resources/test.pdfbin0 -> 1779 bytes
-rw-r--r--core/test_resources/test2.pdfbin0 -> 24771 bytes
-rw-r--r--core/test_resources/text.txt1
-rw-r--r--core/test_resources/text.utf8.txt1
-rw-r--r--core/tests/mail.rs7
-rw-r--r--core/tests/resource/load_file.rs55
-rw-r--r--core/tests/resource/mod.rs2
-rw-r--r--headers/Cargo.toml35
-rw-r--r--headers/README.md150
-rw-r--r--headers/doc/list_of_headers.txt78
-rw-r--r--headers/src/convert.rs37
-rw-r--r--headers/src/data/inner_item.rs251
-rw-r--r--headers/src/data/input.rs131
-rw-r--r--headers/src/data/mod.rs23
-rw-r--r--headers/src/data/simple_item.rs113
-rw-r--r--headers/src/error.rs205
-rw-r--r--headers/src/header.rs253
-rw-r--r--headers/src/header_components/cfws.rs64
-rw-r--r--headers/src/header_components/date_time.rs90
-rw-r--r--headers/src/header_components/disposition.rs308
-rw-r--r--headers/src/header_components/email.rs404
-rw-r--r--headers/src/header_components/file_meta.rs80
-rw-r--r--headers/src/header_components/mailbox.rs212
-rw-r--r--headers/src/header_components/mailbox_list.rs300
-rw-r--r--headers/src/header_components/media_type.rs513
-rw-r--r--headers/src/header_components/message_id.rs353
-rw-r--r--headers/src/header_components/mod.rs66
-rw-r--r--headers/src/header_components/path.rs73
-rw-r--r--headers/src/header_components/phrase.rs127
-rw-r--r--headers/src/header_components/phrase_list.rs157
-rw-r--r--headers/src/header_components/raw_unstructured.rs87
-rw-r--r--headers/src/header_components/received_token.rs97
-rw-r--r--headers/src/header_components/transfer_encoding.rs117
-rw-r--r--headers/src/header_components/unstructured.rs194
-rw-r--r--headers/src/header_components/utils/mod.rs90
-rw-r--r--headers/src/header_components/utils/text_partition.rs62
-rw-r--r--headers/src/header_components/word.rs222
-rw-r--r--headers/src/header_macro.rs159
-rw-r--r--headers/src/headers.rs276
-rw-r--r--headers/src/lib.rs170
-rw-r--r--headers/src/macros.rs80
-rw-r--r--headers/src/map/into_iter.rs18
-rw-r--r--headers/src/map/mod.rs1042
-rw-r--r--headers/src/name.rs182
-rwxr-xr-xheaders/test.sh8
-rw-r--r--internals/Cargo.toml35
-rw-r--r--internals/README.md33
-rw-r--r--internals/src/bind/base64.rs262
-rw-r--r--internals/src/bind/encoded_word/impls.rs98
-rw-r--r--internals/src/bind/encoded_word/mod.rs92
-rw-r--r--internals/src/bind/idna.rs73
-rw-r--r--internals/src/bind/mime.rs56
-rw-r--r--internals/src/bind/mod.rs8
-rw-r--r--internals/src/bind/quoted_printable.rs360
-rw-r--r--internals/src/bind/quoted_string.rs101
-rw-r--r--internals/src/encoder/encodable.rs187
-rw-r--r--internals/src/encoder/mod.rs1712
-rw-r--r--internals/src/encoder/trace.rs167
-rw-r--r--internals/src/error.rs239
-rw-r--r--internals/src/grammar.rs423
-rw-r--r--internals/src/lib.rs40
-rw-r--r--internals/src/macros.rs61
-rw-r--r--internals/src/mail_type.rs47
-rw-r--r--internals/src/utils/mod.rs138
-rw-r--r--mail/Cargo.toml42
-rw-r--r--mail/README.md117
-rw-r--r--mail/example_resources/templates/template_a/html/logo.pngbin0 -> 343 bytes
-rw-r--r--mail/example_resources/templates/template_a/html/mail.html5
-rw-r--r--mail/example_resources/templates/template_a/portfolio.pdfbin0 -> 31571 bytes
-rw-r--r--mail/example_resources/templates/template_a/text/mail.txt1
-rw-r--r--mail/example_resources/tera_base/base_mail.html10
-rw-r--r--mail/examples/mail_by_hand.rs84
-rw-r--r--mail/examples/mail_from_template/error.rs56
-rw-r--r--mail/examples/mail_from_template/main.rs99
-rw-r--r--mail/examples/send_mail/cli.rs212
-rw-r--r--mail/examples/send_mail/main.rs114
-rw-r--r--mail/src/lib.rs193
-rw-r--r--mail/src/macros.rs33
110 files changed, 16915 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..a10770d
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,5 @@
+/target
+Cargo.lock
+.idea/
+.vscode/
+*.iml
diff --git a/Cargo.toml b/Cargo.toml
new file mode 100644
index 0000000..79d33e8
--- /dev/null
+++ b/Cargo.toml
@@ -0,0 +1,7 @@
+[workspace]
+members = [
+ "mail",
+ "core",
+ "headers",
+ "internals"
+]
diff --git a/LICENSE-APACHE b/LICENSE-APACHE
new file mode 100644
index 0000000..56434b8
--- /dev/null
+++ b/LICENSE-APACHE
@@ -0,0 +1,201 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an