HSAdmin Backend Domains, E-Mail, Datenbanken
peter
2013-05-25 3b01d27a1d9e4e99f85642456b65424e652dad69
make from-address of service-email configurable
1 files modified
14 ■■■■ changed files
hsarback/src/de/hsadmin/core/qserv/QueueServer.java 14 ●●●● patch | view | raw | blame | history
hsarback/src/de/hsadmin/core/qserv/QueueServer.java
@@ -26,7 +26,7 @@
public class QueueServer extends QueueCommons implements MessageListener, ExceptionListener {
    
    private static final String VERSION_NO = "1.1";
    private static final String VERSION_NO = "1.1.1";
    
    private Logger logger;
    private QueueConnection conn;
@@ -37,6 +37,7 @@
    private String jmsSystemQueue;
    private String jmsFactory;
    private String serviceEMail;
    private String fromEMail;
    /** 
     * Runs the QueueServer, using the arguments as ConnectionFactory 
@@ -63,6 +64,7 @@
        qServ.setJmsUserName(props.getProperty("hsadmin.jms.username"));
        qServ.setJmsPassWord(props.getProperty("hsadmin.jms.password"));
        qServ.setServiceEMail(props.getProperty("hsadmin.log.email"));
        qServ.setFromEMail(props.getProperty("hsadmin.log.from"));
        Logger logger = Logger.getLogger("de.hsadmin.core.qserv");
        logger.log(Level.CONFIG, "hsadmin-qserv " + VERSION_NO + " started using:" 
         + "\nqueue server: " + props.getProperty("hsadmin.jms.factory")
@@ -109,6 +111,14 @@
        }
    }
    private void setFromEMail(String emailAddress) {
        if (emailAddress == null || emailAddress.isEmpty()) {
            fromEMail = "hsadmin@hostsharing.net";
        } else {
            fromEMail = emailAddress;
        }
    }
    private boolean connect() {
        // create JMS connection and session
        try {
@@ -145,7 +155,7 @@
            } catch (ProcessorException e) {
                logException(e);
                task.setException(e);
                SmtpHelper.send("hostmaster@hostsharing.net", serviceEMail, jmsSystemQueue, processor.logInfo());
                SmtpHelper.send(fromEMail, serviceEMail, jmsSystemQueue, processor.logInfo());
            }
        } catch (Throwable throwable) {
            logException(throwable);