`
sillycat
  • 浏览: 2551235 次
  • 性别: 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实战)

    对于任何希望在 Java 平台上构建集成解决方案的开发者来说,《Camel in Action》都是一本不可多得的好书。通过本书的学习,读者不仅能够掌握 Camel 的基础知识,还能深入了解如何利用 Camel 解决实际问题,进而成为...

    Camel in action PDF和源代码

    《Camel in Action》是关于Apache Camel这一企业级集成框架的专业书籍,这本书深入浅出地讲解了如何使用Camel构建高效、可维护的集成解决方案。PDF版本提供了方便的电子阅读体验,而源代码则帮助读者更好地理解书中...

    camel in action 中文版 第一章

    " Camel In Action 中文版第一章知识点" 本章节将对 Camel 框架进行介绍, Camel 是一个开源的一体化框架,其目的是使一体化系统更容易。本书的第一章节我们将介绍 Camel 及展示它适合大企事业单位的软件。你将会...

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

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

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

    - **Akka与Camel (Akka and Camel)**:探讨了如何将Akka与Camel结合使用,以实现更高级别的并发和分布式计算。 综上所述,《Camel实战》这本书由Camel的开发者亲自编写,旨在帮助读者深入理解并掌握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》是一本深入探讨Apache Camel框架的专业书籍,该书主要针对那些希望利用企业集成模式(Enterprise Integration Patterns)来构建可扩展且灵活的企业级应用的开发人员。Apache Camel是一个流行的...

    Camel in Action

    ### Camel in Action:核心概念与应用实践 #### 核心知识点概述 《Camel in Action》是一本关于Apache Camel框架的权威指南,本书由Claud Bensen和Jonathan Anstey共同编写,Manning出版社出版。本书全面介绍了...

    Camel in Action ch1

    ### Camel in Action – Chapter 1: Meet Camel #### 一、引言 《Camel in Action》这本书旨在为读者提供Apache Camel框架的深入理解和实践指南。本书分为三个部分:第一部分介绍初学者需要了解的基本概念;第二...

    Camel.in.Action

    Camel in Action是一本由Camel框架的开发者编写的教程书,其中包含了许多小示例,展示了如何使用集成模式。 书籍内容涵盖了从核心概念开始,比如发送、接收、路由和转换数据。然后,它介绍了整个应用的生命周期,并...

    Camel in action

    ### Camel in Action:深入解析与应用实践 #### 一、简介与背景 《Camel in Action》是一本全面介绍Apache Camel框架的专业书籍,由Claud Bensen和Jonathan Anstey共同编写,Manning出版社出版。本书是Apache ...

    Camel in Action.zip

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

    Manning.Camel.in.Action

    《Manning.Camel.in.Action》一书由Claus Ibsen和Jonathan Anstey共同撰写,是Manning Publications出版的一部深入探讨Apache Camel框架的专业书籍。本书不仅为读者提供了全面的理论知识,还包含了丰富的实践指导,...

    camel-manual-2.0

    Apache Camel 2.0 is an advanced integration framework that implements Enterprise Integration Patterns (EIP) in a robust and flexible manner. This powerful tool is based on the Spring framework and ...

    camel in action

    《camel in action》是一本关于Apache Camel框架的编程书籍,由Manning Publications出版社出版。本书适合Java开发者,特别是那些需要在企业环境中处理系统集成问题的开发者。通过学习本书,读者可以掌握如何使用...

    Camel_Camel3Camel6函数_

    在MATLAB编程环境中,"Camel3Camel6函数"是指用于特定数学计算或数据分析的一系列函数。这些函数可能涉及到曲线拟合、数值优化、数据处理等应用,尤其是在处理涉及非线性问题时,比如模拟生物体的驼峰形状、物理学中...

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

    Apache Camel是Apache软件基金会下的一个开源集成框架,它实现了企业集成模式(Enterprise Integration Patterns,EIP),旨在简化在企业中的应用程序、系统和服务之间的集成工作。Camel支持多种传输协议,如HTTP、...

Global site tag (gtag.js) - Google Analytics