SMTP Hooks

The James SMTP Server Component allows to easy write your own code which will get executed in the SMTP-Transaction. Thats a bit different then using a Mailet a.k.a Mailet-API.

To customize your SMTP Server, you have a few interfaces which helps you to "hook-in" a specific SMTP Command. That means your class which implements the given interface(s) will get called after the SMTP-Command was parsed and depending on your implementation it will handle it.

As your code will get executed before the mail was even accepted. This can help you in many ways, most times its used for rejecting SPAM/Junk within the SMTP-Dialog. But it can be used for other things too.

Its up to you and your use case.

But be aware as your code needs to get executed during the SMTP-Transaction it should not take to long to execute. As it will need to fit in before the timeout was hit which can be different on every mail server. But as a general rule as long as your code can get executed within 30 seconds it should be fine.

Provided SMTP Hooks

Read more on the provided SMTP Hooks.

Create your own SMTP Hooks

Read more on how to create your own SMTP Hook.