davidmoten / subethasmtp

SubEtha SMTP is a Java library for receiving SMTP mail
Other
149 stars 40 forks source link

Question about SMTPUTF8 #132

Closed mnmallea closed 4 months ago

mnmallea commented 4 months ago

Hi, I'm trying to receive emails that contains UTF8 characters in their From or To addresses like eñe@example.org. I saw that subetha doesn't advertise to support SMTPUF8 so I am assuming that it doesn't support it at least by default. Is there a way to enable its support? Does it depends on how we parse the data input stream or does it depend on the sever itself?

davidmoten commented 4 months ago

thanks for the question. I'll have to get my head around that as an SMTP extension first. I've noticed that some SMTP servers support utf-8 characters in From, To addresses by default and others require the support to be turned on by a command. I tend towards the first. Do you have an opinion on that?

mnmallea commented 4 months ago

I also tend to the first option. I think that if the client receives SMTPUTF8 in the EHLOresponse then it will just send the addresses with utf8 encoding.

davidmoten commented 4 months ago

I just modified a unit test to use a To with eñe and the message handler did not call the recipient method with that value. This suggests that we don't support general UTF-8 in addresses. I'll have a look soon.

davidmoten commented 4 months ago

I've knocked up always-on support for SMTPUTF8. I wonder if should be configurable. Can you review the PR?

davidmoten commented 4 months ago

Release 7.1.1 with SMTPUTF8 support, on Maven Central now. Let me know how it goes!