azuma, kuniyuki > Haineko-0.2.16 > Haineko::SMTPD::Milter::Example

Download:
Haineko-0.2.16.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Source  

NAME ^

Haineko::SMTPD::Milter::Example - Haineko milter for Example

DESCRIPTION ^

Example Haineko::SMTPD::Milter class.

SYNOPSIS ^

    use Haineko::SMTPD::Milter;
    Haineko::SMTPD::Milter->import( [ 'Example' ]);

IMPLEMENT MILTER METHODS (Override Haineko::SMTPD::Milter) ^

Each method is called from /submit at each phase of SMTP session. If you want to reject the smtp connection, set required values into Haineko::SMTPD::Response object and return 0 or undef as a return value of each method. However you want to only rewrite contents or passed your contents filter, return 1 or true as a return value.

conn( Haineko::SMTPD::Response, REMOTE_HOST, REMOTE_ADDR )

conn() method is for checking a client hostname and client IP address.

Arguments

Haineko::SMTPD::Response object

If your milter program rejects a message, set 1 by ->error(1), set error message by ->message( [ 'Error message' ]), and override SMTP status code by ->code(), Default SMTP status codes is 421 in this method.

REMOTE_HOST

The host name of the message sender, as picked from HTTP REMOTE_HOST variable.

REMOTE_ADDR

The host address, as picked from HTTP REMOTE_ADDR variable.

ehlo( Haineko::SMTPD::Response, HELO_HOST )

ehlo() method is for checking a hostname passed as an argument of EHLO.

Arguments

Haineko::SMTPD::Response object

If your milter program rejects a message, set 1 by ->error(1), set error message by ->message( [ 'Error message' ]), and override SMTP status code by ->code(), override D.S.N value by ->dsn(). Default SMTP status codes is 521 in this method.

HELO_HOST

Value defined in ehlo field in HTTP POST JSON data, which should be the domain name of the sending host or IP address enclosed square brackets.

mail( Haineko::SMTPD::Response, ENVELOPE_SENDER )

mail() method is for checking an envelope sender address.

Arguments

Haineko::SMTPD::Response object

If your milter program rejects a message, set 1 by ->error(1), set error message by ->message( [ 'Error message' ]), and override SMTP status code by ->code(), override D.S.N value by ->dsn(). Default SMTP status codes is 501, dsn is 5.1.8 in this method.

ENVELOPE_SENDER

Value defined in mail field in HTTP POST JSON data, which should be the valid email address.

rcpt( Haineko::SMTPD::Response, [ ENVELOPE_RECIPIENTS ] )

rcpt() method is for checking envelope recipient addresses. Envelope recipient addresses are password as an array reference.

Arguments

Haineko::SMTPD::Response object

If your milter program rejects a message, set 1 by ->error(1), set error message by ->message( [ 'Error message' ]), and override SMTP status code by ->code(), override D.S.N value by ->dsn(). Default SMTP status codes is 553, dsn is 5.7.1 in this method.

ENVELOPE_RECIPIENTS

Values defined in rcpt field in HTTP POST JSON data, which should be the valid email address.

head( Haineko::SMTPD::Response, { EMAIL_HEADER } )

head() method is for checking email header. Email header is password as an hash reference.

Arguments

Haineko::SMTPD::Response object

If your milter program rejects a message, set 1 by ->error(1), set error message by ->message( [ 'Error message' ]), and override SMTP status code by ->code(), override D.S.N value by ->dsn(). Default SMTP status codes is 554, dsn is 5.7.1 in this method.

EMAIL_HEADER

Values defined in "header" field in HTTP POST JSON data.

body( Haineko::SMTPD::Response, \EMAIL_BODY )

boby() method is for checking email body. Email body is password as an scalar reference.

Arguments

Haineko::SMTPD::Response object

If your milter program rejects a message, set 1 by ->error(1), set error message by ->message( [ 'Error message' ]), and override SMTP status code by ->code(), override D.S.N value by ->dsn(). Default SMTP status codes is 554, dsn is 5.6.0 in this method.

EMAIL_BODY

Value defined in "body" field in HTTP POST JSON data.

SEE ALSO ^

https://www.milter.org/developers/api/

REPOSITORY ^

https://github.com/azumakuniyuki/Haineko

AUTHOR ^

azumakuniyuki <perl.org [at] azumakuniyuki.org>

LICENSE ^

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

syntax highlighting: