You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by ra...@apache.org on 2001/03/22 11:11:10 UTC

cvs commit: jakarta-turbine/src/java/org/apache/turbine/util/mail Email.java

rafal       01/03/22 02:11:10

  Modified:    conf     TurbineResources.properties build-conf.xml
               conf/master TurbineResources.master meta.properties
               src/java/org/apache/turbine/util/mail Email.java
  Log:
  Added ability to set SMTP-From headers, to direct all 'delivery failed' messages to a separate mailbox. Patches submitted Slawomir.Gawin@e-point.pl
  
  Revision  Changes    Path
  1.76      +13 -1     jakarta-turbine/conf/TurbineResources.properties
  
  Index: TurbineResources.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine/conf/TurbineResources.properties,v
  retrieving revision 1.75
  retrieving revision 1.76
  diff -u -r1.75 -r1.76
  --- TurbineResources.properties	2001/03/21 00:31:08	1.75
  +++ TurbineResources.properties	2001/03/22 10:11:09	1.76
  @@ -1,5 +1,5 @@
   # -------------------------------------------------------------------
  -# $Id: TurbineResources.properties,v 1.75 2001/03/21 00:31:08 jmcnally Exp $
  +# $Id: TurbineResources.properties,v 1.76 2001/03/22 10:11:09 rafal Exp $
   #
   # This is the configuration file for Turbine.
   #
  @@ -94,6 +94,18 @@
   # -------------------------------------------------------------------
   
   mail.server=
  +
  +# -------------------------------------------------------------------
  +# SMTP-From header for your outgoing messages
  +#
  +# All failed delivery messages will be returned to this address.
  +# If unset, these messages will be sent to the address in the 
  +# From header (standard behaviour)
  +#
  +# Default: null
  +# -------------------------------------------------------------------
  +
  +mail.smtp.from=ziu@rulez.com
   
   # -------------------------------------------------------------------
   # 
  
  
  
  1.17      +1 -0      jakarta-turbine/conf/build-conf.xml
  
  Index: build-conf.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine/conf/build-conf.xml,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- build-conf.xml	2001/02/17 17:13:41	1.16
  +++ build-conf.xml	2001/03/22 10:11:09	1.17
  @@ -93,6 +93,7 @@
       <filter token="TURBINE_LOG" value="${turbine.log}"/>
           
       <filter token="MAIL_SERVER" value="${mail.server}"/>
  +    <filter token="MAIL_SMTP_FROM" value="${mail.smtp.from}"/>
           
       <filter token="MODULE_CACHE" value="${module.cache}"/>
       <filter token="MODULE_PACKAGES" value="${module.packages}"/>
  
  
  
  1.42      +13 -1     jakarta-turbine/conf/master/TurbineResources.master
  
  Index: TurbineResources.master
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine/conf/master/TurbineResources.master,v
  retrieving revision 1.41
  retrieving revision 1.42
  diff -u -r1.41 -r1.42
  --- TurbineResources.master	2001/03/21 00:31:09	1.41
  +++ TurbineResources.master	2001/03/22 10:11:09	1.42
  @@ -1,5 +1,5 @@
   # -------------------------------------------------------------------
  -# $Id: TurbineResources.master,v 1.41 2001/03/21 00:31:09 jmcnally Exp $
  +# $Id: TurbineResources.master,v 1.42 2001/03/22 10:11:09 rafal Exp $
   #
   # This is the configuration file for Turbine.
   #
  @@ -94,6 +94,18 @@
   # -------------------------------------------------------------------
   
   mail.server=@MAIL_SERVER@
  +
  +# -------------------------------------------------------------------
  +# SMTP-From header for your outgoing messages
  +#
  +# All failed delivery messages will be returned to this address.
  +# If unset, these messages will be sent to the address in the 
  +# From header (standard behaviour)
  +#
  +# Default: null
  +# -------------------------------------------------------------------
  +
  +mail.smtp.from=@MAIL_SMTP_FROM@
   
   # -------------------------------------------------------------------
   # 
  
  
  
  1.11      +1 -0      jakarta-turbine/conf/master/meta.properties
  
  Index: meta.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine/conf/master/meta.properties,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- meta.properties	2001/01/30 18:30:47	1.10
  +++ meta.properties	2001/03/22 10:11:09	1.11
  @@ -10,6 +10,7 @@
   turbine.log=/logs/turbine.log
   
   mail.server=
  +mail.smtp.from=
   
   module.cache=false
   module.packages=org.apache.turbine.modules
  
  
  
  1.10      +6 -1      jakarta-turbine/src/java/org/apache/turbine/util/mail/Email.java
  
  Index: Email.java
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine/src/java/org/apache/turbine/util/mail/Email.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- Email.java	2001/03/06 06:14:27	1.9
  +++ Email.java	2001/03/22 10:11:10	1.10
  @@ -78,7 +78,7 @@
    * @author <a href="mailto:bmclaugh@algx.net">Brett McLaughlin</a>
    * @author <a href="mailto:greg@shwoop.com">Greg Ritter</a>
    * @author <a href="mailto:unknown">Regis Koenig</a>
  - * @version $Id: Email.java,v 1.9 2001/03/06 06:14:27 chrise Exp $
  + * @version $Id: Email.java,v 1.10 2001/03/22 10:11:10 rafal Exp $
    */
   public abstract class Email
   {
  @@ -93,6 +93,7 @@
   
       public static final String MAIL_SERVER = "mail.server";
       public static final String MAIL_HOST = "mail.host";
  +    public static final String MAIL_SMTP_FROM = "mail.smtp.from";
       public static final String MAIL_TRANSPORT_PROTOCOL = "mail.transport.protocol";
       public static final String SMTP = "SMTP";
       public static final String TEXT_HTML = "text/html";
  @@ -140,6 +141,10 @@
           properties.put ( MAIL_TRANSPORT_PROTOCOL, SMTP );
           properties.put ( MAIL_HOST,
                            TurbineResources.getString( MAIL_SERVER ) );
  +        String mailSMTPFrom = TurbineResources.getString(MAIL_SMTP_FROM);
  +        if(mailSMTPFrom!=null && !mailSMTPFrom.equals("")) {
  +            properties.put ( MAIL_SMTP_FROM, mailSMTPFrom );
  +        }
           return Session.getDefaultInstance(properties, null);
       }
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org