Home » geronimo-2.2-source-release » org.apache.geronimo.mail » [javadoc | source]
org.apache.geronimo.mail
public class: SMTPSTransportGBean [javadoc | source]
java.lang.Object
   org.apache.geronimo.mail.ProtocolGBean
      org.apache.geronimo.mail.SMTPSTransportGBean

All Implemented Interfaces:
    GBeanLifecycle

A GBean that provides for the configuration of a JavaMail SMTP transport protocol.

SMTP transport properties that are common to all SMTP transports are provided via member variables of this class. Values that are set in the individual member variables will override any of the corresponding values that have been set in the properties set.

Field Summary
public static final  String SMTPS_PORT     
public static final  String SMTPS_CONNECTION_TIMEOUT     
public static final  String SMTPS_TIMEOUT     
public static final  String SMTPS_FROM     
public static final  String SMTPS_AUTH     
public static final  String SMTPS_REALM     
public static final  String SMTPS_QUITWAIT     
public static final  String SMTPS_FACTORY_CLASS     
public static final  String SMTPS_FACTORY_FALLBACK     
public static final  String SMTPS_FACTORY_PORT     
public static final  String SMTPS_LOCALHOST     
public static final  String SMTPS_LOCALADDRESS     
public static final  String SMTPS_LOCALPORT     
public static final  String SMTPS_EHLO     
public static final  String SMTPS_SUBMITTER     
public static final  String SMTPS_DSN_NOTIFY     
public static final  String SMTPS_DSN_RET     
public static final  String SMTPS_8BITMIME     
public static final  String SMTPS_SEND_PARTIAL     
public static final  String SMTPS_REPORT_SUCCESS     
public static final  String SMTPS_MAIL_EXTENSION     
public static final  String SMTPS_STARTTLS_ENABLE     
public static final  String GBEAN_EHLO     
public static final  String GBEAN_SUBMITTER     
public static final  String GBEAN_DSN_NOTIFY     
public static final  String GBEAN_DSN_RET     
public static final  String GBEAN_8BITMIME     
public static final  String GBEAN_SEND_PARTIAL     
public static final  String GBEAN_REPORT_SUCCESS     
public static final  String GBEAN_MAIL_EXTENSION     
public static final  String GBEAN_STARTTLS_ENABLE     
public static final  GBeanInfo GBEAN_INFO     
Fields inherited from org.apache.geronimo.mail.ProtocolGBean:
GBEAN_OBJECTNAME,  GBEAN_PROTOCOL,  GBEAN_PROPERTIES,  GBEAN_HOST,  GBEAN_USER,  GBEAN_ADD_OVERRIDES,  GBEAN_PORT,  GBEAN_CONNECTION_TIMEOUT,  GBEAN_TIMEOUT,  GBEAN_FROM,  GBEAN_AUTH,  GBEAN_REALM,  GBEAN_QUITWAIT,  GBEAN_FACTORY_CLASS,  GBEAN_FACTORY_FALLBACK,  GBEAN_FACTORY_PORT,  GBEAN_LOCALHOST,  GBEAN_LOCALADDRESS,  GBEAN_LOCALPORT,  GBEAN_INFO
Constructor:
 public SMTPSTransportGBean(String objectName,
    Properties properties,
    String host,
    String user,
    Integer port,
    Integer connectionTimeout,
    Integer timeout,
    String from,
    String localhost,
    String localaddress,
    Integer localport,
    Boolean ehlo,
    Boolean auth,
    Boolean startTLSEnable,
    String submitter,
    String dsnNotify,
    String dsnRet,
    Boolean allow8bitmime,
    Boolean sendPartial,
    String saslRealm,
    Boolean quitWait,
    Boolean reportSuccess,
    String socketFactoryClass,
    Boolean socketFactoryFallback,
    Integer socketFactoryPort,
    String mailExtension) 
    Construct an instance of SMTPSTransportGBean

    Values that are set in the individual member variables will override any of the corresponding values that have been set in the properties set.

    Parameters:
    objectName - the object name of the protocol
    properties - the set of default properties for the protocol
    host - the host the protocol connects to
    user - the default name for the protocol
    port - the SMTPS server port
    connectionTimeout - the socket connection timeout value in milliseconds
    timeout - the socket I/O timeout value in milliseconds
    from - the email address to use for SMTPS MAIL command
    localhost - the local host name used in the SMTPS HELO or EHLO command
    localaddress - the local address (host name) to bind to when creating the SMTPS socket
    localport - the local port number to bind to when creating the SMTPS socket
    ehlo - whether an attempt will be made to sign on with the EHLO command
    auth - whether an attempt will be made to authenticate the user using the AUTH command
    startTLSEnable - the flag that enables the use of the STARTTLS command (if supported by the server) to switch the connection to a TLS-protected connection before issuing any login commands
    submitter - the submitter to use in the AUTH tag in the MAIL FROM command
    dsnNotify - the NOTIFY option to the RCPT command
    dsnRet - the RET option to the MAIL command
    allow8bitmime - whether encodings are converted to use "8bit" under certain conditions
    sendPartial - whether to send email to valid addresses when others are invalid
    saslRealm - the realm to use with DIGEST-MD5 authentication
    quitWait - whether the transport will wait for the response to the QUIT command
    reportSuccess - whether the transport will include an SMTPAddressSucceededException for each address that is successful
    socketFactoryClass - the class that will be used to create SMTPS sockets
    socketFactoryFallback - whether java.net.Socket class will be created if the specified socket factory class cannot be created
    socketFactoryPort - whether java.net.Socket class will be created if the specified socket factory class cannot be created
    mailExtension - the extension string to append to the MAIL command
