davidmoten / subethasmtp

SubEtha SMTP is a Java library for receiving SMTP mail

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BasicMessageHandler only saves the last recipient

jakobkmar opened this issue · comments

The BasicMessageHandler class does only save the last recipient.

The recipient() method can actually be called multiple times (javadoc):

Called once for every RCPT TO during a SMTP exchange.

Currently, inside of the recipient() method the variable "recipient" just gets overridden:

@Override
public void recipient(String recipient) throws RejectException {
    this.recipient = recipient;
}

Righto thanks, I'll have a look.

Fixing this will probably be a breaking change, as the type of the to parameter will change from String to List<String>.

What is the state of this issue? Multiple RCPT TO are fundamental features of the SMTP protocol.