cleanup
This commit is contained in:
parent
7b888ed8cf
commit
5d6e4f7332
7 changed files with 27 additions and 33 deletions
|
@ -165,21 +165,21 @@ impl<'a> AuthenticatedContext<'a> {
|
||||||
async fn status(
|
async fn status(
|
||||||
self,
|
self,
|
||||||
mailbox: &MailboxCodec,
|
mailbox: &MailboxCodec,
|
||||||
attributes: &[StatusAttribute],
|
_attributes: &[StatusAttribute],
|
||||||
) -> Result<(Response, flow::Transition)> {
|
) -> Result<(Response, flow::Transition)> {
|
||||||
let name = String::try_from(mailbox.clone())?;
|
let _name = String::try_from(mailbox.clone())?;
|
||||||
|
|
||||||
Ok((Response::bad("Not implemented")?, flow::Transition::None))
|
Ok((Response::bad("Not implemented")?, flow::Transition::None))
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn subscribe(self, mailbox: &MailboxCodec) -> Result<(Response, flow::Transition)> {
|
async fn subscribe(self, mailbox: &MailboxCodec) -> Result<(Response, flow::Transition)> {
|
||||||
let name = String::try_from(mailbox.clone())?;
|
let _name = String::try_from(mailbox.clone())?;
|
||||||
|
|
||||||
Ok((Response::bad("Not implemented")?, flow::Transition::None))
|
Ok((Response::bad("Not implemented")?, flow::Transition::None))
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn unsubscribe(self, mailbox: &MailboxCodec) -> Result<(Response, flow::Transition)> {
|
async fn unsubscribe(self, mailbox: &MailboxCodec) -> Result<(Response, flow::Transition)> {
|
||||||
let name = String::try_from(mailbox.clone())?;
|
let _name = String::try_from(mailbox.clone())?;
|
||||||
|
|
||||||
Ok((
|
Ok((
|
||||||
Response::bad("Aerogramme does not support unsubscribing from a mailbox")?,
|
Response::bad("Aerogramme does not support unsubscribing from a mailbox")?,
|
||||||
|
|
|
@ -71,9 +71,9 @@ impl<'a> ExaminedContext<'a> {
|
||||||
|
|
||||||
pub async fn search(
|
pub async fn search(
|
||||||
self,
|
self,
|
||||||
charset: &Option<Charset>,
|
_charset: &Option<Charset>,
|
||||||
criteria: &SearchKey,
|
_criteria: &SearchKey,
|
||||||
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))
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@ 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::fetch_attributes::MacroOrFetchAttributes;
|
|
||||||
use imap_codec::types::flag::{Flag, StoreResponse, StoreType};
|
use imap_codec::types::flag::{Flag, StoreResponse, StoreType};
|
||||||
use imap_codec::types::mailbox::Mailbox as MailboxCodec;
|
use imap_codec::types::mailbox::Mailbox as MailboxCodec;
|
||||||
|
|
||||||
|
@ -67,20 +67,20 @@ impl<'a> SelectedContext<'a> {
|
||||||
|
|
||||||
async fn store(
|
async fn store(
|
||||||
self,
|
self,
|
||||||
sequence_set: &SequenceSet,
|
_sequence_set: &SequenceSet,
|
||||||
kind: &StoreType,
|
_kind: &StoreType,
|
||||||
response: &StoreResponse,
|
_response: &StoreResponse,
|
||||||
flags: &[Flag],
|
_flags: &[Flag],
|
||||||
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))
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn copy(
|
async fn copy(
|
||||||
self,
|
self,
|
||||||
sequence_set: &SequenceSet,
|
_sequence_set: &SequenceSet,
|
||||||
mailbox: &MailboxCodec,
|
_mailbox: &MailboxCodec,
|
||||||
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))
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
use std::borrow::{Borrow, Cow};
|
use std::borrow::Cow;
|
||||||
use std::collections::HashMap;
|
|
||||||
use std::io::{BufRead, Cursor};
|
|
||||||
use std::num::NonZeroU32;
|
use std::num::NonZeroU32;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
|
@ -10,7 +9,7 @@ use chrono::{Offset, TimeZone, Utc};
|
||||||
use futures::stream::{FuturesOrdered, StreamExt};
|
use futures::stream::{FuturesOrdered, StreamExt};
|
||||||
use imap_codec::types::address::Address;
|
use imap_codec::types::address::Address;
|
||||||
use imap_codec::types::body::{BasicFields, Body as FetchBody, BodyStructure, SpecificFields};
|
use imap_codec::types::body::{BasicFields, Body as FetchBody, BodyStructure, SpecificFields};
|
||||||
use imap_codec::types::core::{Atom, IString, NString, NonZeroBytes};
|
use imap_codec::types::core::{Atom, IString, NString};
|
||||||
use imap_codec::types::datetime::MyDateTime;
|
use imap_codec::types::datetime::MyDateTime;
|
||||||
use imap_codec::types::envelope::Envelope;
|
use imap_codec::types::envelope::Envelope;
|
||||||
use imap_codec::types::fetch_attributes::{FetchAttribute, MacroOrFetchAttributes};
|
use imap_codec::types::fetch_attributes::{FetchAttribute, MacroOrFetchAttributes};
|
||||||
|
@ -287,9 +286,9 @@ impl MailboxView {
|
||||||
build_imap_email_struct(&parsed, &parsed.structure)?,
|
build_imap_email_struct(&parsed, &parsed.structure)?,
|
||||||
)),
|
)),
|
||||||
FetchAttribute::BodyExt {
|
FetchAttribute::BodyExt {
|
||||||
section,
|
section: _,
|
||||||
partial,
|
partial: _,
|
||||||
peek,
|
peek: _,
|
||||||
} => {
|
} => {
|
||||||
// @TODO This is a stub
|
// @TODO This is a stub
|
||||||
let is = IString::try_from("test").unwrap();
|
let is = IString::try_from("test").unwrap();
|
||||||
|
@ -579,7 +578,7 @@ fn build_imap_email_struct<'a>(
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
MessagePart::Binary(bp) | MessagePart::InlineBinary(bp) => {
|
MessagePart::Binary(bp) | MessagePart::InlineBinary(bp) => {
|
||||||
let (_, mut basic) = headers_to_basic_fields(bp)?;
|
let (_, basic) = headers_to_basic_fields(bp)?;
|
||||||
|
|
||||||
let ct = bp
|
let ct = bp
|
||||||
.get_content_type()
|
.get_content_type()
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
use std::collections::HashMap;
|
|
||||||
use std::net::SocketAddr;
|
use std::net::SocketAddr;
|
||||||
use std::{pin::Pin, sync::Arc};
|
use std::{pin::Pin, sync::Arc};
|
||||||
|
|
||||||
|
@ -8,7 +7,6 @@ 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, S3};
|
|
||||||
use tokio::net::TcpListener;
|
use tokio::net::TcpListener;
|
||||||
use tokio::select;
|
use tokio::select;
|
||||||
use tokio::sync::watch;
|
use tokio::sync::watch;
|
||||||
|
@ -18,10 +16,8 @@ use smtp_message::{Email, EscapedDataReader, Reply, ReplyCode};
|
||||||
use smtp_server::{reply, Config, ConnectionMetadata, Decision, MailMetadata};
|
use smtp_server::{reply, Config, ConnectionMetadata, Decision, MailMetadata};
|
||||||
|
|
||||||
use crate::config::*;
|
use crate::config::*;
|
||||||
use crate::cryptoblob::*;
|
|
||||||
use crate::login::*;
|
use crate::login::*;
|
||||||
use crate::mail::incoming::EncryptedMessage;
|
use crate::mail::incoming::EncryptedMessage;
|
||||||
use crate::mail::unique_ident::*;
|
|
||||||
|
|
||||||
pub struct LmtpServer {
|
pub struct LmtpServer {
|
||||||
bind_addr: SocketAddr,
|
bind_addr: SocketAddr,
|
||||||
|
|
|
@ -1,15 +1,14 @@
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::convert::TryFrom;
|
use std::convert::TryFrom;
|
||||||
use std::pin::Pin;
|
|
||||||
use std::sync::{Arc, Weak};
|
use std::sync::{Arc, Weak};
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
|
|
||||||
use anyhow::{anyhow, bail, Result};
|
use anyhow::{anyhow, bail, Result};
|
||||||
use futures::{future::BoxFuture, Future, FutureExt};
|
use futures::{future::BoxFuture, FutureExt};
|
||||||
use k2v_client::{CausalValue, CausalityToken, K2vClient, K2vValue};
|
use k2v_client::{CausalValue, CausalityToken, K2vClient, K2vValue};
|
||||||
use rusoto_s3::{
|
use rusoto_s3::{
|
||||||
DeleteObjectRequest, GetObjectRequest, HeadObjectRequest, ListObjectsV2Request,
|
DeleteObjectRequest, GetObjectRequest, ListObjectsV2Request, PutObjectRequest, S3Client, S3,
|
||||||
PutObjectRequest, S3Client, S3,
|
|
||||||
};
|
};
|
||||||
use tokio::io::AsyncReadExt;
|
use tokio::io::AsyncReadExt;
|
||||||
use tokio::sync::watch;
|
use tokio::sync::watch;
|
||||||
|
|
|
@ -125,7 +125,7 @@ impl Mailbox {
|
||||||
bail!("Cannot copy into same mailbox");
|
bail!("Cannot copy into same mailbox");
|
||||||
}
|
}
|
||||||
|
|
||||||
let (mut selflock, mut fromlock);
|
let (mut selflock, fromlock);
|
||||||
if self.id < from.id {
|
if self.id < from.id {
|
||||||
selflock = self.mbox.write().await;
|
selflock = self.mbox.write().await;
|
||||||
fromlock = from.mbox.write().await;
|
fromlock = from.mbox.write().await;
|
||||||
|
|
Loading…
Reference in a new issue