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

How to reject non valid emails? #770

Open
moh-sushi opened this issue Aug 14, 2024 · 1 comment
Open

How to reject non valid emails? #770

moh-sushi opened this issue Aug 14, 2024 · 1 comment

Comments

@moh-sushi
Copy link

Hello,

currently i am using the docker version 1.6.5 within my integration tests.

I want to add a test with an invalid email (like www.abc.de).
Greenmail should reject this invalid email and answer with javax.mail.SendFailedException.

how can i achieve this requirement?

This problem may be solved by implementing an instance of MessageDeliveryHandler within an junit test - as seen within https://github.com/greenmail-mail-test/greenmail/blob/master/greenmail-core/src/test/java/com/icegreen/greenmail/examples/ExampleUndeliverableTest.java.
but i do not use greenmail within junit test - i use the docker version.

Can i add an impl of MessageDeliveryHandler to the used docker version?

Thank you!

@marcelmay
Copy link
Member

Hi @moh-sushi ,

that feature is currently only possible when using GreenMail as part of a junit test.

Would you expect for SMTP RCTP command e.g. SMTP 501 Syntax error found in command parameters or arguments / 5.1.3 Bad destination mailbox address syntax ?

This behavior could be enabled for GreenMail SMTP via -Dgreenmail.smtp.address.strict via GREENMAIL_OPTS env.

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

2 participants