1
0
Fork 0

Add kassandra mail handling

This commit is contained in:
Malte Brandy 2018-06-20 01:53:22 +02:00
parent 0e69827b22
commit 660728770e
No known key found for this signature in database
GPG key ID: 226A2D41EF5378C9
9 changed files with 772 additions and 29 deletions

View file

@ -1,3 +1,11 @@
[[package]]
name = "aho-corasick"
version = "0.6.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"memchr 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "backtrace"
version = "0.3.8"
@ -78,6 +86,7 @@ name = "dialog"
version = "0.1.0"
dependencies = [
"error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
"escapade 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
"rustyline 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"termios 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -157,6 +166,14 @@ dependencies = [
"backtrace 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "escapade"
version = "0.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"skeptic 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "fuchsia-zircon"
version = "0.3.3"
@ -171,6 +188,11 @@ name = "fuchsia-zircon-sys"
version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "getopts"
version = "0.2.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "itoa"
version = "0.4.1"
@ -226,6 +248,14 @@ dependencies = [
"quoted_printable 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "memchr"
version = "2.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "nix"
version = "0.5.1"
@ -256,6 +286,14 @@ dependencies = [
"unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "pulldown-cmark"
version = "0.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"getopts 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "quote"
version = "0.3.15"
@ -289,6 +327,34 @@ name = "redox_syscall"
version = "0.1.40"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "regex"
version = "0.2.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"aho-corasick 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
"memchr 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"regex-syntax 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)",
"thread_local 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
"utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "regex-syntax"
version = "0.5.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"ucd-util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "remove_dir_all"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "rust-scripts"
version = "0.1.0"
@ -299,6 +365,7 @@ dependencies = [
"lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"maildir 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"mailparse 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"regex 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.66 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 1.0.66 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_yaml 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)",
@ -360,6 +427,15 @@ dependencies = [
"yaml-rust 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "skeptic"
version = "0.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"pulldown-cmark 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
"tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "syn"
version = "0.11.11"
@ -402,6 +478,15 @@ dependencies = [
"uuid 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "tempdir"
version = "0.3.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
"remove_dir_all 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "termios"
version = "0.3.0"
@ -410,6 +495,15 @@ dependencies = [
"libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "thread_local"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "time"
version = "0.1.40"
@ -420,6 +514,11 @@ dependencies = [
"winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "ucd-util"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "unicode-width"
version = "0.1.5"
@ -435,6 +534,19 @@ name = "unicode-xid"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "unreachable"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "utf8-ranges"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "uuid"
version = "0.6.5"
@ -445,6 +557,11 @@ dependencies = [
"serde 1.0.66 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "void"
version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "winapi"
version = "0.2.8"
@ -483,6 +600,7 @@ dependencies = [
]
[metadata]
"checksum aho-corasick 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "d6531d44de723825aa81398a6415283229725a00fa30713812ab9323faa82fc4"
"checksum backtrace 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "dbdd17cd962b570302f5297aea8648d5923e22e555c2ed2d8b2e34eca646bf6d"
"checksum backtrace-sys 0.1.23 (registry+https://github.com/rust-lang/crates.io-index)" = "bff67d0c06556c0b8e6b5f090f0eac52d950d9dfd1d35ba04e4ca3543eaf6a7e"
"checksum base64 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a51012ca17f843e723dedc71fdd7feac9d8b53be85492aa9232b2da59ce6bb3b"
@ -503,8 +621,10 @@ dependencies = [
"checksum encoding-index-tradchinese 1.20141219.5 (registry+https://github.com/rust-lang/crates.io-index)" = "fd0e20d5688ce3cab59eb3ef3a2083a5c77bf496cb798dc6fcdb75f323890c18"
"checksum encoding_index_tests 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "a246d82be1c9d791c5dfde9a2bd045fc3cbba3fa2b11ad558f27d01712f00569"
"checksum error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ff511d5dc435d703f4971bc399647c9bc38e20cb41452e3b9feb4765419ed3f3"
"checksum escapade 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "35b9acc46ed70fdce0026d52968dc22a579ede823a495be8d62837efe8f76c45"
"checksum fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82"
"checksum fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7"
"checksum getopts 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)" = "b900c08c1939860ce8b54dc6a89e26e00c04c380fd0e09796799bd7f12861e05"
"checksum itoa 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c069bbec61e1ca5a596166e55dfe4773ff745c3d16b700013bcaff9a6df2c682"
"checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d"
"checksum lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e6412c5e2ad9584b0b8e979393122026cdd6d2a80b933f890dcd694ddbe73739"
@ -513,30 +633,42 @@ dependencies = [
"checksum log 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6fddaa003a65722a7fb9e26b0ce95921fe4ba590542ced664d8ce2fa26f9f3ac"
"checksum maildir 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "83d9b449b6ff23db5eda044963296380c74941ac9480fc629840d7405e436c73"
"checksum mailparse 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "517ae98201a037bbd2dccdf88763e5818b26fc98a46725ae524424de2f67339f"
"checksum memchr 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "796fba70e76612589ed2ce7f45282f5af869e0fdd7cc6199fa1aa1f1d591ba9d"
"checksum nix 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "bfb3ddedaa14746434a02041940495bf11325c22f6d36125d3bdd56090d50a79"
"checksum num-integer 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)" = "6ac0ea58d64a89d9d6b7688031b3be9358d6c919badcf7fbb0527ccfd891ee45"
"checksum num-traits 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "775393e285254d2f5004596d69bb8bc1149754570dcc08cf30cabeba67955e28"
"checksum proc-macro2 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "effdb53b25cdad54f8f48843d67398f7ef2e14f12c1b4cb4effc549a6462a4d6"
"checksum pulldown-cmark 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8361e81576d2e02643b04950e487ec172b687180da65c731c03cf336784e6c07"
"checksum quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a"
"checksum quote 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e44651a0dc4cdd99f71c83b561e221f714912d11af1a4dff0631f923d53af035"
"checksum quoted_printable 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ec1a063e17beecae242623379d30100975588fb3d2a4bf1df8550d872268a89f"
"checksum rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "eba5f8cb59cc50ed56be8880a5c7b496bfd9bd26394e176bc67884094145c2c5"
"checksum redox_syscall 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)" = "c214e91d3ecf43e9a4e41e578973adeb14b474f2bee858742d127af75a0112b1"
"checksum regex 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "9329abc99e39129fcceabd24cf5d85b4671ef7c29c50e972bc5afe32438ec384"
"checksum regex-syntax 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7d707a4fa2637f2dca2ef9fd02225ec7661fe01a53623c1e6515b6916511f7a7"
"checksum remove_dir_all 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3488ba1b9a2084d38645c4c08276a1752dcbf2c7130d74f1569681ad5d2799c5"
"checksum rustc-demangle 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "76d7ba1feafada44f2d38eed812bd2489a03c0f5abb975799251518b68848649"
"checksum rustyline 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "00b06ac9c8e8e3e83b33d175d39a9f7b6c2c930c82990593719c8e48788ae2d9"
"checksum serde 1.0.66 (registry+https://github.com/rust-lang/crates.io-index)" = "e9a2d9a9ac5120e0f768801ca2b58ad6eec929dc9d1d616c162f208869c2ce95"
"checksum serde_derive 1.0.66 (registry+https://github.com/rust-lang/crates.io-index)" = "0a90213fa7e0f5eac3f7afe2d5ff6b088af515052cc7303bd68c7e3b91a3fb79"
"checksum serde_json 1.0.20 (registry+https://github.com/rust-lang/crates.io-index)" = "fc97cccc2959f39984524026d760c08ef0dd5f0f5948c8d31797dbfae458c875"
"checksum serde_yaml 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)" = "107bb818146aaf922e7bbcf6a940f1db2f0dcf381779b451e400331b2c6f86db"
"checksum skeptic 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "34c7f11b6755efa4abfd2739426c17de0a36153510bacd6147113fd3a9f2634d"
"checksum syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)" = "d3b891b9015c88c576343b9b3e41c2c11a51c219ef067b264bd9c8aa9b441dad"
"checksum syn 0.14.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c67da57e61ebc7b7b6fff56bb34440ca3a83db037320b0507af4c10368deda7d"
"checksum synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a393066ed9010ebaed60b9eafa373d4b1baac186dd7e008555b0f702b51945b6"
"checksum tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)" = "15f2b5fb00ccdf689e0149d1b1b3c03fead81c2b37735d812fa8bddbbf41b6d8"
"checksum termios 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "70226acdf12d182df757d9fb07c0257a1558ec48c8059f607d6b38145ce4e2fa"
"checksum thread_local 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "279ef31c19ededf577bfd12dfae728040a21f635b06a24cd670ff510edd38963"
"checksum time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)" = "d825be0eb33fda1a7e68012d51e9c7f451dc1a69391e7fdc197060bb8c56667b"
"checksum ucd-util 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "fd2be2d6639d0f8fe6cdda291ad456e23629558d466e2789d2c3e9892bda285d"
"checksum unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "882386231c45df4700b275c7ff55b6f3698780a650026380e72dabe76fa46526"
"checksum unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f860d7d29cf02cb2f3f359fd35991af3d30bac52c57d265a3c461074cb4dc"
"checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc"
"checksum unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56"
"checksum utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "662fab6525a98beff2921d7f61a39e7d59e0b425ebc7d0d9e66d316e55124122"
"checksum uuid 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e1436e58182935dcd9ce0add9ea0b558e8a87befe01c1a301e6020aeb0876363"
"checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d"
"checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a"
"checksum winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "773ef9dcc5f24b7d850d0ff101e542ff24c3b090a9768e03ff889fdef41f00fd"
"checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc"

View file

@ -20,6 +20,15 @@ in
rec {
rust_scripts = f: rust_scripts_0_1_0 { features = rust_scripts_0_1_0_features { rust_scripts_0_1_0 = f; }; };
__all = [ (rust_scripts {}) ];
aho_corasick_0_6_4_ = { dependencies?[], buildDependencies?[], features?[] }: buildRustCrate {
crateName = "aho-corasick";
version = "0.6.4";
authors = [ "Andrew Gallant <jamslam@gmail.com>" ];
sha256 = "189v919mp6rzzgjp1khpn4zlq8ls81gh43x1lmc8kbkagdlpq888";
libName = "aho_corasick";
crateBin = [ { name = "aho-corasick-dot"; } ];
inherit dependencies buildDependencies features;
};
backtrace_0_3_8_ = { dependencies?[], buildDependencies?[], features?[] }: buildRustCrate {
crateName = "backtrace";
version = "0.3.8";
@ -181,6 +190,14 @@ rec {
sha256 = "19nz17q6dzp0mx2jhh9qbj45gkvvgcl7zq9z2ai5a8ihbisfj6d7";
inherit dependencies buildDependencies features;
};
escapade_0_0_3_ = { dependencies?[], buildDependencies?[], features?[] }: buildRustCrate {
crateName = "escapade";
version = "0.0.3";
authors = [ "Florian Gilcher <florian.gilcher@asquera.de>" ];
sha256 = "084dxfi7f1c1aza1y7wvl6l7hmlnb5nabw3nqck32hnrrlhkimcl";
build = "build.rs";
inherit dependencies buildDependencies features;
};
fuchsia_zircon_0_3_3_ = { dependencies?[], buildDependencies?[], features?[] }: buildRustCrate {
crateName = "fuchsia-zircon";
version = "0.3.3";
@ -195,6 +212,13 @@ rec {
sha256 = "08jp1zxrm9jbrr6l26bjal4dbm8bxfy57ickdgibsqxr1n9j3hf5";
inherit dependencies buildDependencies features;
};
getopts_0_2_17_ = { dependencies?[], buildDependencies?[], features?[] }: buildRustCrate {
crateName = "getopts";
version = "0.2.17";
authors = [ "The Rust Project Developers" ];
sha256 = "1rifkxn7njr2w1dsa29hrm26ywgcg8gv1ms00g3vs5mjiabxk0jv";
inherit dependencies buildDependencies features;
};
itoa_0_4_1_ = { dependencies?[], buildDependencies?[], features?[] }: buildRustCrate {
crateName = "itoa";
version = "0.4.1";
@ -253,6 +277,13 @@ rec {
sha256 = "12dm30w9k6qd1v8sr17960nyslsq2j4l0iy1rpd0p513daggxnlf";
inherit dependencies buildDependencies features;
};
memchr_2_0_1_ = { dependencies?[], buildDependencies?[], features?[] }: buildRustCrate {
crateName = "memchr";
version = "2.0.1";
authors = [ "Andrew Gallant <jamslam@gmail.com>" "bluss" ];
sha256 = "0ls2y47rjwapjdax6bp974gdp06ggm1v8d1h69wyydmh1nhgm5gr";
inherit dependencies buildDependencies features;
};
nix_0_5_1_ = { dependencies?[], buildDependencies?[], features?[] }: buildRustCrate {
crateName = "nix";
version = "0.5.1";
@ -283,6 +314,13 @@ rec {
sha256 = "0lnxcavz5nqxypjyz6isffqiyxb3h0021nkn8djsl33a4qd4pxv6";
inherit dependencies buildDependencies features;
};
pulldown_cmark_0_0_3_ = { dependencies?[], buildDependencies?[], features?[] }: buildRustCrate {
crateName = "pulldown-cmark";
version = "0.0.3";
authors = [ "Raph Levien <raph@google.com>" ];
sha256 = "08wgdjqjnaz8yjvamdwcf1cqz18z795frkmbal9rgp9g2i1yrzwy";
inherit dependencies buildDependencies features;
};
quote_0_3_15_ = { dependencies?[], buildDependencies?[], features?[] }: buildRustCrate {
crateName = "quote";
version = "0.3.15";
@ -319,6 +357,27 @@ rec {
libName = "syscall";
inherit dependencies buildDependencies features;
};
regex_0_2_11_ = { dependencies?[], buildDependencies?[], features?[] }: buildRustCrate {
crateName = "regex";
version = "0.2.11";
authors = [ "The Rust Project Developers" ];
sha256 = "0r50cymxdqp0fv1dxd22mjr6y32q450nwacd279p9s7lh0cafijj";
inherit dependencies buildDependencies features;
};
regex_syntax_0_5_6_ = { dependencies?[], buildDependencies?[], features?[] }: buildRustCrate {
crateName = "regex-syntax";
version = "0.5.6";
authors = [ "The Rust Project Developers" ];
sha256 = "10vf3r34bgjnbrnqd5aszn35bjvm8insw498l1vjy8zx5yms3427";
inherit dependencies buildDependencies features;
};
remove_dir_all_0_5_1_ = { dependencies?[], buildDependencies?[], features?[] }: buildRustCrate {
crateName = "remove_dir_all";
version = "0.5.1";
authors = [ "Aaronepower <theaaronepower@gmail.com>" ];
sha256 = "1chx3yvfbj46xjz4bzsvps208l46hfbcy0sm98gpiya454n4rrl7";
inherit dependencies buildDependencies features;
};
rust_scripts_0_1_0_ = { dependencies?[], buildDependencies?[], features?[] }: buildRustCrate {
crateName = "rust-scripts";
version = "0.1.0";
@ -370,6 +429,14 @@ rec {
sha256 = "03zcqcr643i4knpkhs250d60yvildhcmcsc6s9gxmkax5khc8qwg";
inherit dependencies buildDependencies features;
};
skeptic_0_6_1_ = { dependencies?[], buildDependencies?[], features?[] }: buildRustCrate {
crateName = "skeptic";
version = "0.6.1";
authors = [ "Brian Anderson <banderson@mozilla.com>" ];
sha256 = "1f6lls5lz1g2ipkyl5f00c3algcdssgbla1s7ywzkkw8gx2vx0qx";
libPath = "lib.rs";
inherit dependencies buildDependencies features;
};
syn_0_11_11_ = { dependencies?[], buildDependencies?[], features?[] }: buildRustCrate {
crateName = "syn";
version = "0.11.11";
@ -398,6 +465,13 @@ rec {
src = /home/maralorn/data/aktuell/it/code/task-hookrs;
inherit dependencies buildDependencies features;
};
tempdir_0_3_7_ = { dependencies?[], buildDependencies?[], features?[] }: buildRustCrate {
crateName = "tempdir";
version = "0.3.7";
authors = [ "The Rust Project Developers" ];
sha256 = "0y53sxybyljrr7lh0x0ysrsa7p7cljmwv9v80acy3rc6n97g67vy";
inherit dependencies buildDependencies features;
};
termios_0_3_0_ = { dependencies?[], buildDependencies?[], features?[] }: buildRustCrate {
crateName = "termios";
version = "0.3.0";
@ -405,6 +479,13 @@ rec {
sha256 = "0d5vpwdaimbq2pz4a4njcyxc2spvssxn2v8n9mc6flys4h0ir9nv";
inherit dependencies buildDependencies features;
};
thread_local_0_3_5_ = { dependencies?[], buildDependencies?[], features?[] }: buildRustCrate {
crateName = "thread_local";
version = "0.3.5";
authors = [ "Amanieu d'Antras <amanieu@gmail.com>" ];
sha256 = "0mkp0sp91aqsk7brgygai4igv751r1754rsxn37mig3ag5rx8np6";
inherit dependencies buildDependencies features;
};
time_0_1_40_ = { dependencies?[], buildDependencies?[], features?[] }: buildRustCrate {
crateName = "time";
version = "0.1.40";
@ -412,6 +493,13 @@ rec {
sha256 = "0wgnbjamljz6bqxsd5axc4p2mmhkqfrryj4gf2yswjaxiw5dd01m";
inherit dependencies buildDependencies features;
};
ucd_util_0_1_1_ = { dependencies?[], buildDependencies?[], features?[] }: buildRustCrate {
crateName = "ucd-util";
version = "0.1.1";
authors = [ "Andrew Gallant <jamslam@gmail.com>" ];
sha256 = "02a8h3siipx52b832xc8m8rwasj6nx9jpiwfldw8hp6k205hgkn0";
inherit dependencies buildDependencies features;
};
unicode_width_0_1_5_ = { dependencies?[], buildDependencies?[], features?[] }: buildRustCrate {
crateName = "unicode-width";
version = "0.1.5";
@ -433,6 +521,20 @@ rec {
sha256 = "05wdmwlfzxhq3nhsxn6wx4q8dhxzzfb9szsz6wiw092m1rjj01zj";
inherit dependencies buildDependencies features;
};
unreachable_1_0_0_ = { dependencies?[], buildDependencies?[], features?[] }: buildRustCrate {
crateName = "unreachable";
version = "1.0.0";
authors = [ "Jonathan Reem <jonathan.reem@gmail.com>" ];
sha256 = "1am8czbk5wwr25gbp2zr007744fxjshhdqjz9liz7wl4pnv3whcf";
inherit dependencies buildDependencies features;
};
utf8_ranges_1_0_0_ = { dependencies?[], buildDependencies?[], features?[] }: buildRustCrate {
crateName = "utf8-ranges";
version = "1.0.0";
authors = [ "Andrew Gallant <jamslam@gmail.com>" ];
sha256 = "0rzmqprwjv9yp1n0qqgahgm24872x6c0xddfym5pfndy7a36vkn0";
inherit dependencies buildDependencies features;
};
uuid_0_6_5_ = { dependencies?[], buildDependencies?[], features?[] }: buildRustCrate {
crateName = "uuid";
version = "0.6.5";
@ -440,6 +542,13 @@ rec {
sha256 = "1jy15m4yxxwma0jsy070garhbgfprky23i77rawjkk75vqhnnhlf";
inherit dependencies buildDependencies features;
};
void_1_0_2_ = { dependencies?[], buildDependencies?[], features?[] }: buildRustCrate {
crateName = "void";
version = "1.0.2";
authors = [ "Jonathan Reem <jonathan.reem@gmail.com>" ];
sha256 = "0h1dm0dx8dhf56a83k68mijyxigqhizpskwxfdrs1drwv2cdclv3";
inherit dependencies buildDependencies features;
};
winapi_0_2_8_ = { dependencies?[], buildDependencies?[], features?[] }: buildRustCrate {
crateName = "winapi";
version = "0.2.8";
@ -486,6 +595,13 @@ rec {
sha256 = "1mqv1jagn9hfym28ypp2dq6hw9kcyilzil9ydlpls0ivb8d9i3h8";
inherit dependencies buildDependencies features;
};
aho_corasick_0_6_4 = { features?(aho_corasick_0_6_4_features {}) }: aho_corasick_0_6_4_ {
dependencies = mapFeatures features ([ memchr_2_0_1 ]);
};
aho_corasick_0_6_4_features = f: updateFeatures f (rec {
aho_corasick_0_6_4.default = (f.aho_corasick_0_6_4.default or true);
memchr_2_0_1.default = true;
}) [ memchr_2_0_1_features ];
backtrace_0_3_8 = { features?(backtrace_0_3_8_features {}) }: backtrace_0_3_8_ {
dependencies = mapFeatures features ([ cfg_if_0_1_3 rustc_demangle_0_1_8 ])
++ (if (kernel == "linux" || kernel == "darwin") && !(kernel == "fuchsia") && !(kernel == "emscripten") && !(kernel == "darwin") && !(kernel == "ios") then mapFeatures features ([ ]
@ -672,14 +788,15 @@ rec {
syn_0_11_11.default = true;
}) [ quote_0_3_15_features syn_0_11_11_features ];
dialog_0_1_0 = { features?(dialog_0_1_0_features {}) }: dialog_0_1_0_ {
dependencies = mapFeatures features ([ error_chain_0_11_0 rustyline_1_0_0 termios_0_3_0 ]);
dependencies = mapFeatures features ([ error_chain_0_11_0 escapade_0_0_3 rustyline_1_0_0 termios_0_3_0 ]);
};
dialog_0_1_0_features = f: updateFeatures f (rec {
dialog_0_1_0.default = (f.dialog_0_1_0.default or true);
error_chain_0_11_0.default = true;
escapade_0_0_3.default = true;
rustyline_1_0_0.default = true;
termios_0_3_0.default = true;
}) [ error_chain_0_11_0_features rustyline_1_0_0_features termios_0_3_0_features ];
}) [ error_chain_0_11_0_features escapade_0_0_3_features rustyline_1_0_0_features termios_0_3_0_features ];
dtoa_0_4_2 = { features?(dtoa_0_4_2_features {}) }: dtoa_0_4_2_ {};
dtoa_0_4_2_features = f: updateFeatures f (rec {
dtoa_0_4_2.default = (f.dtoa_0_4_2.default or true);
@ -757,6 +874,12 @@ rec {
(f.error_chain_0_11_0.default or false) ||
(error_chain_0_11_0.default or false);
}) [ backtrace_0_3_8_features ];
escapade_0_0_3 = { features?(escapade_0_0_3_features {}) }: escapade_0_0_3_ {
buildDependencies = mapFeatures features ([ skeptic_0_6_1 ]);};
escapade_0_0_3_features = f: updateFeatures f (rec {
escapade_0_0_3.default = (f.escapade_0_0_3.default or true);
skeptic_0_6_1.default = true;
}) [ skeptic_0_6_1_features ];
fuchsia_zircon_0_3_3 = { features?(fuchsia_zircon_0_3_3_features {}) }: fuchsia_zircon_0_3_3_ {
dependencies = mapFeatures features ([ bitflags_1_0_3 fuchsia_zircon_sys_0_3_3 ]);
};
@ -769,6 +892,10 @@ rec {
fuchsia_zircon_sys_0_3_3_features = f: updateFeatures f (rec {
fuchsia_zircon_sys_0_3_3.default = (f.fuchsia_zircon_sys_0_3_3.default or true);
}) [];
getopts_0_2_17 = { features?(getopts_0_2_17_features {}) }: getopts_0_2_17_ {};
getopts_0_2_17_features = f: updateFeatures f (rec {
getopts_0_2_17.default = (f.getopts_0_2_17.default or true);
}) [];
itoa_0_4_1 = { features?(itoa_0_4_1_features {}) }: itoa_0_4_1_ {
features = mkFeatures (features.itoa_0_4_1 or {});
};
@ -856,6 +983,29 @@ rec {
mailparse_0_5_1.default = (f.mailparse_0_5_1.default or true);
quoted_printable_0_3_3.default = true;
}) [ base64_0_1_1_features encoding_0_2_33_features quoted_printable_0_3_3_features ];
memchr_2_0_1 = { features?(memchr_2_0_1_features {}) }: memchr_2_0_1_ {
dependencies = mapFeatures features ([ ]
++ (if features.memchr_2_0_1.libc or false then [ libc_0_2_42 ] else []));
features = mkFeatures (features.memchr_2_0_1 or {});
};
memchr_2_0_1_features = f: updateFeatures f (rec {
libc_0_2_42.default = (f.libc_0_2_42.default or false);
libc_0_2_42.use_std =
(f.libc_0_2_42.use_std or false) ||
(memchr_2_0_1.use_std or false) ||
(f.memchr_2_0_1.use_std or false);
memchr_2_0_1.default = (f.memchr_2_0_1.default or true);
memchr_2_0_1.libc =
(f.memchr_2_0_1.libc or false) ||
(f.memchr_2_0_1.default or false) ||
(memchr_2_0_1.default or false) ||
(f.memchr_2_0_1.use_std or false) ||
(memchr_2_0_1.use_std or false);
memchr_2_0_1.use_std =
(f.memchr_2_0_1.use_std or false) ||
(f.memchr_2_0_1.default or false) ||
(memchr_2_0_1.default or false);
}) [ libc_0_2_42_features ];
nix_0_5_1 = { features?(nix_0_5_1_features {}) }: nix_0_5_1_ {
dependencies = mapFeatures features ([ bitflags_0_4_0 libc_0_2_42 ]);
features = mkFeatures (features.nix_0_5_1 or {});
@ -909,6 +1059,13 @@ rec {
(proc_macro2_0_4_6.nightly or false);
unicode_xid_0_1_0.default = true;
}) [ unicode_xid_0_1_0_features ];
pulldown_cmark_0_0_3 = { features?(pulldown_cmark_0_0_3_features {}) }: pulldown_cmark_0_0_3_ {
dependencies = mapFeatures features ([ getopts_0_2_17 ]);
};
pulldown_cmark_0_0_3_features = f: updateFeatures f (rec {
getopts_0_2_17.default = true;
pulldown_cmark_0_0_3.default = (f.pulldown_cmark_0_0_3.default or true);
}) [ getopts_0_2_17_features ];
quote_0_3_15 = { features?(quote_0_3_15_features {}) }: quote_0_3_15_ {};
quote_0_3_15_features = f: updateFeatures f (rec {
quote_0_3_15.default = (f.quote_0_3_15.default or true);
@ -966,8 +1123,43 @@ rec {
redox_syscall_0_1_40_features = f: updateFeatures f (rec {
redox_syscall_0_1_40.default = (f.redox_syscall_0_1_40.default or true);
}) [];
regex_0_2_11 = { features?(regex_0_2_11_features {}) }: regex_0_2_11_ {
dependencies = mapFeatures features ([ aho_corasick_0_6_4 memchr_2_0_1 regex_syntax_0_5_6 thread_local_0_3_5 utf8_ranges_1_0_0 ]);
features = mkFeatures (features.regex_0_2_11 or {});
};
regex_0_2_11_features = f: updateFeatures f (rec {
aho_corasick_0_6_4.default = true;
memchr_2_0_1.default = true;
regex_0_2_11.default = (f.regex_0_2_11.default or true);
regex_0_2_11.pattern =
(f.regex_0_2_11.pattern or false) ||
(f.regex_0_2_11.unstable or false) ||
(regex_0_2_11.unstable or false);
regex_syntax_0_5_6.default = true;
thread_local_0_3_5.default = true;
utf8_ranges_1_0_0.default = true;
}) [ aho_corasick_0_6_4_features memchr_2_0_1_features regex_syntax_0_5_6_features thread_local_0_3_5_features utf8_ranges_1_0_0_features ];
regex_syntax_0_5_6 = { features?(regex_syntax_0_5_6_features {}) }: regex_syntax_0_5_6_ {
dependencies = mapFeatures features ([ ucd_util_0_1_1 ]);
};
regex_syntax_0_5_6_features = f: updateFeatures f (rec {
regex_syntax_0_5_6.default = (f.regex_syntax_0_5_6.default or true);
ucd_util_0_1_1.default = true;
}) [ ucd_util_0_1_1_features ];
remove_dir_all_0_5_1 = { features?(remove_dir_all_0_5_1_features {}) }: remove_dir_all_0_5_1_ {
dependencies = (if kernel == "windows" then mapFeatures features ([ winapi_0_3_5 ]) else []);
};
remove_dir_all_0_5_1_features = f: updateFeatures f (rec {
remove_dir_all_0_5_1.default = (f.remove_dir_all_0_5_1.default or true);
winapi_0_3_5.default = true;
winapi_0_3_5.errhandlingapi = true;
winapi_0_3_5.fileapi = true;
winapi_0_3_5.std = true;
winapi_0_3_5.winbase = true;
winapi_0_3_5.winerror = true;
}) [ winapi_0_3_5_features ];
rust_scripts_0_1_0 = { features?(rust_scripts_0_1_0_features {}) }: rust_scripts_0_1_0_ {
dependencies = mapFeatures features ([ chrono_0_4_2 dialog_0_1_0 error_chain_0_11_0 lazy_static_1_0_1 maildir_0_1_1 mailparse_0_5_1 serde_1_0_66 serde_derive_1_0_66 serde_yaml_0_7_4 task_hookrs_0_5_0 uuid_0_6_5 ]);
dependencies = mapFeatures features ([ chrono_0_4_2 dialog_0_1_0 error_chain_0_11_0 lazy_static_1_0_1 maildir_0_1_1 mailparse_0_5_1 regex_0_2_11 serde_1_0_66 serde_derive_1_0_66 serde_yaml_0_7_4 task_hookrs_0_5_0 uuid_0_6_5 ]);
};
rust_scripts_0_1_0_features = f: updateFeatures f (rec {
chrono_0_4_2.default = true;
@ -976,13 +1168,14 @@ rec {
lazy_static_1_0_1.default = true;
maildir_0_1_1.default = true;
mailparse_0_5_1.default = true;
regex_0_2_11.default = true;
rust_scripts_0_1_0.default = (f.rust_scripts_0_1_0.default or true);
serde_1_0_66.default = true;
serde_derive_1_0_66.default = true;
serde_yaml_0_7_4.default = true;
task_hookrs_0_5_0.default = true;
uuid_0_6_5.default = true;
}) [ chrono_0_4_2_features dialog_0_1_0_features error_chain_0_11_0_features lazy_static_1_0_1_features maildir_0_1_1_features mailparse_0_5_1_features serde_1_0_66_features serde_derive_1_0_66_features serde_yaml_0_7_4_features task_hookrs_0_5_0_features uuid_0_6_5_features ];
}) [ chrono_0_4_2_features dialog_0_1_0_features error_chain_0_11_0_features lazy_static_1_0_1_features maildir_0_1_1_features mailparse_0_5_1_features regex_0_2_11_features serde_1_0_66_features serde_derive_1_0_66_features serde_yaml_0_7_4_features task_hookrs_0_5_0_features uuid_0_6_5_features ];
rustc_demangle_0_1_8 = { features?(rustc_demangle_0_1_8_features {}) }: rustc_demangle_0_1_8_ {};
rustc_demangle_0_1_8_features = f: updateFeatures f (rec {
rustc_demangle_0_1_8.default = (f.rustc_demangle_0_1_8.default or true);
@ -1055,6 +1248,14 @@ rec {
serde_yaml_0_7_4.default = (f.serde_yaml_0_7_4.default or true);
yaml_rust_0_4_0.default = true;
}) [ dtoa_0_4_2_features linked_hash_map_0_5_1_features serde_1_0_66_features yaml_rust_0_4_0_features ];
skeptic_0_6_1 = { features?(skeptic_0_6_1_features {}) }: skeptic_0_6_1_ {
dependencies = mapFeatures features ([ pulldown_cmark_0_0_3 tempdir_0_3_7 ]);
};
skeptic_0_6_1_features = f: updateFeatures f (rec {
pulldown_cmark_0_0_3.default = true;
skeptic_0_6_1.default = (f.skeptic_0_6_1.default or true);
tempdir_0_3_7.default = true;
}) [ pulldown_cmark_0_0_3_features tempdir_0_3_7_features ];
syn_0_11_11 = { features?(syn_0_11_11_features {}) }: syn_0_11_11_ {
dependencies = mapFeatures features ([ ]
++ (if features.syn_0_11_11.quote or false then [ quote_0_3_15 ] else [])
@ -1154,6 +1355,14 @@ rec {
uuid_0_6_5.serde = true;
uuid_0_6_5.v4 = true;
}) [ chrono_0_4_2_features derive_builder_0_5_1_features error_chain_0_11_0_features log_0_4_2_features serde_1_0_66_features serde_derive_1_0_66_features serde_json_1_0_20_features uuid_0_6_5_features ];
tempdir_0_3_7 = { features?(tempdir_0_3_7_features {}) }: tempdir_0_3_7_ {
dependencies = mapFeatures features ([ rand_0_4_2 remove_dir_all_0_5_1 ]);
};
tempdir_0_3_7_features = f: updateFeatures f (rec {
rand_0_4_2.default = true;
remove_dir_all_0_5_1.default = true;
tempdir_0_3_7.default = (f.tempdir_0_3_7.default or true);
}) [ rand_0_4_2_features remove_dir_all_0_5_1_features ];
termios_0_3_0 = { features?(termios_0_3_0_features {}) }: termios_0_3_0_ {
dependencies = mapFeatures features ([ libc_0_2_42 ]);
};
@ -1161,6 +1370,14 @@ rec {
libc_0_2_42.default = true;
termios_0_3_0.default = (f.termios_0_3_0.default or true);
}) [ libc_0_2_42_features ];
thread_local_0_3_5 = { features?(thread_local_0_3_5_features {}) }: thread_local_0_3_5_ {
dependencies = mapFeatures features ([ lazy_static_1_0_1 unreachable_1_0_0 ]);
};
thread_local_0_3_5_features = f: updateFeatures f (rec {
lazy_static_1_0_1.default = true;
thread_local_0_3_5.default = (f.thread_local_0_3_5.default or true);
unreachable_1_0_0.default = true;
}) [ lazy_static_1_0_1_features unreachable_1_0_0_features ];
time_0_1_40 = { features?(time_0_1_40_features {}) }: time_0_1_40_ {
dependencies = mapFeatures features ([ libc_0_2_42 ])
++ (if kernel == "redox" then mapFeatures features ([ redox_syscall_0_1_40 ]) else [])
@ -1179,6 +1396,10 @@ rec {
winapi_0_3_5.sysinfoapi = true;
winapi_0_3_5.timezoneapi = true;
}) [ libc_0_2_42_features redox_syscall_0_1_40_features winapi_0_3_5_features ];
ucd_util_0_1_1 = { features?(ucd_util_0_1_1_features {}) }: ucd_util_0_1_1_ {};
ucd_util_0_1_1_features = f: updateFeatures f (rec {
ucd_util_0_1_1.default = (f.ucd_util_0_1_1.default or true);
}) [];
unicode_width_0_1_5 = { features?(unicode_width_0_1_5_features {}) }: unicode_width_0_1_5_ {
features = mkFeatures (features.unicode_width_0_1_5 or {});
};
@ -1197,6 +1418,17 @@ rec {
unicode_xid_0_1_0_features = f: updateFeatures f (rec {
unicode_xid_0_1_0.default = (f.unicode_xid_0_1_0.default or true);
}) [];
unreachable_1_0_0 = { features?(unreachable_1_0_0_features {}) }: unreachable_1_0_0_ {
dependencies = mapFeatures features ([ void_1_0_2 ]);
};
unreachable_1_0_0_features = f: updateFeatures f (rec {
unreachable_1_0_0.default = (f.unreachable_1_0_0.default or true);
void_1_0_2.default = (f.void_1_0_2.default or false);
}) [ void_1_0_2_features ];
utf8_ranges_1_0_0 = { features?(utf8_ranges_1_0_0_features {}) }: utf8_ranges_1_0_0_ {};
utf8_ranges_1_0_0_features = f: updateFeatures f (rec {
utf8_ranges_1_0_0.default = (f.utf8_ranges_1_0_0.default or true);
}) [];
uuid_0_6_5 = { features?(uuid_0_6_5_features {}) }: uuid_0_6_5_ {
dependencies = mapFeatures features ([ cfg_if_0_1_3 ]
++ (if features.uuid_0_6_5.rand or false then [ rand_0_4_2 ] else [])
@ -1239,6 +1471,16 @@ rec {
(f.uuid_0_6_5.use_std or false) ||
(uuid_0_6_5.use_std or false);
}) [ cfg_if_0_1_3_features rand_0_4_2_features serde_1_0_66_features ];
void_1_0_2 = { features?(void_1_0_2_features {}) }: void_1_0_2_ {
features = mkFeatures (features.void_1_0_2 or {});
};
void_1_0_2_features = f: updateFeatures f (rec {
void_1_0_2.default = (f.void_1_0_2.default or true);
void_1_0_2.std =
(f.void_1_0_2.std or false) ||
(f.void_1_0_2.default or false) ||
(void_1_0_2.default or false);
}) [];
winapi_0_2_8 = { features?(winapi_0_2_8_features {}) }: winapi_0_2_8_ {};
winapi_0_2_8_features = f: updateFeatures f (rec {
winapi_0_2_8.default = (f.winapi_0_2_8.default or true);

View file

@ -16,3 +16,4 @@ serde = "1.0"
serde_yaml = "0.7"
maildir = "0.1.1"
mailparse = "0.5.1"
regex = "0.2"

View file

@ -67,6 +67,7 @@ fn main() -> Result<()> {
]
),
run("Riot", "firefox --new-window https://riot.im/app"),
run("Mastodon", "firefox --new-window https://chaos.social"),
run("WhatsApp", "firefox --new-window https://web.whatsapp.com"),
run("Telegram", "telegram-desktop"),
run("Signal", "signal-desktop"),

View file

@ -18,7 +18,9 @@ use update::{update_tasks, process_task};
use error::{Result, ResultExt, ErrorKind as EK, Error};
use hotkeys::str2cmd;
use tasktree::{TreeCache, TaskNode};
use well_known::{INBOX, ACCOUNTING, TREESORT};
use well_known::{INBOX, ACCOUNTING, TREESORT, PRIVATE_MAILBOX, KIVA_MAILBOX, AK_MAILBOX,
SORT_INBOX, SORT_INBOX_AK, SORT_INBOX_KIVA};
use mail::{sort_mailbox, SortBox};
fn prio_name(prio: Option<&TaskPriority>) -> &'static str {
match prio {
@ -43,7 +45,9 @@ fn print_task_short(task: &Task) -> String {
if let Some(wait) = task.wait() {
info.push(format!("wait: {}", **wait));
}
info.push(prio_name(task.priority()).into());
if task.priority().is_some() {
info.push(prio_name(task.priority()).into());
}
info.join(" | ")
}
@ -206,12 +210,19 @@ impl Kassandra {
self.cache.write()?;
self.handle_active_tasks()?;
self.sort_mailbox(&*PRIVATE_MAILBOX, false)?;
self.sort_mailbox(&*KIVA_MAILBOX, false)?;
self.sort_mailbox(&*AK_MAILBOX, false)?;
// CHECK_UNREAD_CHATS
// CHECK_INBOXES
// maralorn.de
// kiva
// ak
process_task(self, &*SORT_INBOX)?;
process_task(self, &*SORT_INBOX_KIVA)?;
process_task(self, &*SORT_INBOX_AK)?;
update_tasks(&mut self.cache)?;
process_task(self, &*INBOX)?;
process_task(self, &*TREESORT)?;
process_task(self, &*ACCOUNTING)?;
@ -957,6 +968,11 @@ What's the progress?",
Mode::Idle => false,
}
}
pub fn sort_mailbox(&mut self, mailbox: &SortBox, sort_read: bool) -> Result<()> {
sort_mailbox(&mut self.dialog, mailbox, sort_read)
}
}
pub fn change_state() -> Result<()> {

View file

@ -9,6 +9,9 @@ extern crate error_chain;
#[macro_use]
extern crate serde_derive;
extern crate serde_yaml;
extern crate maildir;
extern crate mailparse;
extern crate regex;
pub mod hotkeys;
pub mod generate;
@ -17,11 +20,14 @@ pub mod update;
pub mod kassandra;
pub mod tasktree;
pub mod well_known;
pub mod mail;
pub mod error {
use task_hookrs::error as terror;
use dialog::errors as derror;
use serde_yaml;
use maildir;
use mailparse;
error_chain! {
links {
TaskError(terror::Error, terror::ErrorKind);
@ -31,6 +37,8 @@ pub mod error {
Io(::std::io::Error);
Yaml(serde_yaml::Error);
PathError(::std::env::JoinPathsError);
MailDir(maildir::MailEntryError);
MailParse(mailparse::MailParseError);
}
}
}

View file

@ -0,0 +1,263 @@
use std::fs::rename;
use std::env::home_dir;
use std::path::PathBuf;
use std::collections::HashSet;
use regex::Regex;
use task_hookrs::task::{Task, TaskBuilder};
use task_hookrs::cache::TaskCache;
use maildir::{MailEntry, Maildir};
use error::{Result, ResultExt};
use hotkeys::{term_cmd, str2cmd};
use dialog::DialogProvider;
use generate::{GeneratedTask, TaskGenerator};
fn set_seen_flags(old_flags: &str) -> String {
let mut new_flags: HashSet<_> = old_flags.chars().collect();
new_flags.insert('S');
let mut new_flags: Vec<_> = new_flags.into_iter().collect();
new_flags.sort();
new_flags.into_iter().collect()
}
fn make_maildir_path(mailbox: &str) -> PathBuf {
let mut path = home_dir().expect("Could not get home_dir");
path.push("mail");
path.push(mailbox);
path
}
fn make_mailbox_path(mailbox: &str) -> PathBuf {
let mut path = make_maildir_path(mailbox);
path.push("cur");
path
}
fn make_mail_filename(id: &str, flags: &str) -> String {
format!("{}:2,{}", id, flags)
}
fn make_mail_path(mailbox: &str, id: &str, flags: &str) -> PathBuf {
let mut path = make_mailbox_path(mailbox);
let filename = make_mail_filename(id, flags);
path.push(filename);
path
}
fn debug(msg: &str) {
print!("{}", &msg);
use std::fs::OpenOptions;
use std::io::Write;
let mut file = OpenOptions::new()
.append(true)
.open("/home/maralorn/.mailmovements")
.unwrap();
file.write_all(msg.as_bytes()).ok();
}
fn move_mail(mail: &MailEntry, oldbox: &str, newbox: &str) -> Result<()> {
let old_flags = mail.flags();
let old_path = make_mail_path(oldbox, mail.id(), old_flags);
let new_flags = set_seen_flags(&old_flags);
let new_path = make_mail_path(newbox, mail.id(), &new_flags);
debug(&format!("moving {:?} -> {:?}\n", old_path, new_path));
rename(old_path, new_path)?;
Ok(())
}
lazy_static!{
static ref SHOWN_HEADERS: HashSet<String> = {
let raw = ["Date", "To", "From", "Subject", "Cc", "Bcc" ];
raw.iter().map(|&x| x.into()).collect()
};
}
fn print_headers(mail: &mut MailEntry) -> Result<String> {
let mut headers = vec![];
for header in mail.headers()? {
let key = header.get_key()?;
if SHOWN_HEADERS.contains(&key) {
headers.push((key, header.get_value()?))
}
}
let headers = headers
.iter()
.map(|(k, v)| format!("{}: {}", k, v))
.collect::<Vec<_>>()
.join("\n");
Ok(headers)
}
fn get_message_id(mail: &mut MailEntry) -> Result<String> {
for header in mail.headers()? {
if header.get_key()?.to_lowercase().as_str() == "message-id" {
return Ok(header.get_value()?);
}
}
bail!("Parsed mail without Message-ID: {},", mail.id())
}
fn get_subject(mail: &mut MailEntry) -> Result<String> {
for header in mail.headers()? {
if header.get_key()?.to_lowercase().as_str() == "subject" {
return Ok(header.get_value()?);
}
}
bail!("Parsed mail without Message-ID: {},", mail.id())
}
fn get_from(mail: &mut MailEntry) -> Result<String> {
for header in mail.headers()? {
if header.get_key()?.to_lowercase().as_str() == "from" {
return Ok(header.get_value()?);
}
}
bail!("Parsed mail without Message-ID: {},", mail.id())
}
fn read_mail(mailbox: &str, mail: &mut MailEntry) -> Result<()> {
let mailbox = make_maildir_path(mailbox);
let mailbox = mailbox.to_str().chain_err(|| "Invalid path")?;
let message_id = get_message_id(mail)?;
let read_command = format!(
"push <limit>~(~i{})<return><search>~i{}<return><display-message>",
message_id,
message_id
);
str2cmd(&term_cmd("neomutt -f"))
.arg(mailbox)
.arg("-e")
.arg(read_command)
.output()?;
Ok(())
}
fn sort_mail(
dialog: &mut impl DialogProvider,
mut mail: MailEntry,
mailbox: &SortBox,
) -> Result<()> {
enum Options {
ReadNow,
MoveTo(String),
};
let mut options = vec![("Read now: Open in mutt now".to_owned(), Options::ReadNow)];
if mail.is_seen() == false {
options.push((
"Mark Read: Mark as read".to_owned(),
Options::MoveTo(mailbox.mailbox.to_string()),
));
}
let option_dirs = mailbox.option_dirs.iter().map(|(name, mailbox)| {
((*name).to_owned(), Options::MoveTo((*mailbox).to_owned()))
});
let options = options.into_iter().chain(option_dirs);
let msg = format!("Handling E-mail:\n{}", print_headers(&mut mail)?);
let choice = dialog.select_option(msg, options)?;
match choice {
Options::ReadNow => {
read_mail(mailbox.mailbox, &mut mail)?;
}
Options::MoveTo(new_mailbox) => move_mail(&mail, mailbox.mailbox, &new_mailbox)?,
};
Ok(())
}
fn next_mail(mailbox: &SortBox, read: bool) -> Result<Option<MailEntry>> {
let maildir = get_maildir(mailbox.mailbox);
for mail in maildir.list_cur() {
let mail = mail?;
if !mail.is_seen() || read {
return Ok(Some(mail));
}
}
Ok(None)
}
pub fn sort_mailbox(
dialog: &mut impl DialogProvider,
mailbox: &SortBox,
sort_read: bool,
) -> Result<()> {
update_mailbox(mailbox.mailbox)?;
while let Some(mail) = next_mail(mailbox, sort_read)? {
sort_mail(dialog, mail, mailbox)?;
}
Ok(())
}
fn get_maildir(mailbox: &str) -> Maildir {
let mailbox_path = make_maildir_path(mailbox);
Maildir::from(mailbox_path)
}
fn update_mailbox(mailbox: &str) -> Result<()> {
let maildir = get_maildir(mailbox);
for mail in maildir.list_new() {
let mail = mail?;
let id = mail.id();
// the first branch of this if is a work around for mbsync not being standardcompliant with https://cr.yp.to/proto/maildir.html
if id.ends_with(":2,") {
let mut old_path = make_maildir_path(mailbox);
old_path.push("new");
old_path.push(id);
let mut new_path = make_mailbox_path(mailbox);
new_path.push(id);
debug(&format!(
"moving (Standardviolation) {:?} -> {:?}\n",
old_path,
new_path
));
rename(old_path, new_path)?;
} else {
debug(&format!("new_to_cur {:?}\n", mail.id()));
maildir.move_new_to_cur(mail.id())?;
}
}
Ok(())
}
pub fn mailbox_dirty(mailbox: &str) -> Result<bool> {
update_mailbox(mailbox)?;
let maildir = get_maildir(mailbox);
let dirty = maildir.count_cur() > 0;
Ok(dirty)
}
lazy_static! {
static ref MAIL_REGEX: Regex = Regex::new("<.*@.*>").unwrap();
}
fn create_task(mail: &mut MailEntry) -> Result<Task> {
let subject = get_subject(mail)?;
let from = get_from(mail)?;
let from = MAIL_REGEX.replace(&from, "");
let from = from.trim_matches(|x: char| x.is_whitespace() || x == '"');
let message_id = get_message_id(mail)?;
let mut t = TaskBuilder::default()
.description(format!("Mail: {}: {}", from, subject))
.build()
.expect("TaskBuilding failed inspite of set description");
t.set_gen_name(Some("mail-task"));
t.set_gen_id(Some(message_id));
Ok(t)
}
pub fn create_tasks(cache: &mut TaskCache, mailbox: &str, archiv: &str) -> Result<()> {
update_mailbox(mailbox)?;
for mail in get_maildir(mailbox).list_cur() {
let mut mail = mail?;
cache.generate(Some(create_task(&mut mail)?))?;
cache.write()?;
move_mail(&mail, mailbox, archiv)?;
}
Ok(())
}
pub struct SortBox {
pub mailbox: &'static str,
pub option_dirs: Vec<(&'static str, &'static str)>,
}

View file

@ -2,9 +2,11 @@ use task_hookrs::cache::TaskCache;
use refresh::TaskRefresher;
use tasktree::{TreeCache, TaskNode};
use well_known::{SIMPLE, WellKnown, INBOX, ACCOUNTING, TREESORT};
use well_known::{SIMPLE, WellKnown, INBOX, ACCOUNTING, TREESORT, SORT_INBOX, SORT_INBOX_AK,
SORT_INBOX_KIVA};
use error::Result;
use kassandra::Kassandra;
use mail::create_tasks;
fn check_completion(cache: &mut TaskCache, task: &impl WellKnown) -> Result<()> {
if !task.action_necessary(cache)? {
@ -50,6 +52,13 @@ pub fn update_tasks(cache: &mut TaskCache) -> Result<()> {
for simple_task in SIMPLE.iter() {
update_task(cache, simple_task)?;
}
create_tasks(cache, "m-0/Bearbeiten/todo", "m-0/Archiv/unsortiert")?;
create_tasks(cache, "fb4/Bearbeiten/todo", "fb4/Archiv/sortieren")?;
create_tasks(cache, "ak/Malte/bearbeiten", "ak/Malte/sortieren")?;
update_task(cache, &*SORT_INBOX)?;
update_task(cache, &*SORT_INBOX_KIVA)?;
update_task(cache, &*SORT_INBOX_AK)?;
update_task(cache, &*INBOX)?;
update_task(cache, &*TREESORT)?;
update_task(cache, &*ACCOUNTING)?;

View file

@ -7,6 +7,7 @@ use refresh::{Timer, CalendarRepeater, Interval};
use kassandra::{Kassandra, task_in_inbox, needs_sorting};
use hotkeys::{str2cmd, term_cmd};
use tasktree::TaskNode;
use mail::{mailbox_dirty, SortBox};
use chrono::{NaiveDate, NaiveTime, Duration};
@ -25,33 +26,23 @@ pub trait WellKnown {
}
lazy_static! {
pub static ref DAILY: Timer = Timer::Repetition(CalendarRepeater {
date: NaiveDate::from_ymd(2018, 5, 8),
time: NaiveTime::from_hms(20, 0, 0),
repeat: Interval::Day(1)
});
pub static ref SIMPLE: Vec<SimpleTask> = make_simple();
pub static ref INBOX: Inbox = Inbox {
timer: Timer::Repetition(CalendarRepeater {
date: NaiveDate::from_ymd(2018, 5, 8),
time: NaiveTime::from_hms(20, 0, 0),
repeat: Interval::Day(1),
})};
pub static ref TREESORT: Treesort = Treesort {
timer: Timer::Repetition(CalendarRepeater {
date: NaiveDate::from_ymd(2018, 5, 8),
time: NaiveTime::from_hms(20, 0, 0),
repeat: Interval::Day(1),
})};
pub static ref ACCOUNTING: Accounting = Accounting {
timer: Timer::Repetition(CalendarRepeater {
date: NaiveDate::from_ymd(2018, 5, 8),
time: NaiveTime::from_hms(20, 0, 0),
repeat: Interval::Day(1),
})};
pub static ref INBOX: Inbox = Inbox { timer: DAILY.clone() };
pub static ref TREESORT: Treesort = Treesort { timer: DAILY.clone() };
pub static ref ACCOUNTING: Accounting = Accounting { timer: DAILY.clone() };
pub static ref CHECK_MEDIUM: SimpleTask = unimplemented!(); // auch +await // einfach
pub static ref CHECK_LOW: SimpleTask = unimplemented!(); // einfach
pub static ref CHECK_NONE: SimpleTask = unimplemented!(); //einfach
pub static ref CHECK_OPTIONAL: SimpleTask = unimplemented!(); // zufällig 10 //einfach
pub static ref CHECK_DIRTY_GITS: SimpleTask = unimplemented!(); // nicht so wichtig
pub static ref SORT_INBOX: SimpleTask = unimplemented!(); // wichtig
pub static ref SORT_INBOX_KIVA: SimpleTask = unimplemented!(); // wichtig
pub static ref SORT_INBOX_AK: SimpleTask = unimplemented!(); // wichtig
pub static ref SORT_INBOX: Mailsort = Mailsort::new(DAILY.clone(), &PRIVATE_MAILBOX); // wichtig
pub static ref SORT_INBOX_KIVA: Mailsort = Mailsort::new(DAILY.clone(), &KIVA_MAILBOX); // wichtig
pub static ref SORT_INBOX_AK: Mailsort = Mailsort::new(DAILY.clone(), &AK_MAILBOX); // wichtig
pub static ref SORT_MAIL: SimpleTask = unimplemented!(); // zufällige 50? nicht so wichtig
pub static ref SORT_MAIL_KIVA: SimpleTask = unimplemented!(); // nicht so wichtig
pub static ref SORT_MAIL_AK: SimpleTask = unimplemented!(); // nicht so wichtig
@ -60,6 +51,43 @@ lazy_static! {
pub static ref GC_APOLLO: SimpleTask = unimplemented!(); // einfach aber nicht dringend
pub static ref OPT_APOLLO: SimpleTask = unimplemented!(); // einfach aber nicht dringend
pub static ref BACKUP_APOLLO: SimpleTask = unimplemented!(); // einfach aber nicht dringend
pub static ref PRIVATE_MAILBOX: SortBox = SortBox {
mailbox: "m-0/INBOX",
option_dirs: vec![
("Todo","m-0/Bearbeiten/todo"),
("Spam","m-0/Spam"),
("Delete","m-0/Trash"),
("Archiv","m-0/Archiv/unsortiert"),
("Readlater","m-0/Move/readlater"),
("Lesen","m-0/Bearbeiten/lesen"),
("Kiva","fb4/INBOX"),
("Auslandskoordination","ak/INBOX"),
]
};
pub static ref KIVA_MAILBOX: SortBox = SortBox {
mailbox: "fb4/INBOX",
option_dirs: vec![("Archiv","fb4/Archiv/sortieren"),
("Todo","fb4/Bearbeiten/todo"),
("Spam","fb4/SPAM"),
("Delete","fb4/Trash"),
("Archiv","fb4/Archiv/sortieren"),
("Lesen","fb4/Bearbeiten/lesen"),
("Privat","m-0/INBOX"),
("Auslandskoordination","ak/INBOX")
]
};
pub static ref AK_MAILBOX: SortBox = SortBox {
mailbox: "ak/INBOX",
option_dirs: vec![("Archiv","ak/Malte/sortieren"),
("Todo","ak/Malte/bearbeiten"),
("Spam","ak/SPAM"),
("Delete","ak/Trash"),
("Archiv","ak/Malte/sortieren"),
("Lesen","ak/Malte/lesen"),
("Privat","m-0/INBOX"),
("Kiva","fb4/INBOX")
]
};
}
pub struct SimpleTask {
@ -113,7 +141,7 @@ fn simple_tasks(
fn make_simple() -> Vec<SimpleTask> {
let daily = Timer::Repetition(CalendarRepeater {
date: NaiveDate::from_ymd(2018, 5, 8),
time: NaiveTime::from_hms(20, 0, 0),
time: NaiveTime::from_hms(6, 0, 0),
repeat: Interval::Day(1),
});
let weekly = Timer::Repetition(CalendarRepeater {
@ -262,3 +290,46 @@ impl WellKnown for Treesort {
self.timer.clone()
}
}
pub struct Mailsort {
timer: Timer,
mailbox: &'static SortBox,
task: Task,
}
impl Mailsort {
fn new(timer: Timer, mailbox: &'static SortBox) -> Mailsort {
Mailsort {
timer,
mailbox,
task: {
let mut t = TaskBuilder::default()
.description(format!("Sortiere Mailbox {}", &mailbox.mailbox))
.build()
.expect("TaskBuilding failed inspite of set description");
t.set_gen_name(Some("mailboxsort"));
t.set_gen_id(Some(mailbox.mailbox));
t
},
}
}
}
impl WellKnown for Mailsort {
fn definition(&self) -> &Task {
&self.task
}
fn action_necessary(&self, _cache: &TaskCache) -> Result<bool> {
mailbox_dirty(&self.mailbox.mailbox)
}
fn process(&self, kassandra: &mut Kassandra) -> Result<()> {
kassandra.sort_mailbox(&self.mailbox, true)
}
fn refresh(&self) -> Timer {
self.timer.clone()
}
}