greenmail-mail-test / greenmail

Official master for the Greenmail project
http://greenmail-mail-test.github.io/greenmail/
Apache License 2.0
639 stars 184 forks source link

Modify regex in the RcptCommand class to allow adding parameters. #822

Closed ghdcksgml1 closed 2 days ago

ghdcksgml1 commented 3 days ago

Hello! I’ve been using GreenMail useful.

While using it, I noticed one area that could be improved, so I’m submitting this PR to address it.

According to [RFC 2821 Section 4.1.1.3] mentioned in the Java docs, the RCPT TO command, like the MAIL command, can accept parameters.

However, currently, an error occurs when parameters are added as shown below.

issueCommand : "RCPT TO: <test@localhost> NOTIFY=SUCCESS,FAILURE"

expect: "250 OK"
actual : "501 Required syntax: 'RCPT TO:<email@host>'"

In my case, I am customizing the SMTPTransport to include custom parameters, but errors occur every time a parameter is added.

I would greatly appreciate it if you could allow changing the regular expression used in the MAILCommand class to accommodate this!

marcelmay commented 2 days ago

Thanks alot, @ghdcksgml1 !

marcelmay commented 2 days ago

@ghdcksgml1 , I plan to roll a patch release 2.1.2 this weekend

ghdcksgml1 commented 2 days ago

Thanks to apply my opinion! @marcelmay