Mail Server Solution(2)Camel Test and NodeJS Mailin
Mail Server Solution(2)Camel Test and NodeJS Mailin1. dyn emails
https://help.dyn.com/email-api/
It supports to send email, but not mange incoming emails.
2. Investigate on Camel
I get a project set up in sillycat-camel. It is a very good project, but it seems to me that it does not designed to do that.
Error Message:
Protocol smtp cannot be used for a MailConsumer. Please use another protocol such as pop3 or imap.
Solution:
Camel does not support use smtp as a consumer endpoint.
Some of the idea in camel is really great.
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://camel.apache.org/schema/spring
http://camel.apache.org/schema/spring/camel-spring.xsd
">
<bean id="propertyConfigurer"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="systemPropertiesModeName" value="SYSTEM_PROPERTIES_MODE_OVERRIDE" />
<property name="ignoreResourceNotFound" value="true" />
<property name="locations">
<list>
<value>
classpath*:config.properties
</value>
</list>
</property>
</bean>
<context:annotation-config />
<context:component-scan base-package="com.sillycat">
</context:component-scan>
<!--my lovely spring, long time no see-->
<bean id="testBean" class="com.sillycat.supercamel.TestBeanImpl"/>
<bean id="jmsConnectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory">
<property name="brokerURL" value="vm://localhost?broker.persistent=false" />
</bean>
<bean id="pooledConnectionFactory" class="org.apache.activemq.pool.PooledConnectionFactory"
init-method="start" destroy-method="stop">
<property name="maxConnections" value="8" />
<property name="connectionFactory" ref="jmsConnectionFactory" />
</bean>
<bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate">
<property name="connectionFactory" ref="pooledConnectionFactory" />
</bean>
<bean id="beanProcessor" class="com.sillycat.supercamel.BeanProcessor"/>
<camelContext xmlns="http://camel.apache.org/schema/spring">
<endpoint id="testBeanUriHelloMethod" uri="bean:testBean?method=hello"/>
<route>
<from uri="activemq:queue:start" />
<to ref="testBeanUriHelloMethod" />
<to uri="stream:out" />
</route>
<route>
<from uri="timer:foo?period=1s" />
<from uri="activemq:queue:timer" />
<transform>
<simple>Heartbeat1 ${date:now:yyyy-MM-dd HH:mm:ss}</simple>
</transform>
<to uri="bean:testBean?method=hello" />
<to uri="activemq:queue:in" />
</route>
<route>
<from uri="activemq:queue:in" />
<log message="Route message from inbox to outbox queue with data ${body}" />
<to uri="stream:out" />
</route>
<route>
<from uri="timer:foo?period=1s" />
<process ref="beanProcessor"/>
<to uri="stream:out" />
</route>
</camelContext>
</beans>
SendGrid
We are going to use SendGrid for company.
NodeJS OpenSource Solution
https://github.com/andris9/smtp-serversmtp-server
https://github.com/andris9/smtp-connection smtp-client
https://github.com/andris9/simplesmtpdeprecated
https://github.com/andris9/mailparser mail parse
http://mailin.io/smtp to post server
https://github.com/eleith/emailjssend email
Mailin is using mailparse to parse the email, it supports to fetch the attachment files. Then it depends on simplesmtp to handle the smtp server side protocol. Then it post the form with the attachment to the URL you provide there.
Try to Install mailing on my raspberry
> node --version
v0.12.1
> python --version
Python 2.7.3
> sudo apt-get install spamassassin
> sudo vi /etc/default/spamassassin
ENABLED=1
Install the mailin server
> sudo npm install -g mailin
I am using HTTP mock Server
http://requestb.in/zye6onzy
Start the SMTP Server
> sudo mailin --webhook http://requestb.in/zye6onzy
References:
http://camel.apache.org/
http://camel.apache.org/components.html
https://github.com/rmortale/EmailService
http://camel.apache.org/mail.html
http://raising.iteye.com/blog/2223900
https://github.com/normanmaurer/camel-smtp
http://examples.javacodegeeks.com/enterprise-java/apache-camel/apache-camel-spring-example/
页:
[1]