Oh ok i made a test in command line and log is as you describe :
INFO | jvm 1 | 2010/07/16 07:54:52 | 16 juil. 2010 07:54:52
com.ericdaugherty.mail.server.services.smtp.SMTPSenderStandard
$StandardDeliver deliverRemoteMessage
INFO | jvm 1 | 2010/07/16 07:54:52 | INFO: Delivery complete for
message 832ac6f9 to:
us...@gmail.com
INFO | jvm 1 | 2010/07/16 07:54:54 | 16 juil. 2010 07:54:54
com.ericdaugherty.mail.server.services.smtp.SMTPRemoteSender
processreply
INFO | jvm 1 | 2010/07/16 07:54:54 | INFO: Session has ended
INFO | jvm 1 | 2010/07/16 07:54:54 | 16 juil. 2010 07:54:54
com.ericdaugherty.mail.server.services.smtp.SMTPSenderStandard
$StandardDeliver deliverRemoteMessage
INFO | jvm 1 | 2010/07/16 07:54:54 | INFO: Delivery complete for
message 832ac6f9 to:
us...@gmail.com
INFO | jvm 1 | 2010/07/16 07:54:56 | 16 juil. 2010 07:54:56
com.ericdaugherty.mail.server.services.smtp.SMTPRemoteSender
processreply
INFO | jvm 1 | 2010/07/16 07:54:56 | INFO: Session has ended
INFO | jvm 1 | 2010/07/16 07:54:56 | 16 juil. 2010 07:54:56
com.ericdaugherty.mail.server.services.smtp.SMTPSenderStandard
$StandardDeliver deliverRemoteMessage
INFO | jvm 1 | 2010/07/16 07:54:56 | INFO: Delivery complete for
message 832ac6f9 to:
us...@gmail.com
And
us...@gmail.com is the last user i entered for RCPT TO command.
But i don't think problem is on the lines you mentionned, but here :
while(iter.hasNext()) {
address = iter.next();
if (!
perDomainAddresses.containsKey(address.getDomain())) {
perDomainAddresses.put(address.getDomain(), new
ArrayList());
}
if (!
perDomainAddresses.get(address.getDomain()).contains(address)) {
perDomainAddresses.get(address.getDomain()).add(address);
}
This code block is juste before the "big" while where is the
"deliverRemoteMessage( (String)entry.getKey(), (List)entry.getValue(),
message, address );"
Here value for address at the end of the while is the last value found
in the iterator. And adress value is not changed between here and
deliverRemoteMessage.