`
sillycat
  • 浏览: 2489864 次
  • 性别: Icon_minigender_1
  • 来自: 成都
社区版块
存档分类
最新评论

Mail Server Solution(2)Camel Test and NodeJS Mailin

 
阅读更多
Mail Server Solution(2)Camel Test and NodeJS Mailin

1. 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-server  smtp-server
https://github.com/andris9/smtp-connection smtp-client
https://github.com/andris9/simplesmtp  deprecated
https://github.com/andris9/mailparser   mail parse
http://mailin.io/  smtp to post server
https://github.com/eleith/emailjs  send 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/
分享到:
评论

相关推荐

    Camel in action(camel实战)

    It then shows you the entire lifecycle and goes in depth on how to test, deal with errors, scale, deploy, and even monitor your app—details you can find only in the Camel code itself. Written by the...

    [Camel实战].(Camel.in.Action).Claus.Ibsen&Jonathan;.Anstey.文字版

    It then shows you the entire lifecycle and goes in depth on how to test, deal with errors, scale, deploy, and even monitor your app—details you can find only in the Camel code itself. Written by the...

    Camel in action PDF和源代码

    Camel in action 一书的PDF电子书 和源代码

    Camel in Action ch1

    2: Routing with Camel - AVAILABLE Part 2 Core Camel 3: Transforming Data with Camel - AVAILABLE 4: Using Beans with Camel - AVAILABLE 5: Error Handling - AVAILABLE 6: Testing with Camel - ...

    Camel in action PDF和源码

    Camel in action 一书的PDF电子书 和源代码 The book is divided into three parts: ■ Part 1—First steps ■ Part 2—Core Camel ■ Part 3—Out in the wild

    camel in action 中文版 第一章

    camel in action 中文版 第一章 费了很大力才找到中文版本,网上现在大多是英文版本的,上传此资粮供大家参考学习。

    camel in action@

    camel in action@

    Mastering.Apache.Camel

    You will then see how components and endpoints handle exchanges in Camel, and how you can use them to create a complete and powerful mediation framework. You will finally learn how to tackle errors ...

    Camel in action

    Camel in action

    Camel.in.Action

    It then shows you the entire lifecycle and goes in depth on how to test, deal with errors, scale, deploy, and even monitor your app—details you can find only in the Camel code itself. Written by the...

    Camel in Action.zip

    Apache Camel 作为集成项目的利器,针对应用集成场景的抽象出了一套消息交互模型,通过组件的方式进行第三方系统的接入,目前Apache Camel已经提供了300多种组件能够接入HTTP,JMS,TCP,WS-*,WebSocket 等多种传输...

    Camel-in-Action-1&amp;2.zip

    满足ETL的开发框架,Camel这个框架产生,用于将数据的处理方式进行流程化,工厂化,从而释放程序猿制造工厂管道的压力,而将中心放到具体业务上,放到具体的业务模块上。第一版的Camel,还没有涉及KS8等云生产品。第...

    Laravel开发-snake2camel

    Laravel开发-snake2camel 用于通过camelcase获取和设置snakecase中模型字段的laravel框架包

    Camel in Action

    Manning - Camel in Action

    camel in action

    camel in cation is a good book

    Camel in action 2nd edition.pdf

    camel in action 第二版,非常适合入门学习camel。camel没有中文书籍,英文书籍也不多。幸亏有camel in action,这一本就足够了。 本来不愿意去阅读英文书籍,英文水平也就考过(接近20年前)英语四级的水平。不过...

    姜宁-我和Apache Camel这些年/Years of Apache Camel and I

    该文档来自阿帕奇2015中国路演。姜宁发表了题为“我和Apache Camel这些年/Years of Apache Camel and I”的主题演讲,欢迎下载!

    Camel_Camel3Camel6函数_

    Camel3 Camel6函数等matlab源代码

Global site tag (gtag.js) - Google Analytics