Clean up unused imports
This commit is contained in:
parent
90b143e1c5
commit
3cf91429c7
10 changed files with 33 additions and 33 deletions
|
@ -1,8 +1,8 @@
|
||||||
use anyhow::{Error, Result};
|
use anyhow::{Error, Result};
|
||||||
use boitalettres::proto::{res::body::Data as Body, Request, Response};
|
use boitalettres::proto::{res::body::Data as Body, Request, Response};
|
||||||
use imap_codec::types::command::CommandBody;
|
use imap_codec::types::command::CommandBody;
|
||||||
use imap_codec::types::core::{AString, Atom};
|
use imap_codec::types::core::{AString};
|
||||||
use imap_codec::types::response::{Capability, Code, Data, Response as ImapRes, Status};
|
use imap_codec::types::response::{Capability, Data, Status};
|
||||||
|
|
||||||
use crate::imap::flow;
|
use crate::imap::flow;
|
||||||
use crate::login::ArcLoginProvider;
|
use crate::login::ArcLoginProvider;
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
use anyhow::{anyhow, Error, Result};
|
use anyhow::{Error, Result};
|
||||||
use boitalettres::proto::{res::body::Data as Body, Request, Response};
|
use boitalettres::proto::{res::body::Data as Body, Request, Response};
|
||||||
use imap_codec::types::command::CommandBody;
|
use imap_codec::types::command::CommandBody;
|
||||||
use imap_codec::types::core::Atom;
|
use imap_codec::types::core::Atom;
|
||||||
use imap_codec::types::flag::Flag;
|
use imap_codec::types::flag::Flag;
|
||||||
use imap_codec::types::mailbox::{ListMailbox, Mailbox as MailboxCodec};
|
use imap_codec::types::mailbox::{ListMailbox, Mailbox as MailboxCodec};
|
||||||
use imap_codec::types::response::{Code, Data, Response as ImapRes, Status};
|
use imap_codec::types::response::{Code, Data, Status};
|
||||||
|
|
||||||
use crate::imap::command::anonymous;
|
use crate::imap::command::anonymous;
|
||||||
use crate::imap::flow;
|
use crate::imap::flow;
|
||||||
use crate::imap::session::InnerContext;
|
|
||||||
use crate::mail::Mailbox;
|
use crate::mail::Mailbox;
|
||||||
|
|
||||||
const DEFAULT_FLAGS: [Flag; 5] = [
|
const DEFAULT_FLAGS: [Flag; 5] = [
|
||||||
|
@ -50,16 +50,16 @@ pub async fn dispatch<'a>(ctx: AuthenticatedContext<'a>) -> Result<(Response, fl
|
||||||
impl<'a> AuthenticatedContext<'a> {
|
impl<'a> AuthenticatedContext<'a> {
|
||||||
async fn lsub(
|
async fn lsub(
|
||||||
self,
|
self,
|
||||||
reference: &MailboxCodec,
|
_reference: &MailboxCodec,
|
||||||
mailbox_wildcard: &ListMailbox,
|
_mailbox_wildcard: &ListMailbox,
|
||||||
) -> Result<(Response, flow::Transition)> {
|
) -> Result<(Response, flow::Transition)> {
|
||||||
Ok((Response::bad("Not implemented")?, flow::Transition::None))
|
Ok((Response::bad("Not implemented")?, flow::Transition::None))
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn list(
|
async fn list(
|
||||||
self,
|
self,
|
||||||
reference: &MailboxCodec,
|
_reference: &MailboxCodec,
|
||||||
mailbox_wildcard: &ListMailbox,
|
_mailbox_wildcard: &ListMailbox,
|
||||||
) -> Result<(Response, flow::Transition)> {
|
) -> Result<(Response, flow::Transition)> {
|
||||||
Ok((Response::bad("Not implemented")?, flow::Transition::None))
|
Ok((Response::bad("Not implemented")?, flow::Transition::None))
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
use anyhow::{Error, Result};
|
use anyhow::{Result};
|
||||||
use boitalettres::proto::Request;
|
use boitalettres::proto::Request;
|
||||||
use boitalettres::proto::Response;
|
use boitalettres::proto::Response;
|
||||||
use imap_codec::types::command::CommandBody;
|
use imap_codec::types::command::CommandBody;
|
||||||
use imap_codec::types::core::Tag;
|
|
||||||
use imap_codec::types::fetch_attributes::MacroOrFetchAttributes;
|
use imap_codec::types::fetch_attributes::MacroOrFetchAttributes;
|
||||||
use imap_codec::types::response::{Response as ImapRes, Status};
|
|
||||||
use imap_codec::types::sequence::SequenceSet;
|
use imap_codec::types::sequence::SequenceSet;
|
||||||
|
|
||||||
use crate::imap::command::authenticated;
|
use crate::imap::command::authenticated;
|
||||||
use crate::imap::flow;
|
use crate::imap::flow;
|
||||||
use crate::imap::session::InnerContext;
|
|
||||||
use crate::mail::Mailbox;
|
use crate::mail::Mailbox;
|
||||||
|
|
||||||
pub struct SelectedContext<'a> {
|
pub struct SelectedContext<'a> {
|
||||||
|
@ -40,9 +40,9 @@ pub async fn dispatch<'a>(ctx: SelectedContext<'a>) -> Result<(Response, flow::T
|
||||||
impl<'a> SelectedContext<'a> {
|
impl<'a> SelectedContext<'a> {
|
||||||
pub async fn fetch(
|
pub async fn fetch(
|
||||||
self,
|
self,
|
||||||
sequence_set: &SequenceSet,
|
_sequence_set: &SequenceSet,
|
||||||
attributes: &MacroOrFetchAttributes,
|
_attributes: &MacroOrFetchAttributes,
|
||||||
uid: &bool,
|
_uid: &bool,
|
||||||
) -> Result<(Response, flow::Transition)> {
|
) -> Result<(Response, flow::Transition)> {
|
||||||
Ok((Response::bad("Not implemented")?, flow::Transition::None))
|
Ok((Response::bad("Not implemented")?, flow::Transition::None))
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,7 +61,7 @@ impl<'a> Service<&'a AddrStream> for Instance {
|
||||||
type Error = anyhow::Error;
|
type Error = anyhow::Error;
|
||||||
type Future = BoxFuture<'static, Result<Self::Response>>;
|
type Future = BoxFuture<'static, Result<Self::Response>>;
|
||||||
|
|
||||||
fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
|
fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
|
||||||
Poll::Ready(Ok(()))
|
Poll::Ready(Ok(()))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -93,7 +93,7 @@ impl Service<Request> for Connection {
|
||||||
type Error = BalError;
|
type Error = BalError;
|
||||||
type Future = BoxFuture<'static, Result<Self::Response, Self::Error>>;
|
type Future = BoxFuture<'static, Result<Self::Response, Self::Error>>;
|
||||||
|
|
||||||
fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
|
fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
|
||||||
Poll::Ready(Ok(()))
|
Poll::Ready(Ok(()))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ use boitalettres::errors::Error as BalError;
|
||||||
use boitalettres::proto::{Request, Response};
|
use boitalettres::proto::{Request, Response};
|
||||||
use futures::future::BoxFuture;
|
use futures::future::BoxFuture;
|
||||||
use futures::future::FutureExt;
|
use futures::future::FutureExt;
|
||||||
use imap_codec::types::response::{Response as ImapRes, Status};
|
|
||||||
use tokio::sync::mpsc::error::TrySendError;
|
use tokio::sync::mpsc::error::TrySendError;
|
||||||
use tokio::sync::{mpsc, oneshot};
|
use tokio::sync::{mpsc, oneshot};
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ impl Manager {
|
||||||
pub fn new(login_provider: ArcLoginProvider) -> Self {
|
pub fn new(login_provider: ArcLoginProvider) -> Self {
|
||||||
let (tx, rx) = mpsc::channel(MAX_PIPELINED_COMMANDS);
|
let (tx, rx) = mpsc::channel(MAX_PIPELINED_COMMANDS);
|
||||||
tokio::spawn(async move {
|
tokio::spawn(async move {
|
||||||
let mut instance = Instance::new(login_provider, rx);
|
let instance = Instance::new(login_provider, rx);
|
||||||
instance.start().await;
|
instance.start().await;
|
||||||
});
|
});
|
||||||
Self { tx }
|
Self { tx }
|
||||||
|
|
12
src/lmtp.rs
12
src/lmtp.rs
|
@ -2,20 +2,20 @@ use std::collections::HashMap;
|
||||||
use std::net::SocketAddr;
|
use std::net::SocketAddr;
|
||||||
use std::{pin::Pin, sync::Arc};
|
use std::{pin::Pin, sync::Arc};
|
||||||
|
|
||||||
use anyhow::{bail, Result};
|
use anyhow::{Result};
|
||||||
use async_trait::async_trait;
|
use async_trait::async_trait;
|
||||||
use duplexify::Duplex;
|
use duplexify::Duplex;
|
||||||
use futures::{io, AsyncRead, AsyncReadExt, AsyncWrite};
|
use futures::{io, AsyncRead, AsyncReadExt, AsyncWrite};
|
||||||
use futures::{stream, stream::FuturesUnordered, StreamExt};
|
use futures::{stream, stream::FuturesUnordered, StreamExt};
|
||||||
use log::*;
|
use log::*;
|
||||||
use rusoto_s3::{PutObjectRequest, S3Client, S3};
|
use rusoto_s3::{PutObjectRequest, S3};
|
||||||
use tokio::net::{TcpListener, TcpStream};
|
use tokio::net::{TcpListener};
|
||||||
use tokio::select;
|
use tokio::select;
|
||||||
use tokio::sync::watch;
|
use tokio::sync::watch;
|
||||||
use tokio_util::compat::*;
|
use tokio_util::compat::*;
|
||||||
|
|
||||||
use smtp_message::{Email, EscapedDataReader, Reply, ReplyCode};
|
use smtp_message::{Email, EscapedDataReader, Reply, ReplyCode};
|
||||||
use smtp_server::{reply, Config, ConnectionMetadata, Decision, MailMetadata, Protocol};
|
use smtp_server::{reply, Config, ConnectionMetadata, Decision, MailMetadata};
|
||||||
|
|
||||||
use crate::config::*;
|
use crate::config::*;
|
||||||
use crate::cryptoblob::*;
|
use crate::cryptoblob::*;
|
||||||
|
@ -120,7 +120,7 @@ impl Config for LmtpServer {
|
||||||
async fn filter_from(
|
async fn filter_from(
|
||||||
&self,
|
&self,
|
||||||
from: Option<Email>,
|
from: Option<Email>,
|
||||||
meta: &mut MailMetadata<Message>,
|
_meta: &mut MailMetadata<Message>,
|
||||||
_conn_meta: &mut ConnectionMetadata<Conn>,
|
_conn_meta: &mut ConnectionMetadata<Conn>,
|
||||||
) -> Decision<Option<Email>> {
|
) -> Decision<Option<Email>> {
|
||||||
Decision::Accept {
|
Decision::Accept {
|
||||||
|
@ -161,7 +161,7 @@ impl Config for LmtpServer {
|
||||||
&'resp self,
|
&'resp self,
|
||||||
reader: &mut EscapedDataReader<'_, R>,
|
reader: &mut EscapedDataReader<'_, R>,
|
||||||
meta: MailMetadata<Message>,
|
meta: MailMetadata<Message>,
|
||||||
conn_meta: &'resp mut ConnectionMetadata<Conn>,
|
_conn_meta: &'resp mut ConnectionMetadata<Conn>,
|
||||||
) -> Pin<Box<dyn futures::Stream<Item = Decision<()>> + Send + 'resp>>
|
) -> Pin<Box<dyn futures::Stream<Item = Decision<()>> + Send + 'resp>>
|
||||||
where
|
where
|
||||||
R: Send + Unpin + AsyncRead,
|
R: Send + Unpin + AsyncRead,
|
||||||
|
|
|
@ -88,13 +88,13 @@ impl Mailbox {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Insert an email in the mailbox
|
// Insert an email in the mailbox
|
||||||
pub async fn append(&mut self, msg: IMF) -> Result<()> {
|
pub async fn append(&mut self, _msg: IMF) -> Result<()> {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
// Copy an email from an external to this mailbox
|
// Copy an email from an external to this mailbox
|
||||||
// @FIXME is it needed or could we implement it with append?
|
// @FIXME is it needed or could we implement it with append?
|
||||||
pub async fn copy(&mut self, mailbox: String, uid: ImapUid) -> Result<()> {
|
pub async fn copy(&mut self, _mailbox: String, _uid: ImapUid) -> Result<()> {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
use std::num::NonZeroU32;
|
use std::num::NonZeroU32;
|
||||||
|
|
||||||
use im::{HashMap, HashSet, OrdMap, OrdSet};
|
use im::{HashMap, OrdMap, OrdSet};
|
||||||
use serde::{de::Error, Deserialize, Deserializer, Serialize, Serializer};
|
use serde::{Deserialize, Deserializer, Serialize, Serializer};
|
||||||
|
|
||||||
use crate::bayou::*;
|
use crate::bayou::*;
|
||||||
use crate::mail::mail_ident::MailIdent;
|
use crate::mail::mail_ident::MailIdent;
|
||||||
|
|
|
@ -134,7 +134,7 @@ async fn main() -> Result<()> {
|
||||||
Command::Test { config_file } => {
|
Command::Test { config_file } => {
|
||||||
let config = read_config(config_file)?;
|
let config = read_config(config_file)?;
|
||||||
|
|
||||||
let server = Server::new(config).await?;
|
let _server = Server::new(config).await?;
|
||||||
//server.test().await?;
|
//server.test().await?;
|
||||||
}
|
}
|
||||||
Command::FirstLogin {
|
Command::FirstLogin {
|
||||||
|
|
|
@ -10,7 +10,7 @@ use crate::config::*;
|
||||||
use crate::imap;
|
use crate::imap;
|
||||||
use crate::lmtp::*;
|
use crate::lmtp::*;
|
||||||
use crate::login::ArcLoginProvider;
|
use crate::login::ArcLoginProvider;
|
||||||
use crate::login::{ldap_provider::*, static_provider::*, *};
|
use crate::login::{ldap_provider::*, static_provider::*};
|
||||||
|
|
||||||
pub struct Server {
|
pub struct Server {
|
||||||
lmtp_server: Option<Arc<LmtpServer>>,
|
lmtp_server: Option<Arc<LmtpServer>>,
|
||||||
|
@ -37,7 +37,7 @@ impl Server {
|
||||||
tracing::info!("Starting Aerogramme...");
|
tracing::info!("Starting Aerogramme...");
|
||||||
|
|
||||||
let (exit_signal, provoke_exit) = watch_ctrl_c();
|
let (exit_signal, provoke_exit) = watch_ctrl_c();
|
||||||
let exit_on_err = move |err: anyhow::Error| {
|
let _exit_on_err = move |err: anyhow::Error| {
|
||||||
error!("Error: {}", err);
|
error!("Error: {}", err);
|
||||||
let _ = provoke_exit.send(true);
|
let _ = provoke_exit.send(true);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue