Sieve: Allow User Sieve scripts to access orcpt
This commit is contained in:
@@ -30,6 +30,7 @@ pub struct IngestMessage {
|
||||
#[derive(Debug)]
|
||||
pub struct IngestRecipient {
|
||||
pub address: String,
|
||||
pub orcpt: Option<String>,
|
||||
pub is_spam: bool,
|
||||
}
|
||||
|
||||
|
||||
@@ -129,6 +129,9 @@ impl SieveScriptIngest for Server {
|
||||
// Set envelope
|
||||
instance.set_envelope(Envelope::From, envelope_from);
|
||||
instance.set_envelope(Envelope::To, envelope_to.address.as_str());
|
||||
if let Some(orcpt) = &envelope_to.orcpt {
|
||||
instance.set_envelope(Envelope::Orcpt, orcpt.as_str());
|
||||
}
|
||||
instance.set_spam_status(if envelope_to.is_spam {
|
||||
SpamStatus::Spam
|
||||
} else {
|
||||
|
||||
@@ -183,6 +183,7 @@ impl FormHandler for Server {
|
||||
.iter()
|
||||
.map(|address| IngestRecipient {
|
||||
address: address.clone(),
|
||||
orcpt: None,
|
||||
is_spam: false,
|
||||
})
|
||||
.collect(),
|
||||
|
||||
@@ -33,6 +33,7 @@ impl MessageWrapper {
|
||||
let rcpt_addr = rcpt.address();
|
||||
recipients.push(IngestRecipient {
|
||||
address: rcpt_addr.to_lowercase(),
|
||||
orcpt: rcpt.orcpt.as_ref().map(|orcpt| orcpt.to_string()),
|
||||
is_spam: rcpt.flags & RCPT_SPAM_PAYLOAD != 0,
|
||||
});
|
||||
pending_recipients.push((rcpt_idx, rcpt_addr));
|
||||
|
||||
Reference in New Issue
Block a user