Question

A few days ago, an idea came to my mind regarding a spam-protection technology.

Therefore, I'm in search of an SMTP-server, which is able to be enhanced by filter plugins.

Is anybody aware of an SMTP framework or a SMTP-server, which provides an API for plugins?

I already stumbled upon Apache's james Project, which at least seems to provide a rich set of email-related modules.

Was it helpful?

Solution

I switched to subethasmtp some days ago and belive that its api support what you are searching for.

You can implement some Handlers, to deal with mails.

final MessageHandlerFactory mhf = new MessageHandlerFactory() {

            @Override
            public MessageHandler create(final MessageContext ctx) {
                return new MessageHandler() {

                    @Override
                    public void recipient(final String recipient) throws RejectException {
                        // TODO Auto-generated method stub
                    }

                    @Override
                    public void from(final String from) throws RejectException {
                        // TODO Auto-generated method stub
                    }

                    @Override
                    public void done() {
                        // TODO Auto-generated method stub
                    }

                    @Override
                    public void data(final InputStream data) throws RejectException, TooMuchDataException, IOException {
                    }
                };
            }
        };
        final SMTPServer srv = new SMTPServer(mhf);
        srv.start();
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top