Start collecting recipients
- Collect recipients for processed email. - Add proper email parsing
This commit is contained in:
+22
@@ -0,0 +1,22 @@
|
||||
//
|
||||
// Husk milter
|
||||
//
|
||||
// mail functions
|
||||
//
|
||||
|
||||
use std::ffi::CString;
|
||||
use sequoia_openpgp::packet::UserID;
|
||||
|
||||
pub fn to_userid(rcpt: &CString) -> Option<UserID> {
|
||||
match rcpt.to_str() {
|
||||
Ok(s) => Some(UserID::from(s)),
|
||||
_ => None
|
||||
}
|
||||
}
|
||||
|
||||
pub fn to_email(rcpt: &CString) -> Option<String> {
|
||||
if let Some(u) = to_userid(rcpt) {
|
||||
if let Ok(Some(e)) = u.email() { Some(e.to_string()) }
|
||||
else { None }
|
||||
} else { None }
|
||||
}
|
||||
Reference in New Issue
Block a user