Method from org.apache.geronimo.mail.SMTPSTransportGBean Summary:
addOverrides,   doFail,   doStart,   doStop,   getAllow8bitmime,   getAuth,   getConnectionTimeout,   getDsnNotify,   getDsnRet,   getEhlo,   getFrom,   getGBeanInfo,   getLocaladdress,   getLocalhost,   getLocalport,   getMailExtension,   getPort,   getQuitWait,   getReportSuccess,   getSaslRealm,   getSendPartial,   getSocketFactoryClass,   getSocketFactoryFallback,   getSocketFactoryPort,   getStartTLSEnable,   getSubmitter,   getTimeout,   setAllow8bitmime,   setAuth,   setConnectionTimeout,   setDsnNotify,   setDsnRet,   setEhlo,   setFrom,   setLocaladdress,   setLocalhost,   setLocalport,   setMailExtension,   setPort,   setQuitWait,   setReportSuccess,   setSaslRealm,   setSendPartial,   setSocketFactoryClass,   setSocketFactoryFallback,   setSocketFactoryPort,   setStartTLSEnable,   setSubmitter,   setTimeout
Methods from org.apache.geronimo.mail.ProtocolGBean:
addOverrides,   doFail,   doStart,   doStop,   getGBeanInfo,   getHost,   getObjectName,   getProperties,   getProtocol,   getUser,   setHost,   setProperties,   setUser
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.geronimo.mail.SMTPSTransportGBean Detail:
 public  void addOverrides(Properties props) 
    Add the overrides from the member variables to the properties file.
 public  void doFail() 
 public  void doStart() throws Exception 
 public  void doStop() throws Exception 
 public Boolean getAllow8bitmime() 
    Returns whether encodings are converted to use "8bit" under certain conditions.

    If set to true, and the server supports the 8BITMIME extension, text parts of messages that use the "quoted-printable" or "base64" encodings are converted to use "8bit" encoding if they follow the RFC2045 rules for 8bit text.

 public Boolean getAuth() 
    Returns whether an attempt will be made to authenticate the user using the AUTH command.

    Defaults to false.

 public Integer getConnectionTimeout() 
    Returns the socket connection timeout value in milliseconds.
 public String getDsnNotify() 
    Returns the NOTIFY option to the RCPT command.

    Either NEVER, or some combination of SUCCESS, FAILURE, and DELAY (separated by commas).

 public String getDsnRet() 
    Returns the RET option to the MAIL command.

    Either FULL or HDRS.

 public Boolean getEhlo() 
    Returns whether an attempt will be made to sign on with the EHLO command.

    If false, do not attempt to sign on with the EHLO command. Normally failure of the EHLO command will fallback to the HELO command; this property exists only for servers that don't fail EHLO properly or don't implement EHLO properly.

 public String getFrom() 
    Returns the email address to use for SMTP MAIL command.
 public static GBeanInfo getGBeanInfo() 
 public String getLocaladdress() 
    Returns the local address (host name) to bind to when creating the SMTP socket.
 public String getLocalhost() 
    Returns the local host name used in the SMTP HELO or EHLO command.
 public Integer getLocalport() 
    Returns the local port number to bind to when creating the SMTP socket.
 public String getMailExtension() 
    Returns the extension string to append to the MAIL command.

    Extension string to append to the MAIL command. The extension string can be used to specify standard SMTP service extensions as well as vendor-specific extensions. Typically the application should use the SMTPTransport method supportsExtension to verify that the server supports the desired service extension. See RFC 1869 and other RFCs that define specific extensions.

 public Integer getPort() 
    Returns the SMTP server port to connect to, if the connect() method doesn't explicitly specify one.
 public Boolean getQuitWait() 
    Returns whether the transport will wait for the response to the QUIT command.

    If set to true, causes the transport to wait for the response to the QUIT command. If set to false (the default), the QUIT command is sent and the connection is immediately closed.

 public Boolean getReportSuccess() 
    Returns whether the transport will include an SMTPAddressSucceededException for each address that is successful.

    Note also that this will cause a SendFailedException to be thrown from the sendMessage method of SMTPTransport even if all addresses were correct and the message was sent successfully.

 public String getSaslRealm() 
    Returns the realm to use with DIGEST-MD5 authentication.
 public Boolean getSendPartial() 
    Returns whether to send email to valid addresses when others are invalid.

    If set to true, and a message has some valid and some invalid addresses, send the message anyway, reporting the partial failure with a SendFailedException. If set to false (the default), the message is not sent to any of the recipients if there is an invalid recipient address.

 public String getSocketFactoryClass() 
    Returns the class that will be used to create SMTP sockets.

    If set, specifies the name of a class that implements the javax.net.SocketFactory interface. This class will be used to create SMTP sockets.

 public Boolean getSocketFactoryFallback() 
    Returns whether java.net.Socket class will be created if the specified socket factory class cannot be created.

    If set to true, failure to create a socket using the specified socket factory class will cause the socket to be created using the java.net.Socket class. Defaults to true.

 public Integer getSocketFactoryPort() 
    Returns the port to connect to when using the specified socket factory.

    Specifies the port to connect to when using the specified socket factory. If not set, the default port will be used.

 public Boolean getStartTLSEnable() 
    Returns the flag that enables the use of the STARTTLS command (if supported by the server) to switch the connection to a TLS-protected connection before issuing any login commands.

    If true, enables the use of the STARTTLS command (if supported by the server) to switch the connection to a TLS-protected connection before issuing any login commands. Note that an appropriate trust store must configured so that the client will trust the server's certificate. This feature only works on J2SE 1.4 and newer systems. Default is false.

 public String getSubmitter() 
    Returns the submitter to use in the AUTH tag in the MAIL FROM command.

    Typically used by a mail relay to pass along information about the original submitter of the message. See also the setSubmitter method of SMTPMessage. Mail clients typically do not use this.

 public Integer getTimeout() 
    Returns the socket I/O timeout value in milliseconds.
 public  void setAllow8bitmime(Boolean allow8bitmime) 
    Sets whether encodings are converted to use "8bit" under certain conditions.

    If set to true, and the server supports the 8BITMIME extension, text parts of messages that use the "quoted-printable" or "base64" encodings are converted to use "8bit" encoding if they follow the RFC2045 rules for 8bit text.

    Values that are set here will override any of the corresponding value that has been set in the properties.

 public  void setAuth(Boolean auth) 
    Sets whether an attempt will be made to authenticate the user using the AUTH command.

    Defaults to false.

    Values that are set here will override any of the corresponding value that has been set in the properties.

 public  void setConnectionTimeout(Integer connectionTimeout) 
    Sets the socket connection timeout value in milliseconds.

    Default is infinite timeout.

    Values that are set here will override any of the corresponding value that has been set in the properties.

 public  void setDsnNotify(String dsnNotify) 
    Sets the NOTIFY option to the RCPT command

    Either NEVER, or some combination of SUCCESS, FAILURE, and DELAY (separated by commas).

    Values that are set here will override any of the corresponding value that has been set in the properties.

 public  void setDsnRet(String dsnRet) 
    Sets the RET option to the MAIL command

    Either FULL or HDRS.

    Values that are set here will override any of the corresponding value that has been set in the properties.

 public  void setEhlo(Boolean ehlo) 
    Set whether an attempt will be made to sign on with the EHLO command.

    If false, do not attempt to sign on with the EHLO command. Normally failure of the EHLO command will fallback to the HELO command; this property exists only for servers that don't fail EHLO properly or don't implement EHLO properly.

    Values that are set here will override any of the corresponding value that has been set in the properties.

 public  void setFrom(String from) 
    Sets the email address to use for SMTP MAIL command

    Email address to use for SMTP MAIL command. This sets the envelope return address. Defaults to msg.getFrom() or InternetAddress.getLocalAddress(). NOTE: mail.smtps.user was previously used for this.

    Values that are set here will override any of the corresponding value that has been set in the properties.

 public  void setLocaladdress(String localaddress) 
    Sets the local address (host name) to bind to when creating the SMTP socket.

    Local address (host name) to bind to when creating the SMTP socket. Defaults to the address picked by the Socket class. Should not normally need to be set, but useful with multi-homed hosts where it's important to pick a particular local address to bind to.

    Values that are set here will override any of the corresponding value that has been set in the properties.

 public  void setLocalhost(String localhost) 
    Sets the local host name used in the SMTP HELO or EHLO command.

    Local host name used in the SMTP HELO or EHLO command. Defaults to InetAddress.getLocalHost().getHostName(). Should not normally need to be set if your JDK and your name service are configured properly.

    Values that are set here will override any of the corresponding value that has been set in the properties.

 public  void setLocalport(Integer localport) 
    Sets the local port number to bind to when creating the SMTP socket.

    Local port number to bind to when creating the SMTP socket. Defaults to the port number picked by the Socket class.

    Values that are set here will override any of the corresponding value that has been set in the properties.

 public  void setMailExtension(String mailExtension) 
    Sets the extension string to append to the MAIL command.

    Extension string to append to the MAIL command. The extension string can be used to specify standard SMTP service extensions as well as vendor-specific extensions. Typically the application should use the SMTPTransport method supportsExtension to verify that the server supports the desired service extension. See RFC 1869 and other RFCs that define specific extensions.

    Values that are set here will override any of the corresponding value that has been set in the properties.

 public  void setPort(Integer port) 
    Sets the SMTP server port to connect to, if the connect() method doesn't explicitly specify one.

    Defaults to 25.

    Values that are set here will override any of the corresponding value that has been set in the properties.

 public  void setQuitWait(Boolean quitWait) 
    Sets whether the transport will wait for the response to the QUIT command

    If set to true, causes the transport to wait for the response to the QUIT command. If set to false (the default), the QUIT command is sent and the connection is immediately closed.

    Values that are set here will override any of the corresponding value that has been set in the properties.

 public  void setReportSuccess(Boolean reportSuccess) 
    Sets whether the transport will include an SMTPAddressSucceededException for each address that is successful.

    Note also that this will cause a SendFailedException to be thrown from the sendMessage method of SMTPTransport even if all addresses were correct and the message was sent successfully.

    Values that are set here will override any of the corresponding value that has been set in the properties.

 public  void setSaslRealm(String saslRealm) 
    Sets the realm to use with DIGEST-MD5 authentication.

    Values that are set here will override any of the corresponding value that has been set in the properties.

 public  void setSendPartial(Boolean sendPartial) 
    Sets whether to send email to valid addresses when others are invalid.

    If set to true, and a message has some valid and some invalid addresses, send the message anyway, reporting the partial failure with a SendFailedException. If set to false (the default), the message is not sent to any of the recipients if there is an invalid recipient address.

    Values that are set here will override any of the corresponding value that has been set in the properties.

 public  void setSocketFactoryClass(String socketFactoryClass) 
    Sets the class that will be used to create SMTP sockets.

    If set, specifies the name of a class that implements the javax.net.SocketFactory interface. This class will be used to create SMTP sockets.

    Values that are set here will override any of the corresponding value that has been set in the properties.

 public  void setSocketFactoryFallback(Boolean socketFactoryFallback) 
    Sets whether java.net.Socket class will be created if the specified socket factory class cannot be created.

    If set to true, failure to create a socket using the specified socket factory class will cause the socket to be created using the java.net.Socket class. Defaults to true.

    Values that are set here will override any of the corresponding value that has been set in the properties.

 public  void setSocketFactoryPort(Integer socketFactoryPort) 
    Sets the port to connect to when using the specified socket factory.

    Specifies the port to connect to when using the specified socket factory. If not set, the default port will be used.

    Values that are set here will override any of the corresponding value that has been set in the properties.

 public  void setStartTLSEnable(Boolean startTLSEnable) 
    Sets the flag that enables the use of the STARTTLS command (if supported by the server) to switch the connection to a TLS-protected connection before issuing any login commands.

    If true, enables the use of the STARTTLS command (if supported by the server) to switch the connection to a TLS-protected connection before issuing any login commands. Note that an appropriate trust store must configured so that the client will trust the server's certificate. This feature only works on J2SE 1.4 and newer systems. Default is false.

    Values that are set here will override any of the corresponding value that has been set in the properties.

 public  void setSubmitter(String submitter) 
    Sets the submitter to use in the AUTH tag in the MAIL FROM command.

    Typically used by a mail relay to pass along information about the original submitter of the message. See also the setSubmitter method of SMTPMessage. Mail clients typically do not use this.

    Values that are set here will override any of the corresponding value that has been set in the properties.

 public  void setTimeout(Integer timeout) 
    Sets the socket I/O timeout value in milliseconds.

    Default is infinite timeout.

    Values that are set here will override any of the corresponding value that has been set in the properties.