Moqui - 通过SSL连接连接到IMAP服务器?

时间:2015-10-27 12:35:07

标签: email ssl imap moqui

我正在尝试在Moqui 1.5.4中轮询电子邮件服务器。我正在使用org.moqui.impl.EmailServices.poll #EmailServer来自'工具'应用

电子邮件服务器的设置如下:

<moqui.basic.email.EmailServer emailServerId="testEmail" mailUsername="test.account@xxxxxxx.ie" mailPassword="xxxxxxxx" smtpHost="" smtpPort="" smtpSsl="" storeHost="Webmail8.xxxxxxxxxxx.ie" storePort="993" storeProtocol="imap" storeDelete="N" />

所有条目,密码都已在Outlook上测试过,并且没有问题连接到服务器。

我收到了javax.mail.AuthenticationFailedException。

其他信息:

在初步测试中,我收到以下错误消息,因此我删除了静态&#39;代码中指示行的修饰符。 (我不确定这是否是一个问题,或者我是否做错了什么。)

--- 98330    [ndlerThread[15]] WARN moqui.impl.context.TransactionFacadeImpl                                                     
 Transaction rollback. The rollback was originally caused by: startup failed:                                                     
classpath_//org/moqui/impl/pollEmailServer_groovy: 28: Modifier 'static' not allowed here.                                        
 @ line 28, column 1.                                                                                                             
   final static Logger logger = LoggerFactory.getLogger("org.moqui.impl.pollEmailServer")                                         

我试图查看是否可以解决问题的一些内容包括:

  • 设置storeProtocol =&#34; imaps&#34;
  • 包括EmailServer条目中的smtp详细信息(注意我只需要轮询,而不是发送邮件)。
  • 将以下行添加到pollEmailServer.groovy(查看了com.sun.mail.imap包)。

    sessionProperties.put("mail.imap.ssl.enable", true)

完整身份验证失败错误消息为:

运行服务时出错[org.moqui.impl.EmailServices.poll#EmailServer](Throwable)
javax.mail.AuthenticationFailedException
        在javax.mail.Service.connect(Service.java:306)
        在javax.mail.Service.connect(Service.java:156)
        在javax.mail.Service.connect(Service.java:105)
        at pollEmailServer_groovy.run(pollEmailServer_groovy:47)
        在org.moqui.impl.context.runner.GroovyScriptRunner.run(GroovyScriptRunner.groovy:50)
        在org.moqui.impl.context.ResourceFacadeImpl.script(ResourceFacadeImpl.groovy:337)
        在org.moqui.impl.service.runner.ScriptServiceRunner.runService(ScriptServiceRunner.groovy:49)
        在org.moqui.impl.service.ServiceCallSyncImpl.callSingle(ServiceCallSyncImpl.groovy:260)
        在org.moqui.impl.service.ServiceCallSyncImpl.call(ServiceCallSyncImpl.groovy:137)
        在ServiceRun_xml_transition_run_actions.run(ServiceRun_xml_transition_run_actions:10)
        在org.moqui.impl.actions.XmlAction.run(XmlAction.groovy:99)
        在org.moqui.impl.screen.ScreenDefinition $ TransitionItem.run(ScreenDefinition.groovy:659)
        在org.moqui.impl.screen.ScreenRenderImpl.recursiveRunTransition(ScreenRenderImpl.groovy:223)
        在org.moqui.impl.screen.ScreenRenderImpl.recursiveRunTransition(ScreenRenderImpl.groovy:217)
        在org.moqui.impl.screen.ScreenRenderImpl.recursiveRunTransition(ScreenRenderImpl.groovy:217)
        在org.moqui.impl.screen.ScreenRenderImpl.recursiveRunTransition(ScreenRenderImpl.groovy:217)
        在org.moqui.impl.screen.ScreenRenderImpl.recursiveRunTransition(ScreenRenderImpl.groovy:217)
        在org.moqui.impl.screen.ScreenRenderImpl.internalRender(ScreenRenderImpl.groovy:301)
        在org.moqui.impl.screen.ScreenRenderImpl.render(ScreenRenderImpl.groovy:164)
        在org.moqui.impl.webapp.MoquiServlet.doScreenRequest(MoquiServlet.groovy:71)
        在org.moqui.impl.webapp.MoquiServlet.doPost(MoquiServlet.groovy:37)
        在javax.servlet.http.HttpServlet.service(HttpServlet.java:713)
        在javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
        在net.winstone.core.ServletCotion.execute(ServletConfiguration.java:270)
        at net.winstone.core.SimpleRequestDispatcher.forward(SimpleRequestDispatcher.java:290)
        at net.winstone.core.listener.RequestHandlerThread.processRequest(RequestHandlerThread.java:212)
        在net.winstone.core.listener.RequestHandlerThread.run(RequestHandlerThread.java:143)
        at java.util.concurrent.Executors $ RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at net.winstone.util.BoundedExecutorService $ 1.run(BoundedExecutorService.java:81)
        在java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:617)
        在java.lang.Thread.run(Thread.java:745)

附录:使用电子邮件ECA规则进行轮询后处理邮件。

我可以看到,当我在EmailEcaRule.groovy中打开记录器信息时,我的电子邮件ECA中的条件一直在评估为“假”&#39;。但它不应该是吗?

======== EMECA Process Received Email conditionPassed? false My condition: TestEmail fields: 

(注意我在记录器信息中插入&#34;我的条件:$ {fields.subject}&#34;以仔细检查我的条件表达式是否应该如此。)

我的emeca是:

<emecas xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://moqui.org/xsd/email-eca-1.5.xsd">
  <emeca rule-name="Process Received Email">
    <condition><expression>fields.subject == 'TestEmail'</expression></condition>
    <actions>
        <service-call name="org.moqui.impl.EmailServices.save#EcaEmailMessage" />
    </actions>
  </emeca>
</emecas>

我已经测试并重新测试了这个。我不知道为什么评价为假。如果需要任何其他信息,请与我们联系。

解决这个问题仍然没有运气。我一定是在做一些愚蠢的事。我在EmailEcaRule.groovy中注释掉if(conditionPassed){}以绕过我在电子邮件ECA规则中的条件而只是运行该操作,但现在它被挂起了&#34;无法在null对象上调用方法get() #34; org.moqui.impl.EmailServices.save#EcaEmailMessage中的错误,大概是在headers.get(&#39; message-id&#39;)上。但我可以在日志信息中看到消息Id在头信息中,并成功转换为小写。

1 个答案:

答案 0 :(得分:0)

这有一些问题。首先是Moqui使用旧版本的JavaMail(现在更新为1.5.4)。另一个是密码是如何通过的,更普遍的是,poll#EmailServer服务的脚本如何使用JavaMail API还有很大的改进空间。

提交#bf0f872有各种各样的变化。我能够使用storeProtocol = imaps,storePort = 993等成功连接

回答你的问题:如果没有这些代码更改,我认为不可能通过SSL进行连接。换句话说,这最终成为一个错误报告,而不是一个问题。

相关问题