class EmailServiceImpl extends Authenticator implements EmailService, InitializedService {

    @Override
    protected PasswordAuthentication getPasswordAuthentication()
    {
        if (null == cfg)
        {
            cfg = DSpaceServicesFactory.getInstance().getConfigurationService();
        }

        return new PasswordAuthentication(
                cfg.getProperty("mail.server.username"),
                cfg.getProperty("mail.server.password"));
    }

}