global::envelop

Functions to inspect and mutate the SMTP envelop.

fn add_rcpt

fn add_rcpt(new_addr: String) -> ()
fn add_rcpt(new_addr: SharedObject) -> ()
details

Add a new recipient to the envelop. Note that this does not add the recipient to the To header. Use msg::add_rcpt for that.

Args

  • rcpt - the new recipient to add.

Effective smtp stage

All of them.

Examples

#{
    connect: [
       // always deliver a copy of the message to "john.doe@example.com".
       action "rewrite envelop" || envelop::add_rcpt("john.doe@example.com"),
    ]
}

fn bcc

fn bcc(new_addr: String) -> ()
fn bcc(new_addr: SharedObject) -> ()
details

Alias for envelop::add_rcpt.


fn rm_rcpt

fn rm_rcpt(addr: SharedObject) -> ()
fn rm_rcpt(addr: String) -> ()
details

Remove a recipient from the envelop. Note that this does not remove the recipient from the To header. Use msg::rm_rcpt for that.

Args

  • rcpt - the recipient to remove.

Effective smtp stage

All of them.

Examples

#{
    preq: [
       // never deliver to "john.doe@example.com".
       action "rewrite envelop" || envelop::rm_rcpt(address("john.doe@example.com")),
    ]
}

fn rw_mail_from

fn rw_mail_from(new_addr: SharedObject) -> ()
fn rw_mail_from(new_addr: String) -> ()
details

Rewrite the sender received from the MAIL FROM command.

Args

  • new_addr - the new sender address to set.

Effective smtp stage

mail and onwards.

Examples

#{
    preq: [
       action "rewrite envelop" || envelop::rw_mail_from(address("unknown@example.com")),
    ]
}

fn rw_rcpt

fn rw_rcpt(old_addr: String, new_addr: SharedObject) -> ()
fn rw_rcpt(old_addr: String, new_addr: String) -> ()
fn rw_rcpt(old_addr: SharedObject, new_addr: String) -> ()
fn rw_rcpt(old_addr: SharedObject, new_addr: SharedObject) -> ()
details

Replace a recipient received by a RCPT TO command.

Args

  • old_addr - the recipient to replace.
  • new_addr - the new address to use when replacing old_addr.

Effective smtp stage

rcpt and onwards.

Examples

#{
    preq: [
       action "rewrite envelop" || envelop::rw_rcpt("john.doe@example.com", address("john.main@example.com")),
    ]
}