Provided Hooks in James Server

The following hooks are supported:

AuthHook

Allows to hook in your code for authenticate users for sending mail via SMTP AUTH. You could for example query your own database table to see if a user should be allowed to send mail with the given username and password.

ConnectionHandler

Allows to hook in your code on a new connection. So you could just drop it or do something else.

HeloHook

Allows to hook in your code in the HELO and EHLO commands.

MailHook

Allows to hook in your code in the MAIL command. Like checking the sender which was given with MAIL FROM: <whatever@example>

MailParametersHook

Allows to hook in given parameters in the EHLO command.

JamesMessageHook

Allow to hook in your code after the email was received via the DATA command and was marked for queuing by the CLRF.CRLF sequence. This will get executed right before the message will actual get queued.

IMPORTANT: If you want to do heavy processing here and not want to reject the method based on a criteria you are most times better of to use the Mailet API!

QuitHook

Allow to hook in your code in the QUIT command.

RcptHook

Allows to hook in your code in the RCPT command. Like implementing a custom logic to check if the mail for a given recipient should get accepted or rejected.

UnknownCmdHook

Allows to hook in your code on every unknown command.

MailPriorityHandler

Allows to set priority on mails for the spool queues, depending on the destination domain.

HookResultJMXMonitor

Allows to register a HookStatsMBean under JMX for every processed Hook. You will get statistics about the configured hooks via JMX