summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore5
-rw-r--r--Cargo.toml17
-rw-r--r--LICENSE-APACHE201
-rw-r--r--LICENSE-MIT25
-rw-r--r--core/Cargo.toml45
-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.rs327
-rw-r--r--core/src/context.rs409
-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.rs68
-rw-r--r--core/src/macros.rs52
-rw-r--r--core/src/mail.rs889
-rw-r--r--core/src/mime.rs121
-rw-r--r--core/src/resource/data.rs350
-rw-r--r--core/src/resource/loading.rs191
-rw-r--r--core/src/resource/mod.rs193
-rw-r--r--core/src/resource/source.rs73
-rw-r--r--core/src/test_utils.rs42
-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.rs56
-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.toml53
-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.rs117
-rw-r--r--mail/src/lib.rs194
-rw-r--r--smtp/Cargo.toml27
-rw-r--r--smtp/README.md88
-rw-r--r--smtp/src/error.rs116
-rw-r--r--smtp/src/lib.rs109
-rw-r--r--smtp/src/request.rs297
-rw-r--r--smtp/src/resolve_all.rs81
-rw-r--r--smtp/src/send_mail.rs139
118 files changed, 17982 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..2933eec
--- /dev/null
+++ b/Cargo.toml
@@ -0,0 +1,17 @@
+[workspace]
+members = [
+ "mail",
+ "core",
+ "headers",
+ "internals",
+ "smtp"
+]
+
+
+#[patch.crates-io]
+#mail = { path="./mail" }
+#mail-core = { path="./core" }
+#mail-headers = { path="./headers" }
+#mail-internals = { path="./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 wh