Camel Mail binding
splatch Nov 16, 2012 8:28 AMI just submited pull requests for camel-mail binding. It's based on camel-mail component.
Example configuration for mail receiver/poller. It's based on ScheduledBatchPollConsumer.
<sca:service name="camelTest" promote="SimpleCamelService"> <camel:binding.mail secure="true"> <camel:host>localhost</camel:host> <camel:port>233</camel:port> <camel:username>camel</camel:username> <camel:password>rider</camel:password> <camel:connectionTimeout>300</camel:connectionTimeout> <camel:consume accountType="pop3"> <camel:folderName>Mail/Inbox</camel:folderName> <camel:fetchSize>10</camel:fetchSize> <camel:unseen>false</camel:unseen> <camel:delete>true</camel:delete> <camel:copyTo>SEEN</camel:copyTo> <camel:disconnect>true</camel:disconnect> </camel:consume> </camel:binding.mail> </sca:service>
Example configuration for sender/producer.
<sca:reference name="mail" multiplicity="0..1" promote="mailTest"> <camel:binding.mail secure="true"> <camel:host>localhost</camel:host> <camel:port>233</camel:port> <camel:username>camel</camel:username> <camel:password>rider</camel:password> <camel:connectionTimeout>300</camel:connectionTimeout> <camel:produce> <camel:subject>Desert ride</camel:subject> <camel:from>rider@camel</camel:from> <camel:to>camel@rider</camel:to> <camel:CC>mule@rider</camel:CC> <camel:BCC>rider@mule</camel:BCC> <camel:replyTo>camel@camel</camel:replyTo> </camel:produce> </camel:binding.mail> </sca:reference>
Detailed description of parameters can be found in camel documentation. What's really important - that protocol used by binding is determined using parent element. If parent element is reference then component will use SMTP (or smtps if secure flag is set for binding.mail). If parent element is service then pop3/imap protocol is used. Only one mandatory field in all cases is hostname.