Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make GreenMail configurable - how to provide own Managers #293

Open
shadogray opened this issue Nov 7, 2019 · 5 comments
Open

Make GreenMail configurable - how to provide own Managers #293

shadogray opened this issue Nov 7, 2019 · 5 comments

Comments

@shadogray
Copy link

I would like to provide own Managers, ServerSetups and Commands.
It seems to be not possible now, why are so many components private or static final?

@marcelmay
Copy link
Member

It's pretty old software (before 2006), but we can improve it :-)

Out of curiosity: What is the motivation to replace those central components with own implementations? So that we can change it for the better.

@marcelmay
Copy link
Member

marcelmay commented Nov 10, 2019

What about something like this:

Managers:

  • Additional, optional com.icegreen.greenmail.util.GreenMail constructor
    GreenMail(ServerSetup[] config, Managers managers)

Commands:

  • Allow eg com.icegreen.greenmail.smtp.commands.SmtpCommandRegistry to add/override commands:
    void setCommand(String name, SmtpCommand command)

Looking forward to your feedback

@shadogray
Copy link
Author

Reasons for change:

  • Mailserver validation: we implemented it in our MailCommand, but everything had to be copy/pasted, because: final static, no inheritance, no stack builders, private business logic
  • UserManager proprietary - you frequently want some domain specific logic regarding valid/SPAM mail
  • to me a question of usability: customizable (error) messages, that allow quick and unexpensive understanding of the problem. This is a difficult topic regarding security (by obscurity?), but it simply may help to understand, as in RFC1893, and I am tired of answering silly/repetitive questions, because response is (unnecessarily) unclear.
    I am not an SMTP (simple?) expert, I see an incredible potential in GreenMail, but I need domain specific logic and I loath copy/paste. I did it now twice and I am sick of my hacks.

shadogray pushed a commit to shadogray/greenmail that referenced this issue Nov 10, 2019
shadogray pushed a commit to shadogray/greenmail that referenced this issue Nov 10, 2019
shadogray pushed a commit to shadogray/greenmail that referenced this issue Nov 10, 2019
shadogray pushed a commit to shadogray/greenmail that referenced this issue Nov 11, 2019
@kimmerin
Copy link

Out of curiosity: What is the motivation to replace those central components with own implementations? So that we can change it for the better.

Old thread but still open, so here are my 2 cents: E.g. "override" the IMAP Authenticate command that currently only returns an error to allow the testing of XOauth2 authentication. That's why I wanted to open an issue here before finding this one that already fits in a way.

@marcelmay
Copy link
Member

@kimmerin , a concise PR for XOauth2 would be quite welcomed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants