Subversion Repositories bacoAlunos

Compare Revisions

Ignore whitespace Rev 1430 → Rev 1431

/branches/v3/impl/conf/app.properties
29,13 → 29,18
 
email.local.suffix=estgp.pt
email.server=smtp.gmail.com
 
##If RoundRobin is false will use email.from property in from address
email.use.round.robin=@email.use.round.robin@
email.use.security=@email.use.security@
#to use example: bacodev1@estgp.pt bacodev2@estgp.pt
email.user.prefix=@email.user.prefix@
email.user.sufix=@email.user.sufix@
email.user.count=20
email.user=bacodev@estgp.pt
email.password=@email.password@
email.from=bacodev@estgp.pt
 
email.from=@email.from@
email.templates.dir=@email.templates.dir@
#email.server.security=
#email.server.security=SSL
/branches/v3/impl/src/java/pt/estgp/estgweb/Globals.java
125,7 → 125,7
public static final String TMP_DIR = ConfigProperties.getProperty("tmp.dir");
public static final String DATA_DIR = ConfigProperties.getProperty("data.dir");
public static final String JOB_SERVICES_LOG_DIR = ConfigProperties.getProperty("data.dir") + java.io.File.separator + "jobslogs";
;
 
public static final String EMAIL_SERVER_HOST = ConfigProperties.getProperty("email.server");
public static final String EMAIL_SERVER_SECURITY = ConfigProperties.getProperty("email.server.security");
public static final int EMAIL_SERVER_SECURITY_TLS = ConfigProperties.getIntProperty("email.server.security.tls");
141,7 → 141,11
 
public static final String ADMIN_EMAIL = ConfigProperties.getProperty("admin.email");
public static final String ADMIN_EMAIL_2 = ConfigProperties.getProperty("admin.email.2");
 
public static final boolean SYSTEM_EMAIL_USE_SECURITY = ConfigProperties.getBooleanProperty("email.use.security");
public static final boolean SYSTEM_EMAIL_USE_ROUND_ROBIN = ConfigProperties.getBooleanProperty("email.use.round.robin");
public static final String SYSTEM_EMAIL_BOX = ConfigProperties.getProperty("email.from");
 
public static final String ANNOUNCEMENT_TYPE_NEWS = "news";
public static final String ANNOUNCEMENT_TYPE_TOP_FLASH_NEWS = "top.flash.news";
public static final String ANNOUNCEMENT_TYPE_BOTTOM_FLASH_NEWS = "bottom.flash.news";
/branches/v3/impl/src/java/pt/estgp/estgweb/services/email/SendEmailService.java
65,15 → 65,19
return;
}
try{
final String sendFromAddress = getRoundRobinEmailUser();
 
 
final String sendFromAddress = Globals.SYSTEM_EMAIL_USE_ROUND_ROBIN ?
getRoundRobinEmailUser() : Globals.SYSTEM_EMAIL_BOX;
 
 
// Set up properties for mail session
Properties props = System.getProperties();
props.put("mail.smtp.host", Globals.EMAIL_SERVER_HOST);
final String username = Globals.EMAIL_SERVER_USERNAME;
final String password = Globals.EMAIL_SERVER_PASSWORD;
javax.mail.Authenticator authenticator = null;
if(Globals.EMAIL_SERVER_SECURITY != null && Globals.EMAIL_SERVER_SECURITY.compareTo("TLS")==0)
if(Globals.SYSTEM_EMAIL_USE_SECURITY && Globals.EMAIL_SERVER_SECURITY != null && Globals.EMAIL_SERVER_SECURITY.compareTo("TLS")==0)
{
props.put("mail.smtp.auth", "true");
props.put("mail.smtp.starttls.enable", "true");
84,7 → 88,7
}
};
}
else if(Globals.EMAIL_SERVER_SECURITY != null && Globals.EMAIL_SERVER_SECURITY.compareTo("SSL")==0)
else if(Globals.SYSTEM_EMAIL_USE_SECURITY && Globals.EMAIL_SERVER_SECURITY != null && Globals.EMAIL_SERVER_SECURITY.compareTo("SSL")==0)
{
props.put("mail.smtp.socketFactory.port", Globals.EMAIL_SERVER_SECURITY_SSL);
props.put("mail.smtp.socketFactory.class",
108,7 → 112,10
 
 
// Get session
Session session = Session.getDefaultInstance(props, authenticator);
Session session = authenticator != null ?
Session.getDefaultInstance(props, authenticator)
: Session.getDefaultInstance(props) ;
 
session.setDebug(true);
session.setDebugOut(System.out);
 
/branches/v3/impl/build.properties
159,6 → 159,11
email.templates.dir.build=${build.dir.classes}${email.templates.dir}
email.templates.dir.conf=${conf.dir}${email.templates.dir}
 
##If RoundRobin is false will use email.from property in from address
email.from=baco@estgp.pt
email.use.round.robin=true
#If not set will not use any security, only for localhost
email.use.security=true
#EMAIL SERVER SMTP GOOGLE
email.password=DUMMY_PASSWORD_GMAIL
email.user.prefix=bacodev
/branches/v3/impl/build.xml
476,7 → 476,10
 
<replacefilter token="@email.password@" value="${email.password}"/>
<replacefilter token="@email.user.sufix@" value="${email.user.sufix}"/>
<replacefilter token="@email.use.round.robin@" value="${email.use.round.robin}"/>
<replacefilter token="@email.use.security@" value="${email.use.security}"/>
<replacefilter token="@email.user.prefix@" value="${email.user.prefix}"/>
<replacefilter token="@email.from@" value="${email.from}"/>
<replacefilter token="@test.control.var@" value="${test.control.var}"/>
 
<replacefilter token="@mode.pae.enabled@" value="${mode.pae.enabled}"/>