Package org.apache.camel.component.mail
Class MailConfiguration
- java.lang.Object
- 
- org.apache.camel.component.mail.MailConfiguration
 
- 
- 
Constructor SummaryConstructors Constructor Description MailConfiguration()MailConfiguration(org.apache.camel.CamelContext context)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconfigure(URI uri)voidconfigureProtocol(String protocol)The protocol for communicating with the mail serverMailConfigurationcopy()Returns a copy of this configurationprotected JavaMailSendercreateJavaMailSender()PropertiesgetAdditionalJavaMailProperties()StringgetAlternativeBodyHeader()AttachmentsContentTransferEncodingResolvergetAttachmentsContentTransferEncodingResolver()MailAuthenticatorgetAuthenticator()StringgetBcc()StringgetCc()longgetConnectionTimeout()StringgetContentType()StringgetCopyTo()intgetFetchSize()StringgetFolderName()StringgetFrom()StringgetHost()PropertiesgetJavaMailProperties()JavaMailSendergetJavaMailSender()StringgetMailStoreLogInformation()StringgetMoveTo()StringgetPassword()javax.mail.PasswordAuthenticationgetPasswordAuthentication()Returns the password authentication from the authenticator or from the parameters user and password.intgetPort()StringgetProtocol()Map<javax.mail.Message.RecipientType,String>getRecipients()StringgetReplyTo()javax.mail.SessiongetSession()org.apache.camel.support.jsse.SSLContextParametersgetSslContextParameters()StringgetSubject()StringgetTo()StringgetUsername()booleanisCloseFolder()booleanisDebugMode()booleanisDecodeFilename()booleanisDelete()booleanisDisconnect()booleanisHandleFailedMessage()booleanisIgnoreUnsupportedCharset()booleanisIgnoreUriScheme()booleanisMapMailMessage()booleanisMimeDecodeHeaders()booleanisPeek()booleanisSecureProtocol()Is the used protocol to be secure or notbooleanisSkipFailedMessage()booleanisStartTlsEnabled()booleanisUnseen()booleanisUseInlineAttachments()voidsetAdditionalJavaMailProperties(Properties additionalJavaMailProperties)Sets additional java mail properties, that will append/override any default properties that is set based on all the other options.voidsetAlternativeBodyHeader(String alternativeBodyHeader)Specifies the key to an IN message header that contains an alternative email body.voidsetAttachmentsContentTransferEncodingResolver(AttachmentsContentTransferEncodingResolver attachmentsContentTransferEncodingResolver)To use a custom AttachmentsContentTransferEncodingResolver to resolve what content-type-encoding to use for attachments.voidsetAuthenticator(MailAuthenticator authenticator)The authenticator for login.voidsetBcc(String address)Sets the BCC email address.voidsetCc(String address)Sets the CC email address.voidsetCloseFolder(boolean closeFolder)Whether the consumer should close the folder after polling.voidsetConnectionTimeout(int connectionTimeout)The connection timeout in milliseconds.voidsetContentType(String contentType)The mail message content type.voidsetCopyTo(String copyTo)After processing a mail message, it can be copied to a mail folder with the given name.voidsetDebugMode(boolean debugMode)Enable debug mode on the underlying mail framework.voidsetDecodeFilename(boolean decodeFilename)If set to true, the MimeUtility.decodeText method will be used to decode the filename.voidsetDelete(boolean delete)Deletes the messages after they have been processed.voidsetDisconnect(boolean disconnect)Whether the consumer should disconnect after polling.voidsetFetchSize(int fetchSize)Sets the maximum number of messages to consume during a poll.voidsetFolderName(String folderName)The folder to poll.voidsetFrom(String from)The from email addressvoidsetHandleFailedMessage(boolean handleFailedMessage)If the mail consumer cannot retrieve a given mail message, then this option allows to handle the caused exception by the consumer's error handler.voidsetHost(String host)The mail server host namevoidsetIgnoreUnsupportedCharset(boolean ignoreUnsupportedCharset)Option to let Camel ignore unsupported charset in the local JVM when sending mails.voidsetIgnoreUriScheme(boolean ignoreUriScheme)Option to let Camel ignore unsupported charset in the local JVM when sending mails.voidsetJavaMailProperties(Properties javaMailProperties)Sets the java mail options.voidsetJavaMailSender(JavaMailSender javaMailSender)To use a customJavaMailSenderfor sending emails.voidsetMapMailMessage(boolean mapMailMessage)Specifies whether Camel should map the received mail message to Camel body/headers/attachments.voidsetMimeDecodeHeaders(boolean mimeDecodeHeaders)This option enables transparent MIME decoding and unfolding for mail headers.voidsetMoveTo(String moveTo)After processing a mail message, it can be moved to a mail folder with the given name.voidsetPassword(String password)The password for login.voidsetPeek(boolean peek)Will mark the javax.mail.Message as peeked before processing the mail message.voidsetPort(int port)The port number of the mail servervoidsetReplyTo(String replyTo)The Reply-To recipients (the receivers of the response mail).voidsetSession(javax.mail.Session session)Specifies the mail session that camel should use for all mail interactions.voidsetSkipFailedMessage(boolean skipFailedMessage)If the mail consumer cannot retrieve a given mail message, then this option allows to skip the message and move on to retrieve the next mail message.voidsetSslContextParameters(org.apache.camel.support.jsse.SSLContextParameters sslContextParameters)To configure security using SSLContextParameters.voidsetSubject(String subject)The Subject of the message being sent.voidsetTo(String address)Sets the To email address.voidsetUnseen(boolean unseen)Whether to limit by unseen mails only.voidsetUseInlineAttachments(boolean useInlineAttachments)Whether to use disposition inline or attachment.voidsetUsername(String username)The username for login.
 
