Skip to content
This repository has been archived by the owner on Sep 7, 2019. It is now read-only.

CONNECT DIRECT MAIL SERVER ISSUE #1582

Open
chitenderkumar opened this issue Jan 21, 2018 · 2 comments
Open

CONNECT DIRECT MAIL SERVER ISSUE #1582

chitenderkumar opened this issue Jan 21, 2018 · 2 comments

Comments

@chitenderkumar
Copy link

we are trying to implement connect with Direct feature. we configured the external and internal mail server as specified in Read.md. when we send direct messages to external mail server, we get below error while connect tries to process it and send it to internal mail server.


2018-01-20 18:31:15,192 ERROR [gov.hhs.fha.nhinc.direct.DirectException] (directScheduler-1) Error sending inbound direct message to smtp edge client.: gov.hhs.fha.nhinc.mail.MailClientException: Exception while sending message.
at gov.hhs.fha.nhinc.mail.SmtpMailSender.send(SmtpMailSender.java:54) [DirectCore-5.0.0.jar:]
at gov.hhs.fha.nhinc.direct.edge.proxy.DirectEdgeProxySmtpImpl.provideAndRegisterDocumentSetB(DirectEdgeProxySmtpImpl.java:58) [DirectCore-5.0.0.jar:]
at gov.hhs.fha.nhinc.direct.messagemonitoring.impl.MessageMonitoringAPI.sendFailedEdgeNotification(MessageMonitoringAPI.java:585) [DirectCore-5.0.0.jar:]
at gov.hhs.fha.nhinc.direct.messagemonitoring.impl.MessageMonitoringAPI.processAllMessages(MessageMonitoringAPI.java:500) [DirectCore-5.0.0.jar:]
at gov.hhs.fha.nhinc.direct.messagemonitoring.impl.MessageMonitoringAPI.process(MessageMonitoringAPI.java:453) [DirectCore-5.0.0.jar:]
at gov.hhs.fha.nhinc.mail.ImapMailReceiver.handleMessageMonitoring(ImapMailReceiver.java:173) [DirectCore-5.0.0.jar:]
at gov.hhs.fha.nhinc.mail.ImapMailReceiver.handleMessages(ImapMailReceiver.java:98) [DirectCore-5.0.0.jar:]
at gov.hhs.fha.nhinc.mail.AbstractMailPoller.poll(AbstractMailPoller.java:56) [DirectCore-5.0.0.jar:]
at sun.reflect.GeneratedMethodAccessor180.invoke(Unknown Source) [:1.8.0_151]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.8.0_151]
at java.lang.reflect.Method.invoke(Method.java:498) [rt.jar:1.8.0_151]
at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:65) [spring-context-4.1.9.RELEASE.jar:4.1.9.RELEASE]
at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54) [spring-context-4.1.9.RELEASE.jar:4.1.9.RELEASE]
at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:81) [spring-context-4.1.9.RELEASE.jar:4.1.9.RELEASE]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [rt.jar:1.8.0_151]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [rt.jar:1.8.0_151]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [rt.jar:1.8.0_151]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [rt.jar:1.8.0_151]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [rt.jar:1.8.0_151]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [rt.jar:1.8.0_151]
at java.lang.Thread.run(Thread.java:748) [rt.jar:1.8.0_151]
Caused by: com.sun.mail.smtp.SMTPSendFailedException: 554 5.5.1 Error: no valid recipients

at com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:2133) [javax.mail-1.5.1.jar:1.5.1]
at com.sun.mail.smtp.SMTPTransport.data(SMTPTransport.java:1899) [javax.mail-1.5.1.jar:1.5.1]
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:1134) [javax.mail-1.5.1.jar:1.5.1]
at gov.hhs.fha.nhinc.mail.MailUtils.sendMessage(MailUtils.java:133) [DirectCore-5.0.0.jar:]
at gov.hhs.fha.nhinc.mail.SmtpMailSender.send(SmtpMailSender.java:52) [DirectCore-5.0.0.jar:]
... 20 more

below are the configurations of direct.mail.external.properties and direct.mail.internal.properties.

