[][src]Attribute Macro milter_callback::on_helo

#[on_helo]

Generates a callback function of type HeloCallback that delegates to the annotated function.

As its sole argument on_helo takes an identifier to be used as the name of the generated function.

The on_helo callback is called when a HELO or EHLO SMTP command is received. The signature of the annotated function must be as specified below.

Arguments:

  • Context<T> – the callback context
  • &str – the client’s hostname as stated in the HELO/EHLO command

Return type:

  • Status – the response status

Examples

use milter::{Context, Status};

#[on_helo(helo_callback)]
fn handle_helo(context: Context<MyData>, helo_host: &str) -> Status {
    Status::Continue
}