- 
- 
- 
Method Detail- 
copypublic MailConfiguration copy() Returns a copy of this configuration
 - 
configurepublic void configure(URI uri) 
 - 
createJavaMailSenderprotected JavaMailSender createJavaMailSender() 
 - 
getPasswordAuthenticationpublic javax.mail.PasswordAuthentication getPasswordAuthentication() Returns the password authentication from the authenticator or from the parameters user and password.
 - 
isSecureProtocolpublic boolean isSecureProtocol() Is the used protocol to be secure or not
 - 
isStartTlsEnabledpublic boolean isStartTlsEnabled() 
 - 
getMailStoreLogInformationpublic String getMailStoreLogInformation() 
 - 
getJavaMailSenderpublic JavaMailSender getJavaMailSender() 
 - 
setJavaMailSenderpublic void setJavaMailSender(JavaMailSender javaMailSender) To use a customJavaMailSenderfor sending emails.
 - 
getHostpublic String getHost() 
 - 
setHostpublic void setHost(String host) The mail server host name
 - 
getJavaMailPropertiespublic Properties getJavaMailProperties() 
 - 
setJavaMailPropertiespublic void setJavaMailProperties(Properties javaMailProperties) Sets the java mail options. Will clear any default properties and only use the properties provided for this method.
 - 
getAdditionalJavaMailPropertiespublic Properties getAdditionalJavaMailProperties() 
 - 
setAdditionalJavaMailPropertiespublic void setAdditionalJavaMailProperties(Properties additionalJavaMailProperties) Sets additional java mail properties, that will append/override any default properties that is set based on all the other options. This is useful if you need to add some special options but want to keep the others as is.
 - 
getPasswordpublic String getPassword() 
 - 
setPasswordpublic void setPassword(String password) The password for login. See alsosetAuthenticator(MailAuthenticator).
 - 
getAuthenticatorpublic MailAuthenticator getAuthenticator() 
 - 
setAuthenticatorpublic void setAuthenticator(MailAuthenticator authenticator) The authenticator for login. If set then thepasswordandusernameare ignored. Can be used for tokens which can expire and therefore must be read dynamically.
 - 
getSubjectpublic String getSubject() 
 - 
setSubjectpublic void setSubject(String subject) The Subject of the message being sent. Note: Setting the subject in the header takes precedence over this option.
 - 
getPortpublic int getPort() 
 - 
setPortpublic void setPort(int port) The port number of the mail server
 - 
getProtocolpublic String getProtocol() 
 - 
configureProtocolpublic void configureProtocol(String protocol) The protocol for communicating with the mail server
 - 
getSessionpublic javax.mail.Session getSession() 
 - 