direct.mail.external.properties:
`# credentials
connect.mail.user=direct
connect.mail.pass=XXXXXXX

number of direct messages to handle in a batch, can be used to throttle, even out load, and prevent DOS.

connect.max.msgs.in.batch=1

turn on/off java mail session debugging (true/false), set to false in production.

connect.mail.session.debug=true

should unhandled messages be deleted from server?

connect.delete.unhandled.msgs=false

smtp

mail.smtp.host=hartford-connect.innovaccer.com
mail.smtp.auth=true
mail.smtp.port=25
mail.smtp.starttls.enable=true

imap

mail.imaps.host=hartford-connect.innovaccer.com
mail.imaps.port=993`

direct.mail.internal.properties:
`# credentials
connect.mail.user=john
connect.mail.pass=XXXXXXX

number of direct messages to handle in a batch, can be used to throttle, even out load, and prevent DOS.

connect.max.msgs.in.batch=3

turn on/off java mail session debugging (true/false), set to false in production.

connect.mail.session.debug=true

should unhandled messages be deleted from server?

connect.delete.unhandled.msgs=false

smtp

mail.smtp.host=hartford-connect.innovaccer.com
mail.smtp.auth=true
mail.smtp.port=25
mail.smtp.starttls.enable=true

imap

mail.imaps.host=hartford-connect.innovaccer.com
mail.imaps.port=993`

could you please assist us on resolving above mentioned issue.

@sovanncgi
Copy link
Contributor

Hi Chitender, I see you also opened https://connectopensource.atlassian.net/browse/CONN-2029. We will take a look at this.

@chitenderkumar
Copy link
Author

Hi @sovanncgi Thanks for your response. let me explain what we are trying to do.

Objective: we are configuring the CONNECT with Direct profile to exchange the direct messages to remote client through email.

Work Done till Now: we are referring to below git url for reference:

https://github.com/CONNECT-Solution/CONNECT/blob/4.0/Product/Production/Services/DirectCore/README.md

https://connectopensource.atlassian.net/wiki/spaces/CONNECTWIKI/pages/85852259/Admin+GUI+User+Manual

we configured our domain and remote domain in CONNECT ADMIN with below properties.
Source Domain: abc.xyz.com
Source Postmaster Email: [email protected]
SSL CERTS: localhost.cer (SELF SIGNED)

Dstination Domain: xyz.abc.com
Destination Postamaster Email: [email protected]
SSL CERTS: SIGNED BY CA, we added the anchors also in connect Admin gui for the destination domain.

now we created the direct keystore, publickeystore, private keystore and Anchor as mentioned in GIT url and configured it in CONNECT ADMIN GUI/ AGENT SETTINGS in DIRECT CONFIG.

and then we configured the two mail boxes, one external and one internal. Configs are below.

direct.mail.external.properties:
`# credentials
connect.mail.user=direct
connect.mail.pass=XXXXXXX

number of direct messages to handle in a batch, can be used to throttle, even out load, and prevent DOS.
connect.max.msgs.in.batch=1

turn on/off java mail session debugging (true/false), set to false in production.
connect.mail.session.debug=true

should unhandled messages be deleted from server?
connect.delete.unhandled.msgs=false

smtp
mail.smtp.host=hartford-connect.innovaccer.com
mail.smtp.auth=true
mail.smtp.port=25
mail.smtp.starttls.enable=true

imap
mail.imaps.host=hartford-connect.innovaccer.com
mail.imaps.port=993`

direct.mail.internal.properties:
`# credentials
connect.mail.user=john
connect.mail.pass=XXXXXXX

number of direct messages to handle in a batch, can be used to throttle, even out load, and prevent DOS.
connect.max.msgs.in.batch=3

turn on/off java mail session debugging (true/false), set to false in production.
connect.mail.session.debug=true

should unhandled messages be deleted from server?
connect.delete.unhandled.msgs=false

smtp
mail.smtp.host=hartford-connect.innovaccer.com
mail.smtp.auth=true
mail.smtp.port=25
mail.smtp.starttls.enable=true

imap
mail.imaps.host=hartford-connect.innovaccer.com
mail.imaps.port=993`

Testing scenerio: when remote domain xyz.abc.com sending the direct message to source domain abc.xyz.com to external mail box, we are able to receive it. but when Connect processing it we are getting below error:

