}
else {
Collection recipients = new HashSet();
recipients.add( recipient );
MailImpl mailImpl = new MailImpl( getId(), sender, recipients, message );
MailRepository userInbox = getUserInbox( username );
if ( userInbox == null ) {
StringBuffer errorBuffer =
new StringBuffer( 128 )
.append( "The inbox for user " )
.append( username )
.append( " was not found on this server." );
throw new MessagingException( errorBuffer.toString() );
}
userInbox.store( mailImpl );
}
}