setSessionpublic void setSession(javax.mail.Session session) Specifies the mail session that camel should use for all mail interactions. Useful in scenarios where mail sessions are created and managed by some other resource, such as a JavaEE container. When using a custom mail session, then the hostname and port from the mail session will be used (if configured on the session).
 - 
getUsernamepublic String getUsername() 
 - 
setUsernamepublic void setUsername(String username) The username for login. See alsosetAuthenticator(MailAuthenticator).
 - 
getFrompublic String getFrom() 
 - 
setFrompublic void setFrom(String from) The from email address
 - 
isDeletepublic boolean isDelete() 
 - 
setDeletepublic void setDelete(boolean delete) Deletes the messages after they have been processed. This is done by setting the DELETED flag on the mail message. If false, the SEEN flag is set instead. As of Camel 2.10 you can override this configuration option by setting a header with the key delete to determine if the mail should be deleted or not.
 - 
isMapMailMessagepublic boolean isMapMailMessage() 
 - 
setMapMailMessagepublic void setMapMailMessage(boolean mapMailMessage) Specifies whether Camel should map the received mail message to Camel body/headers/attachments. If set to true, the body of the mail message is mapped to the body of the Camel IN message, the mail headers are mapped to IN headers, and the attachments to Camel IN attachment message. If this option is set to false then the IN message contains a raw javax.mail.Message. You can retrieve this raw message by calling exchange.getIn().getBody(javax.mail.Message.class).
 - 
getFolderNamepublic String getFolderName() 
 - 
setFolderNamepublic void setFolderName(String folderName) The folder to poll.
 - 
isIgnoreUriSchemepublic boolean isIgnoreUriScheme() 
 - 
setIgnoreUriSchemepublic void setIgnoreUriScheme(boolean ignoreUriScheme) Option to let Camel ignore unsupported charset in the local JVM when sending mails. If the charset is unsupported then charset=XXX (where XXX represents the unsupported charset) is removed from the content-type and it relies on the platform default instead.
 - 
isUnseenpublic boolean isUnseen() 
 - 
setUnseenpublic void setUnseen(boolean unseen) Whether to limit by unseen mails only.
 - 
setTopublic void setTo(String address) Sets the To email address. Separate multiple email addresses with comma.
 - 
getTopublic String getTo() 
 - 
setCcpublic void setCc(String address) Sets the CC email address. Separate multiple email addresses with comma.
 - 
getCcpublic String getCc() 
 - 
setBccpublic void setBcc(String address) Sets the BCC email address. Separate multiple email addresses with comma.
 - 
getBccpublic String getBcc() 
 - 
getReplyTopublic String getReplyTo() 
 - 
setReplyTopublic void setReplyTo(String replyTo) The Reply-To recipients (the receivers of the response mail). Separate multiple email addresses with a comma.
 - 
getFetchSizepublic int getFetchSize() 
 - 
setFetchSizepublic void setFetchSize(int fetchSize) Sets the maximum number of messages to consume during a poll. This can be used to avoid overloading a mail server, if a mailbox folder contains a lot of messages. Default value of -1 means no fetch size and all messages will be consumed. Setting the value to 0 is a special corner case, where Camel will not consume any messages at all.
 - 
isDebugModepublic boolean isDebugMode() 
 - 
setDebugModepublic void setDebugMode(boolean debugMode) Enable debug mode on the underlying mail framework. The SUN Mail framework logs the debug messages to System.out by default.
 - 
getConnectionTimeoutpublic long getConnectionTimeout() 
 - 
setConnectionTimeoutpublic void setConnectionTimeout(int connectionTimeout) The connection timeout in milliseconds.
 - 
getContentTypepublic String getContentType() 
 - 
setContentTypepublic void setContentType(String contentType) The mail message content type. Use text/html for HTML mails.
 - 
getAlternativeBodyHeaderpublic String getAlternativeBodyHeader() 
 - 
setAlternativeBodyHeaderpublic void setAlternativeBodyHeader(String alternativeBodyHeader) Specifies the key to an IN message header that contains an alternative email body. For example, if you send emails in text/html format and want to provide an alternative mail body for non-HTML email clients, set the alternative mail body with this key as a header.
 - 
isUseInlineAttachmentspublic boolean isUseInlineAttachments() 
 - 