2018-01-23 19:06:22,380 INFO [gov.hhs.fha.nhinc.event.Log4jEventLogger] (directScheduler-1) DIRECT_ERROR has triggered. It has messageID 1650733761.64458.1516383525183@ip-172-31-38-171.us-west-2.compute.internal, transactionID 1650733761.64458.1516383525183@ip-172-31-38-171.us-west-2.compute.internal and description {"error_msg":"Error occurred while processing message.","sender":"[email protected]","recipient":["[email protected]"],"action":"DIRECT_ERROR","statuses":["error"],"message_id":"1650733761.64458.1516383525183@ip-172-31-38-171.us-west-2.compute.internal","timestamp":"2018-01-23T19:06:22.315+0000"}

2018-01-23 19:06:22,380 ERROR [gov.hhs.fha.nhinc.direct.DirectAdapter] (directScheduler-1) Encounter receiveInbound error Error occurred while processing message.: gov.hhs.fha.nhinc.direct.DirectException: Error occurred while processing message.

    at gov.hhs.fha.nhinc.direct.DirectAdapter.processAsDirectMessage(DirectAdapter.java:126) [DirectCore-5.0.0.jar:]

    at gov.hhs.fha.nhinc.direct.DirectAdapter.process(DirectAdapter.java:85) [DirectCore-5.0.0.jar:]

    at gov.hhs.fha.nhinc.direct.DirectReceiverImpl.receiveInbound(DirectReceiverImpl.java:132) [DirectCore-5.0.0.jar:]

    at gov.hhs.fha.nhinc.direct.DirectInboundMsgHandler.handleMessage(DirectInboundMsgHandler.java:64) [DirectCore-5.0.0.jar:]

    at gov.hhs.fha.nhinc.mail.ImapMailReceiver.handleMessage(ImapMailReceiver.java:120) [DirectCore-5.0.0.jar:]

    at gov.hhs.fha.nhinc.mail.ImapMailReceiver.handleMessages(ImapMailReceiver.java:88) [DirectCore-5.0.0.jar:]

    at gov.hhs.fha.nhinc.mail.AbstractMailPoller.poll(AbstractMailPoller.java:56) [DirectCore-5.0.0.jar:]

    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.8.0_151]

    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [rt.jar:1.8.0_151]

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.8.0_151]

    at java.lang.reflect.Method.invoke(Method.java:498) [rt.jar:1.8.0_151]

    at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:65) [spring-context-4.1.9.RELEASE.jar:4.1.9.RELEASE]

    at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54) [spring-context-4.1.9.RELEASE.jar:4.1.9.RELEASE]

    at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:81) [spring-context-4.1.9.RELEASE.jar:4.1.9.RELEASE]

    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [rt.jar:1.8.0_151]

    at java.util.concurrent.FutureTask.run(FutureTask.java:266) [rt.jar:1.8.0_151]

    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [rt.jar:1.8.0_151]

    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [rt.jar:1.8.0_151]

    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [rt.jar:1.8.0_151]

    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [rt.jar:1.8.0_151]

    at java.lang.Thread.run(Thread.java:748) [rt.jar:1.8.0_151]

Caused by: ERROR=Unknown^M

    at org.nhindirect.gateway.smtp.SmtpAgentFactory.createAgent(SmtpAgentFactory.java:114) [gateway-3.0.1.jar:]

    at org.nhindirect.gateway.smtp.SmtpAgentFactory.createAgent(SmtpAgentFactory.java:59) [gateway-3.0.1.jar:]

    at gov.hhs.fha.nhinc.direct.DirectAdapter.getSmtpAgent(DirectAdapter.java:157) [DirectCore-5.0.0.jar:]

    at gov.hhs.fha.nhinc.direct.DirectAdapter.processAsDirectMessage(DirectAdapter.java:121) [DirectCore-5.0.0.jar:]

    ... 20 more

Caused by: com.google.inject.CreationException: Guice creation errors:

  1. Error in custom provider, ERROR=java.security.UnrecoverableKeyException: Password must not be null^M

at org.nhindirect.stagent.module.PrivateCertStoreModule.configure(PrivateCertStoreModule.java:47)

while locating org.nhindirect.stagent.cert.CertificateResolver annotated with @org.nhindirect.stagent.annotation.PrivateCerts()

for parameter 1 at org.nhindirect.stagent.DefaultNHINDAgent.<init>(DefaultNHINDAgent.java:181)

while locating org.nhindirect.stagent.DefaultNHINDAgent

while locating org.nhindirect.stagent.NHINDAgent

for field at org.nhindirect.gateway.smtp.provider.DefaultSmtpAgentProvider.agent(DefaultSmtpAgentProvider.java:33)

