31 lines
1.3 KiB
Rust
31 lines
1.3 KiB
Rust
use nom::branch::alt;
|
|
use nom::bytes::complete::is_not;
|
|
use nom::character::is_space;
|
|
use nom::character::streaming::{
|
|
alpha1, digit1, line_ending, multispace0, multispace1, newline, none_of, not_line_ending,
|
|
};
|
|
use nom::multi::many_m_n;
|
|
use nom::sequence::{delimited, preceded, separated_pair};
|
|
use nom::{bytes::complete::tag, IResult};
|
|
use nom::{character, number};
|
|
use sieverman::parser::parse_server_config;
|
|
use sieverman::{Methods, ServerSettings};
|
|
use std::error::Error;
|
|
use tracing::info;
|
|
|
|
fn main() -> Result<(), Box<dyn Error>> {
|
|
env_logger::init();
|
|
let input = r#"
|
|
"IMPLEMENTATION" "Stalwart ManageSieve v0.4.2"
|
|
"VERSION" "1.0"
|
|
"SASL" "PLAIN OAUTHBEARER"
|
|
"SIEVE" "body comparator-elbonia comparator-i;ascii-casemap comparator-i;ascii-numeric comparator-i;octet convert copy date duplicate editheader enclose encoded-character enotify envelope envelope-deliverby envelope-dsn environment ereject extlists extracttext fcc fileinto foreverypart ihave imap4flags imapsieve include index mailbox mailboxid mboxmetadata mime redirect-deliverby redirect-dsn regex reject relational replace servermetadata spamtest spamtestplus special-use subaddress vacation vacation-seconds variables virustest"
|
|
"NOTIFY" "mailto"
|
|
"MAXREDIRECTS" "1"
|
|
"#;
|
|
let (remaining_input, output) = parse_server_config(input)?;
|
|
|
|
dbg!(output);
|
|
Ok(())
|
|
}
|