Unable to start the Alfresco Email Subsystem

cancel
Showing results for 
Search instead for 
Did you mean: 
Active Member

Unable to start the Alfresco Email Subsystem

Dear All,

We are not able to start the alfresco email subsystem as we are using the default SMTP port 25.

During the alfresco service start-up we are getting the below attached errors, Kindly check and advice on this.

As we cannot start the alfresco services via root id, Do we have any option to start only email service via root id.

# Outbound Email Configuration
mail.host=XXXXXXXXXXXX
mail.port=25
mail.encoding=UTF-8
mail.from.default=XXXXXXXXXXXX
mail.smtp.auth=false

#Inbound Email Configuration
email.inbound.enabled=true
email.server.enabled=true
email.server.port=25
email.server.domain=XXXXXXXXXXXX

Error log message. :-

2017-10-05 16:24:28,423 INFO  [org.alfresco.repo.management.subsystems.ChildApplicationContextFactory] [localhost-startStop-1] Starting 'email' subsystem, ID: [email, inbound]
2017-10-05 16:24:28,501 WARN  [org.alfresco.repo.management.subsystems.ChildApplicationContextFactory] [localhost-startStop-1] Startup of 'email' subsystem, ID: [email, inbound] failed
java.lang.RuntimeException: java.net.BindException: Permission denied (Bind failed)
    at org.subethamail.smtp.server.SMTPServer.start(SMTPServer.java:292)
    at org.alfresco.email.server.impl.subetha.SubethaEmailServer.startup(SubethaEmailServer.java:90)
    at org.alfresco.email.server.EmailServer.onBootstrap(EmailServer.java:289)
    at org.springframework.extensions.surf.util.AbstractLifecycleBean.onApplicationEvent(AbstractLifecycleBean.java:56)
    at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:96)
    at org.alfresco.repo.management.subsystems.ChildApplicationContextFactory$ChildApplicationContext.publishEvent(ChildApplicationContextFactory.java:569)
    at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:954)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)
    at org.alfresco.repo.management.subsystems.ChildApplicationContextFactory$ApplicationContextState.start(ChildApplicationContextFactory.java:824)
    at org.alfresco.repo.management.subsystems.AbstractPropertyBackedBean.start(AbstractPropertyBackedBean.java:1098)
    at org.alfresco.repo.management.subsystems.AbstractPropertyBackedBean.onApplicationEvent(AbstractPropertyBackedBean.java:637)
    at org.alfresco.repo.management.SafeApplicationEventMulticaster.multicastEventInternal(SafeApplicationEventMulticaster.java:214)
    at org.alfresco.repo.management.SafeApplicationEventMulticaster.multicastEvent(SafeApplicationEventMulticaster.java:185)
    at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:334)
    at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:954)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)
    at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:410)
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
    at org.alfresco.web.app.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:70)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5118)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5634)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
    at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:679)
    at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1966)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:748)
Caused by: java.net.BindException: Permission denied (Bind failed)
    at java.net.PlainSocketImpl.socketBind(Native Method)
    at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:387)
    at java.net.ServerSocket.bind(ServerSocket.java:375)
    at org.subethamail.smtp.server.SMTPServer.createServerSocket(SMTPServer.java:334)
    at org.subethamail.smtp.server.SMTPServer.start(SMTPServer.java:288)
    ... 32 more

5 Replies
Master

Re: Unable to start the Alfresco Email Subsystem

You cannot bind on the privileged port 25. You must specify a different port for the inbound email server and use NAT tools like iptables to redirect incomming traffic.

Active Member

Re: Unable to start the Alfresco Email Subsystem

Thanks for an advice.

I tried changing the default port from 25 to 1025, After port changing we are able to start the service ..but while sending email received the below mention mail server connection time out errors.

fyi..

Added the below mention IP NAT.

iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 25 -j REDIRECT --to-port 1025

Failed to send email to [ganesh.batwal] : org.springframework.mail.MailSendException: Mail server connection failed; nested exception is com.sun.mail.util.MailConnectException: Couldn't connect to host, port: mailapp.jetairways.com, 1025; timeout -1;
  nested exception is:
    java.net.ConnectException: Connection timed out (Connection timed out). Failed messages: com.sun.mail.util.MailConnectException: Couldn't connect to host, port: mailapp.jetairways.com, 1025; timeout -1;
  nested exception is:
    java.net.ConnectException: Connection timed out (Connection timed out); message exceptions (1) are:
Failed message 1: com.sun.mail.util.MailConnectException: Couldn't connect to host, port: mailapp.jetairways.com, 1025; timeout -1;
  nested exception is:
    java.net.ConnectException: Connection timed out (Connection timed out)
2017-10-05 15:49:50,009 ERROR [org.alfresco.repo.action.executer.MailActionExecuter] [mailAsyncAction3] Failed to send email to [ganesh.batwal] : org.springframework.mail.MailSendException: Mail server connection failed; nested exception is com.sun.mail.util.MailConnectException: Couldn't connect to host, port: mailapp.jetairways.com, 1025; timeout -1;
  nested exception is:
    java.net.ConnectException: Connection timed out (Connection timed out). Failed messages: com.sun.mail.util.MailConnectException: Couldn't connect to host, port: mailapp.jetairways.com, 1025; timeout -1;
  nested exception is:
    java.net.ConnectException: Connection timed out (Connection timed out); message exceptions (1) are:
Failed message 1: com.sun.mail.util.MailConnectException: Couldn't connect to host, port: mailapp.jetairways.com, 1025; timeout -1;
  nested exception is:
    java.net.ConnectException: Connection timed out (Connection timed out)

Customer

Re: Unable to start the Alfresco Email Subsystem

Hi:

I would include something like this in your service startup script (in my case the port is 1125).

iptables -t nat -A OUTPUT -d localhost -p tcp --dport 25 -j REDIRECT --to-ports 1125
iptables -t nat -A PREROUTING -d $HOSTNAME -p tcp --dport 25 -j REDIRECT --to-ports 1125
iptables -t nat -A OUTPUT -d $HOSTNAME -p tcp --dport 25 -j REDIRECT --to-ports 1125

Regards.

--C.

Professional

Re: Unable to start the Alfresco Email Subsystem

I am confused about what you are trying to do. You have adjusted your INBOUND email config to use the non-privileged port of 1025, but then you are showing a stack trace where you are trying to SEND mail, which would be OUTBOUND, and the stack trace says it is trying to connect to mailapp.jetairways.com via port 1025, which probably doesn't make sense. Maybe you changed mail.port to 1025 when you should have changed email.server.port to 1025 and left mail.port set to 25, if that is the port that your mail server is listening on.

I would get outbound mail working first. Once you are satisfied that is good, then worry about inbound.

Active Member

Re: Unable to start the Alfresco Email Subsystem

Thank you all for your valuable support. We are able to start the email subsystem with below changes.

fyi..

1.Updated the port detail in alfresco-global.properties.. For Outbound "mail.port=25" and Inbound "email.server.port=1125"

2. Added the NAT for port rerouteing

iptables -t nat -A OUTPUT -d localhost -p tcp --dport 25 -j REDIRECT --to-ports 1125
iptables -t nat -A PREROUTING -d $HOSTNAME -p tcp --dport 25 -j REDIRECT --to-ports 1125
iptables -t nat -A OUTPUT -d $HOSTNAME -p tcp --dport 25 -j REDIRECT --to-ports 1125