at org.nhindirect.gateway.smtp.module.SmtpAgentModule.configure(SmtpAgentModule.java:46)

1 error

    at com.google.inject.internal.Errors.throwCreationExceptionIfErrorsExist(Errors.java:354) [guice-2.0.jar:]

    at com.google.inject.InjectorBuilder.injectDynamically(InjectorBuilder.java:173) [guice-2.0.jar:]

    at com.google.inject.InjectorBuilder.build(InjectorBuilder.java:113) [guice-2.0.jar:]

    at com.google.inject.Guice.createInjector(Guice.java:92) [guice-2.0.jar:]

    at com.google.inject.Guice.createInjector(Guice.java:69) [guice-2.0.jar:]

    at com.google.inject.Guice.createInjector(Guice.java:59) [guice-2.0.jar:]

    at org.nhindirect.gateway.smtp.config.WSSmtpAgentConfig.buildAgentInjector(WSSmtpAgentConfig.java:232) [gateway-3.0.1.jar:]

    at org.nhindirect.gateway.smtp.config.WSSmtpAgentConfig.getAgentInjector(WSSmtpAgentConfig.java:187) [gateway-3.0.1.jar:]

    at org.nhindirect.gateway.smtp.SmtpAgentFactory.buildAgentInjector(SmtpAgentFactory.java:134) [gateway-3.0.1.jar:]

    at org.nhindirect.gateway.smtp.SmtpAgentFactory.createAgent(SmtpAgentFactory.java:95) [gateway-3.0.1.jar:]

    ... 23 more

Caused by: ERROR=java.security.UnrecoverableKeyException: Password must not be null^M

    at org.nhindirect.stagent.cert.impl.KeyStoreCertificateStore.bootstrapFromFile(KeyStoreCertificateStore.java:247) [agent-2.0.3.jar:]

    at org.nhindirect.stagent.cert.impl.KeyStoreCertificateStore.<init>(KeyStoreCertificateStore.java:116) [agent-2.0.3.jar:]

    at org.nhindirect.stagent.cert.impl.provider.KeyStoreCertificateStoreProvider.get(KeyStoreCertificateStoreProvider.java:45) [agent-2.0.3.jar:]

    at org.nhindirect.stagent.cert.impl.provider.KeyStoreCertificateStoreProvider.get(KeyStoreCertificateStoreProvider.java:30) [agent-2.0.3.jar:]

    at com.google.inject.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:48) [guice-2.0.jar:]

    at com.google.inject.SingleParameterInjector.inject(SingleParameterInjector.java:42) [guice-2.0.jar:]

    at com.google.inject.SingleParameterInjector.getAll(SingleParameterInjector.java:66) [guice-2.0.jar:]

    at com.google.inject.ConstructorInjector.construct(ConstructorInjector.java:84) [guice-2.0.jar:]

    at com.google.inject.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:111) [guice-2.0.jar:]

    at com.google.inject.InjectorImpl$3.get(InjectorImpl.java:549) [guice-2.0.jar:]

    at com.google.inject.SingleFieldInjector.inject(SingleFieldInjector.java:56) [guice-2.0.jar:]

    at com.google.inject.MembersInjectorImpl.injectMembers(MembersInjectorImpl.java:99) [guice-2.0.jar:]

    at com.google.inject.MembersInjectorImpl$1.call(MembersInjectorImpl.java:76) [guice-2.0.jar:]

    at com.google.inject.MembersInjectorImpl$1.call(MembersInjectorImpl.java:74) [guice-2.0.jar:]

    at com.google.inject.InjectorImpl.callInContext(InjectorImpl.java:804) [guice-2.0.jar:]

    at com.google.inject.MembersInjectorImpl.injectAndNotify(MembersInjectorImpl.java:74) [guice-2.0.jar:]

    at com.google.inject.Initializer$InjectableReference.get(Initializer.java:145) [guice-2.0.jar:]

    at com.google.inject.Initializer.injectAll(Initializer.java:92) [guice-2.0.jar:]

    at com.google.inject.InjectorBuilder.injectDynamically(InjectorBuilder.java:171) [guice-2.0.jar:]

    ... 31 more

Request your kind support to resolve above error. Or if you can refer us to some manuals which we can refer. our goal is to send and receive the direct messages by using external and internal mail servers.

looking forward to hear from you soon.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants