mirror of
https://github.com/github/codeql.git
synced 2026-04-28 02:05:14 +02:00
Add dependent stub classes for the test case
This commit is contained in:
@@ -9,28 +9,27 @@ import javax.mail.Session;
|
||||
|
||||
import org.apache.commons.mail.DefaultAuthenticator;
|
||||
import org.apache.commons.mail.Email;
|
||||
import org.apache.commons.mail.EmailException;
|
||||
import org.apache.commons.mail.SimpleEmail;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
class InsecureJavaMail {
|
||||
public void testJavaMail() {
|
||||
final Properties properties = new Properties();
|
||||
properties.put("mail.transport.protocol", "protocol");
|
||||
properties.put("mail.smtp.host", "hostname");
|
||||
properties.put("mail.smtp.socketFactory.class", "classname");
|
||||
final Properties properties = new Properties();
|
||||
properties.put("mail.transport.protocol", "protocol");
|
||||
properties.put("mail.smtp.host", "hostname");
|
||||
properties.put("mail.smtp.socketFactory.class", "classname");
|
||||
|
||||
final javax.mail.Authenticator authenticator = new javax.mail.Authenticator() {
|
||||
protected PasswordAuthentication getPasswordAuthentication() {
|
||||
return new PasswordAuthentication("username", "password");
|
||||
}
|
||||
};
|
||||
if (null != authenticator) {
|
||||
properties.put("mail.smtp.auth", "true");
|
||||
// properties.put("mail.smtp.ssl.checkserveridentity", "true");
|
||||
final javax.mail.Authenticator authenticator = new javax.mail.Authenticator() {
|
||||
protected PasswordAuthentication getPasswordAuthentication() {
|
||||
return new PasswordAuthentication("username", "password");
|
||||
}
|
||||
final Session session = Session.getInstance(properties, authenticator);
|
||||
};
|
||||
if (null != authenticator) {
|
||||
properties.put("mail.smtp.auth", "true");
|
||||
// properties.put("mail.smtp.ssl.checkserveridentity", "true");
|
||||
}
|
||||
final Session session = Session.getInstance(properties, authenticator);
|
||||
}
|
||||
|
||||
public void testSimpleMail() {
|
||||
|
||||
Reference in New Issue
Block a user