Skip to content

Commit

Permalink
init from imap-flow PR #174
Browse files Browse the repository at this point in the history
  • Loading branch information
soywod committed May 29, 2024
0 parents commit d030ebe
Show file tree
Hide file tree
Showing 36 changed files with 3,901 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/target
/Cargo.lock

# IntelliJ, CLion, RustRover, ...
.idea

# direnv (https://direnv.net/)
.envrc
.direnv
40 changes: 40 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased] - YYYY-MM-DD

### Added

* Created README, CHANGELOG, badges, rustfmt.toml, ...
* Created project board
* Setup CI: Check, Build, Lint, Audit, Coverage, ...
* Licensed everything as "APACHE OR MIT"
* `imap-flow`
* Implemented literal handling, handles, events, and examples
* Implemented AUTHENTICATE and IDLE
* Implemented a self-test, and tested against a few providers
* `proxy`
* Implemented argument processing and configuration
* Smoke tested against a few providers (and a few MUAs)
* Provided a README
* Supported capabilities are ...
* AUTH={PLAIN,LOGIN,XOAUTH2,ScramSha1,ScramSha256}
* SASL-IR
* QUOTA*
* MOVE
* LITERAL+/LITERAL-
* UNSELECT
* ID
* IDLE
* Use ALPN==imap
* `imap-tasks` prototype
* Designed `Task`s trait
* Implemented `Task` for a few commands
* Implemented a task scheduler/manager
* `tag-generator`

[Unreleased]: https://github.com/duesee/imap-flow/compare/0a89b5e180ad7dfd3d67d1184370fa1028ea92b4...HEAD
23 changes: 23 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[package]
name = "imap-client"
version = "0.1.0"
edition = "2021"
license = "MIT"

[dependencies]
imap-flow = { git = "https://github.com/soywod/imap-flow", branch = "into-inner-stream" }
imap-types = "2"
once_cell = "1"
rustls-native-certs = "0.7.0"
tag-generator = { git = "https://github.com/duesee/imap-flow" }
thiserror = "1.0.50"
tokio = { version = "1.37.0", features = ["net", "time"] }
tokio-rustls = "0.26.0"
tracing = "0.1.40"

[dev-dependencies]
tokio = { version = "1.37.0", features = ["full"] }

[patch.crates-io]
imap-codec = { git = "https://github.com/duesee/imap-codec" }
imap-types = { git = "https://github.com/duesee/imap-codec" }
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 soywod <clement.douin@posteo.net>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# imap-client

*Work In Progress*
17 changes: 17 additions & 0 deletions deny.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[sources]
unknown-registry = "deny"
unknown-git = "deny"

allow-git = [
"https://github.com/duesee/imap-codec",
]

[licenses]
allow = [ "Apache-2.0", "BSD-3-Clause", "MIT", "Unicode-DFS-2016", "ISC", "OpenSSL" ]

[[licenses.clarify]]
name = "ring"
expression = "MIT AND ISC AND OpenSSL"
license-files = [
{ path = "LICENSE", hash = 0xbd0eed23 }
]
83 changes: 83 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

53 changes: 53 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.11";

# The rustup equivalent for Nix.
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};

# Allows non-flakes users to still be able to `nix-shell` based on
# `shell.nix` instead of this `flake.nix`.
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
};

outputs = { self, nixpkgs, fenix, ... }:
let
inherit (nixpkgs) lib;

eachSupportedSystem = lib.genAttrs supportedSystems;
supportedSystems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];

mkDevShells = system:
let
pkgs = import nixpkgs { inherit system; };

# get the rust toolchain from the rustup
# `rust-toolchain.toml` configuration file
rust-toolchain = fenix.packages.${system}.fromToolchainFile {
file = ./rust-toolchain.toml;
sha256 = "opUgs6ckUQCyDxcB9Wy51pqhd0MPGHUVbwRKKPGiwZU=";
};

in
{
default = pkgs.mkShell {
buildInputs = [ rust-toolchain ];
};
};

in
{
devShells = eachSupportedSystem mkDevShells;
};
}
4 changes: 4 additions & 0 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[toolchain]
channel = "stable"
profile = "default"
components = [ "rust-src", "rust-analyzer" ]
3 changes: 3 additions & 0 deletions rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
format_code_in_doc_comments=true
group_imports="StdExternalCrate"
imports_granularity="Crate"
13 changes: 13 additions & 0 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Compatiblity file for non-flake Nix users.
#
# <https://github.com/edolstra/flake-compat>
(import
(
let lock = builtins.fromJSON (builtins.readFile ./flake.lock); in
fetchTarball {
url = lock.nodes.flake-compat.locked.url or "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
sha256 = lock.nodes.flake-compat.locked.narHash;
}
)
{ src = ./.; }
).shellNix
Loading

0 comments on commit d030ebe

Please sign in to comment.