aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuentin Dufour <quentin@deuxfleurs.fr>2022-06-27 16:56:20 +0200
committerQuentin Dufour <quentin@deuxfleurs.fr>2022-06-27 16:56:20 +0200
commit390bad0ec451a571e119903054b581a9d9a00cbe (patch)
tree467fdf3ade0325b8c69ea8350a2f15fa181d8981
parentd3f8a6627ca13a020bac9936d1f40a18239b6d6d (diff)
downloadaerogramme-390bad0ec451a571e119903054b581a9d9a00cbe.tar.gz
aerogramme-390bad0ec451a571e119903054b581a9d9a00cbe.zip
Refactor files in a "mail" crate
-rw-r--r--src/imap/command/authenticated.rs2
-rw-r--r--src/imap/command/selected.rs2
-rw-r--r--src/imap/flow.rs2
-rw-r--r--src/lmtp.rs2
-rw-r--r--src/mail/mail_ident.rs (renamed from src/mail_ident.rs)0
-rw-r--r--src/mail/mod.rs (renamed from src/mailbox.rs)7
-rw-r--r--src/mail/uidindex.rs (renamed from src/uidindex.rs)2
-rw-r--r--src/main.rs4
8 files changed, 11 insertions, 10 deletions
diff --git a/src/imap/command/authenticated.rs b/src/imap/command/authenticated.rs
index 5924f53..0b1f01e 100644
--- a/src/imap/command/authenticated.rs
+++ b/src/imap/command/authenticated.rs
@@ -9,7 +9,7 @@ use imap_codec::types::response::{Code, Data, Response as ImapRes, Status};
use crate::imap::command::anonymous;
use crate::imap::flow;
use crate::imap::session::InnerContext;
-use crate::mailbox::Mailbox;
+use crate::mail::Mailbox;
const DEFAULT_FLAGS: [Flag; 5] = [
Flag::Seen,
diff --git a/src/imap/command/selected.rs b/src/imap/command/selected.rs
index fb6a75d..e44bf36 100644
--- a/src/imap/command/selected.rs
+++ b/src/imap/command/selected.rs
@@ -9,7 +9,7 @@ use imap_codec::types::sequence::SequenceSet;
use crate::imap::command::authenticated;
use crate::imap::flow;
use crate::imap::session::InnerContext;
-use crate::mailbox::Mailbox;
+use crate::mail::Mailbox;
pub async fn dispatch<'a>(
inner: InnerContext<'a>,
diff --git a/src/imap/flow.rs b/src/imap/flow.rs
index f0ec7d1..bd4c484 100644
--- a/src/imap/flow.rs
+++ b/src/imap/flow.rs
@@ -2,7 +2,7 @@ use std::error::Error as StdError;
use std::fmt;
use crate::login::Credentials;
-use crate::mailbox::Mailbox;
+use crate::mail::Mailbox;
pub struct User {
pub name: String,
diff --git a/src/lmtp.rs b/src/lmtp.rs
index 55da3ee..a0dafa5 100644
--- a/src/lmtp.rs
+++ b/src/lmtp.rs
@@ -20,7 +20,7 @@ use smtp_server::{reply, Config, ConnectionMetadata, Decision, MailMetadata, Pro
use crate::config::*;
use crate::cryptoblob::*;
use crate::login::*;
-use crate::mail_ident::*;
+use crate::mail::mail_ident::*;
pub struct LmtpServer {
bind_addr: SocketAddr,
diff --git a/src/mail_ident.rs b/src/mail/mail_ident.rs
index 07e053a..07e053a 100644
--- a/src/mail_ident.rs
+++ b/src/mail/mail_ident.rs
diff --git a/src/mailbox.rs b/src/mail/mod.rs
index 7945cba..2edcaa7 100644
--- a/src/mailbox.rs
+++ b/src/mail/mod.rs
@@ -1,3 +1,6 @@
+pub mod mail_ident;
+mod uidindex;
+
use std::convert::TryFrom;
use anyhow::Result;
@@ -7,8 +10,8 @@ use rusoto_s3::S3Client;
use crate::bayou::Bayou;
use crate::cryptoblob::Key;
use crate::login::Credentials;
-use crate::mail_ident::*;
-use crate::uidindex::*;
+use crate::mail::mail_ident::*;
+use crate::mail::uidindex::*;
pub struct Summary<'a> {
pub validity: ImapUidvalidity,
diff --git a/src/uidindex.rs b/src/mail/uidindex.rs
index d78d8e4..49dbba5 100644
--- a/src/uidindex.rs
+++ b/src/mail/uidindex.rs
@@ -4,7 +4,7 @@ use im::{HashMap, HashSet, OrdMap, OrdSet};
use serde::{de::Error, Deserialize, Deserializer, Serialize, Serializer};
use crate::bayou::*;
-use crate::mail_ident::MailIdent;
+use crate::mail::mail_ident::MailIdent;
pub type ImapUid = NonZeroU32;
pub type ImapUidvalidity = NonZeroU32;
diff --git a/src/main.rs b/src/main.rs
index 9270817..e328fb1 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -4,11 +4,9 @@ mod cryptoblob;
mod imap;
mod lmtp;
mod login;
-mod mail_ident;
-mod mailbox;
+mod mail;
mod server;
mod time;
-mod uidindex;
use std::path::PathBuf;