setUseInlineAttachmentspublic void setUseInlineAttachments(boolean useInlineAttachments) Whether to use disposition inline or attachment.
 - 
isIgnoreUnsupportedCharsetpublic boolean isIgnoreUnsupportedCharset() 
 - 
setIgnoreUnsupportedCharsetpublic void setIgnoreUnsupportedCharset(boolean ignoreUnsupportedCharset) Option to let Camel ignore unsupported charset in the local JVM when sending mails. If the charset is unsupported then charset=XXX (where XXX represents the unsupported charset) is removed from the content-type and it relies on the platform default instead.
 - 
isDisconnectpublic boolean isDisconnect() 
 - 
setDisconnectpublic void setDisconnect(boolean disconnect) Whether the consumer should disconnect after polling. If enabled this forces Camel to connect on each poll.
 - 
isCloseFolderpublic boolean isCloseFolder() 
 - 
setCloseFolderpublic void setCloseFolder(boolean closeFolder) Whether the consumer should close the folder after polling. Setting this option to false and having disconnect=false as well, then the consumer keep the folder open between polls.
 - 
getSslContextParameterspublic org.apache.camel.support.jsse.SSLContextParameters getSslContextParameters() 
 - 
setSslContextParameterspublic void setSslContextParameters(org.apache.camel.support.jsse.SSLContextParameters sslContextParameters) To configure security using SSLContextParameters.
 - 
getCopyTopublic String getCopyTo() 
 - 
getMoveTopublic String getMoveTo() 
 - 
setMoveTopublic void setMoveTo(String moveTo) After processing a mail message, it can be moved to a mail folder with the given name. You can override this configuration value, with a header with the key moveTo, allowing you to move messages to folder names configured at runtime.
 - 
setCopyTopublic void setCopyTo(String copyTo) After processing a mail message, it can be copied to a mail folder with the given name. You can override this configuration value, with a header with the key copyTo, allowing you to copy messages to folder names configured at runtime.
 - 
isPeekpublic boolean isPeek() 
 - 
setPeekpublic void setPeek(boolean peek) Will mark the javax.mail.Message as peeked before processing the mail message. This applies to IMAPMessage messages types only. By using peek the mail will not be eager marked as SEEN on the mail server, which allows us to rollback the mail message if there is an error processing in Camel.
 - 
isSkipFailedMessagepublic boolean isSkipFailedMessage() 
 - 
setSkipFailedMessagepublic void setSkipFailedMessage(boolean skipFailedMessage) If the mail consumer cannot retrieve a given mail message, then this option allows to skip the message and move on to retrieve the next mail message. The default behavior would be the consumer throws an exception and no mails from the batch would be able to be routed by Camel.
 - 
isHandleFailedMessagepublic boolean isHandleFailedMessage() 
 - 
setHandleFailedMessagepublic void setHandleFailedMessage(boolean handleFailedMessage) If the mail consumer cannot retrieve a given mail message, then this option allows to handle the caused exception by the consumer's error handler. By enable the bridge error handler on the consumer, then the Camel routing error handler can handle the exception instead. The default behavior would be the consumer throws an exception and no mails from the batch would be able to be routed by Camel.
 - 
getAttachmentsContentTransferEncodingResolverpublic AttachmentsContentTransferEncodingResolver getAttachmentsContentTransferEncodingResolver() 
 - 
setAttachmentsContentTransferEncodingResolverpublic void setAttachmentsContentTransferEncodingResolver(AttachmentsContentTransferEncodingResolver attachmentsContentTransferEncodingResolver) To use a custom AttachmentsContentTransferEncodingResolver to resolve what content-type-encoding to use for attachments.
 - 
setMimeDecodeHeaderspublic void setMimeDecodeHeaders(boolean mimeDecodeHeaders) This option enables transparent MIME decoding and unfolding for mail headers.
 - 
isMimeDecodeHeaderspublic boolean isMimeDecodeHeaders() 
 - 
isDecodeFilenamepublic boolean isDecodeFilename() 
 - 
setDecodeFilenamepublic void setDecodeFilename(boolean decodeFilename) If set to true, the MimeUtility.decodeText method will be used to decode the filename. This is similar to setting JVM system property mail.mime.encodefilename.
 
- 
 
-