This commit is contained in:
Michael Zhang 2021-02-21 09:11:48 -06:00
parent 5db86a9a41
commit 797ce61ef4
Signed by: michael
GPG key ID: BDA47A31A3C8EE6B
3 changed files with 36 additions and 6 deletions

View file

@ -9,3 +9,11 @@ imap routine
- at this point, tls should be figured out, so moving on to auth
- check if the auth type that the user specified is in the list of auth types (prob support plain and oauth2?)
list of shit to do
---
- [x] starttls impl
- [ ] auth impl
- [ ] auth plain impl
- [ ] fetch impl

View file

@ -45,14 +45,25 @@ pub struct ImapConfig {
/// Port of the IMAP server
pub port: u16,
/// Username for authenticating to IMAP
pub username: String,
/// Password for authenticating to IMAP
pub password: String,
/// TLS
pub tls: TlsMethod,
/// Auth
#[serde(flatten)]
pub auth: ImapAuth,
}
/// Method of authentication for the IMAP server
#[derive(Serialize, Deserialize, Clone, Debug)]
#[serde(tag = "auth")]
pub enum ImapAuth {
/// Use plain username/password authentication
#[serde(rename = "plain")]
#[allow(missing_docs)]
Plain {
username: String,
password: String,
}
}
/// Describes when to perform the TLS handshake

View file

@ -20,6 +20,17 @@ struct Opt {
#[tokio::main(flavor = "multi_thread")]
async fn main() -> Result<()> {
// use panorama::config::*;
// let c = ImapConfig{
// server:String::from("ouais"),
// port: 1,
// tls: TlsMethod::Starttls,
// auth: ImapAuth::Plain{username:String::from("osu"), password:String::from("game")},
// };
// let s = toml::to_string(&c)?;
// println!("{}", s);
// panic!();
// parse command line arguments into options struct
let _opt = Opt::from_args();