public void setUsername(String username) {
        this.username = username;
        if (username == null) {
            JiveGlobals.deleteProperty("mail.smtp.username");
        }
        else {
            JiveGlobals.setProperty("mail.smtp.username", username);
        }
        session = null;
    }
Sets the username that will be used when connecting to the SMTP
server. The default is {@code null}, or no username.

@param username the SMTP username.
xmppserver/src/main/java/org/jivesoftware/util/EmailService.java