poggers
This commit is contained in:
parent
5db86a9a41
commit
797ce61ef4
3 changed files with 36 additions and 6 deletions
8
notes.md
8
notes.md
|
@ -9,3 +9,11 @@ imap routine
|
||||||
- at this point, tls should be figured out, so moving on to auth
|
- 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?)
|
- 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
|
||||||
|
|
|
@ -45,14 +45,25 @@ pub struct ImapConfig {
|
||||||
/// Port of the IMAP server
|
/// Port of the IMAP server
|
||||||
pub port: u16,
|
pub port: u16,
|
||||||
|
|
||||||
/// Username for authenticating to IMAP
|
|
||||||
pub username: String,
|
|
||||||
|
|
||||||
/// Password for authenticating to IMAP
|
|
||||||
pub password: String,
|
|
||||||
|
|
||||||
/// TLS
|
/// TLS
|
||||||
pub tls: TlsMethod,
|
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
|
/// Describes when to perform the TLS handshake
|
||||||
|
|
11
src/main.rs
11
src/main.rs
|
@ -20,6 +20,17 @@ struct Opt {
|
||||||
|
|
||||||
#[tokio::main(flavor = "multi_thread")]
|
#[tokio::main(flavor = "multi_thread")]
|
||||||
async fn main() -> Result<()> {
|
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
|
// parse command line arguments into options struct
|
||||||
let _opt = Opt::from_args();
|
let _opt = Opt::from_args();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue