cancel
Showing results for 
Search instead for 
Did you mean: 

Simply Email Configuration in 2.9

jlabuelo
Champ on-the-rise
Champ on-the-rise
Hi all

I have been using and testing the 2.9C version for some time, and until now I did not test the simple email option ( sending emails everytime a space is changed or an user is invited to an space). To tell you the truth I have never needed to use this option in 2.1, so this was the first time I have worked in this option.

I have followed the instructions explained in the manual which can be found in the wiki site.

1) I have modified the web-client-config-custom.xml file adding this section

<!– Changing the from in the mails –>
   <config>
   <client>
      <from-email-address>smgd@mydomain.es</from-email-address>
   </client>
</config>

2) I have modified the repository.properties file with these parameters:

# Email configuration
mail.host=smtp.mydomain.es
mail.port=25
mail.username=ccf313c
mail.password=mypassword

# Set this value to UTF-8 or similar for encoding of email messages as required
mail.encoding=UTF-8
# Set this value to 7bit or similar for Asian encoding of email headers as required
mail.header=
mail.from.default=alfresco@alfresco.org


Then I have restarted the Alfresco Server and added an user (which has an email address attached during his set up) to a space, and selected "yes" to the question "send a mail to the user to notifiy the change"…. Although the user is creatd correctly, in the log I can see an error and of course the mail is not sent:

16:40:07,118 ERROR [org.alfresco.web.bean.TemplateMailHelperBean] Failed to send email to username@mydomain.es
org.springframework.mail.MailSendException; nested exception details (1) are:
Failed message 1:
javax.mail.SendFailedException: Invalid Addresses;
  nested exception is:
   class com.sun.mail.smtp.SMTPAddressFailedException: 554 <username@mydomain.es>: Recipient address rejected: Access denied



The complete Error is:

16:40:07,118 ERROR [org.alfresco.web.bean.TemplateMailHelperBean] Failed to send email to username@mydomain.es
org.springframework.mail.MailSendException; nested exception details (1) are:
Failed message 1:
javax.mail.SendFailedException: Invalid Addresses;
  nested exception is:
   class com.sun.mail.smtp.SMTPAddressFailedException: 554 <username@mydomain.es>: Recipient address rejected: Access denied

   at com.sun.mail.smtp.SMTPTransport.rcptTo(SMTPTransport.java:1130)
   at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:525)
   at org.springframework.mail.javamail.JavaMailSenderImpl.doSend(JavaMailSenderImpl.java:391)
   at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:335)
   at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:350)
   at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:339)
   at org.alfresco.web.bean.TemplateMailHelperBean.notifyUser(TemplateMailHelperBean.java:175)
   at org.alfresco.web.bean.wizard.BaseInviteUsersWizard.finishImpl(BaseInviteUsersWizard.java:265)
   at org.alfresco.web.bean.dialog.BaseDialogBean$1.execute(BaseDialogBean.java:121)
   at org.alfresco.web.bean.dialog.BaseDialogBean$1.execute(BaseDialogBean.java:118)
   at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:236)
   at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:166)
   at org.alfresco.web.bean.dialog.BaseDialogBean.finish(BaseDialogBean.java:127)
   at org.alfresco.web.bean.wizard.WizardManager.finish(WizardManager.java:580)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:132)
   at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:61)
   at javax.faces.component.UICommand.broadcast(UICommand.java:109)
   at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:97)
   at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:171)
   at org.apache.myfaces.lifecycle.InvokeApplicationExecutor.execute(InvokeApplicationExecutor.java:32)
   at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:95)
   at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:70)
   at javax.faces.webapp.FacesServlet.service(FacesServlet.java:139)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
   at org.alfresco.web.app.servlet.AuthenticationFilter.doFilter(AuthenticationFilter.java:81)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
   at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
   at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
   at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
   at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
   at java.lang.Thread.run(Thread.java:619)

Any ideas of what I am doing wrong???? I have tried the same configuration parameters in other applications like Outlook in MS Windows or Apple Mail and worked fine.

Thanks a lot in advance
6 REPLIES 6

jlabuelo
Champ on-the-rise
Champ on-the-rise
Hey come on!!!… sure someone has configured the email functionality in Alfresco  Smiley Very Happy …nobady can explain me what I am doing wrong???? or is that just maybe this functionality ( the way I am trying to get it done) is not workin in 2.9. Do you think I shall move this to a bug??

your answers are really appreciated  :shock:

pmonks
Star Contributor
Star Contributor
Your configuration is fine - the problem is that the SMTP server you're using is rejecting emails sent from "username@mydomain.es" (the 554 status code is coming from the SMTP server running at smtp.mydomain.es, and gets translated into a Java exception by the Java SMTP protocol handler).

One of the major problems with the SMTP protocol is its lack of authentication (it doesn't require any identification of who it is that's sending an email, which allows spammers to send email with impunity).  One of the more common fixes to this problem is to check the "from" address in the email against a known list of "blessed" email addresses, and rejecting emails from anyone else.  This is little more than a band-aid fix however, since it's trivial for spammers to change the "from" address and keep attempting to send emails until one goes through.

The upshot is that your SMTP server is configured with this authentication kludge, so you'll have to find out what a valid "from" address is for that server and use that in your Alfresco configuration instead of "username@mydomain.es".

Cheers,
Peter

jlabuelo
Champ on-the-rise
Champ on-the-rise
Thanks a lot pmonks… it is great when someone gives a hand when you have a problem  Smiley Very Happy

I have tried what you suggested, I have contacted my hosting domain company and talked to them about this problem… but seems that the issue is not related this time with the domain server blocking any mail address. I have tried the same configuration with other applications and outlook express in windows and it worked fine, I can send and receive mails fine to and from this address I use.

I have tried also to use two email and smtp accounts I have in gmail and yahoo.. altough it does not work either I get a different error:

This is the repository.properties configuration I used with yahoo smtp:

# Email configuration
mail.host=smtp.correo.yahoo.es
mail.port=465
mail.username=username
mail.password=password
# Set this value to UTF-8 or similar for encoding of email messages as required
mail.encoding=UTF-8
# Set this value to 7bit or similar for Asian encoding of email headers as required
mail.header=7bit
mail.from.default=username@yahoo.es

and when I invite an user and I select the send mail option I get this error message this time, after 5 mins waiting for the creation process to finish:

09:49:57,051 ERROR [org.alfresco.web.bean.TemplateMailHelperBean] Failed to send email to username@yahoo.es
org.springframework.mail.MailSendException; nested exceptions (0) are:
Caused by: javax.mail.MessagingException: Exception reading response;
  nested exception is:
   java.net.SocketException: Connection reset

Any ideas? is my server configuration or anybody else had this issue with 2.9?

Thanks a lot guys

pmonks
Star Contributor
Star Contributor
I'm by no means an expert on those services, but I don't believe Yahoo offers SMTP services for personal users, and GMail doesn't provide them unless you explicitly enable it in your profile.

In any event, the "Connection reset" exception indicates that the Java SMTP client that Alfresco uses is unable to connect to smtp.correo.yahoo.es:465, which could be caused by a variety of things:
  • There's nothing listening on port 465 on the smtp.correo.yahoo.es host (that's a non-standard port for SMTP, so it'd be worth double checking it)

  • Yahoo have blocked access to port 465 somehow (eg. via a firewall or IP address filtering, for example)
I'd suggest talking to your hosting provider again and asking them for specific details on the host, port and from address that need to be configured in order to send emails via their SMTP server.  It would also be worth asking them if they have any other kind of SMTP authentication setup (such as IP address filtering or other mechanisms) that might impact your ability to use their SMTP server.

Cheers,
Peter

michael_kiske
Champ in-the-making
Champ in-the-making
Hi.

Your problem could be with mail servers that need SSL connection (port 465) like gmail or yahoo. Check this jira:

http://issues.alfresco.com/browse/AR-1459;jsessionid=53DD62F14F795CD560581CC1101EF03A?page=com.atlas...

I have configured Alfresco with gmail (it needs SSL and user/password authentication) and works fine.

HTH.

jlabuelo
Champ on-the-rise
Champ on-the-rise
Hi Michael

Thanks a lot for your post. I think this is starting to have some "body" :-D. I have tried what you suggested in the Jira post, and now I dont get any authorization error when I try to send a mail to an user using Alfresco 2.9. The problem I have is now related to a connection timeout.

When I invite an user to a space, and I select "Send a Notification Mail" it takes a while, but after some secs, I get this error message:

Tenant: company1 User:admin ERROR [web.bean.TemplateMailHelperBean] Failed to send email to user_name@domain.es
Caused by: javax.mail.MessagingException: Could not connect to SMTP host: smtp.domain.es, port 465;
nested execption is:
java.net.ConnectException: Connection timed out: connect
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1213)
at com.sun.mai.SMTPTransport.protocolConnect(SMTPTransport.java:311)
at javax.mail.Service.connect(Service.java:233)
…..

(Just for clarification I am using 2.9c_dev MT enabled)

I have set the two new parameters in the repository.properties

# Email configuration
mail.host=smtp.domain.es
mail.port=465
mail.username= user_name
mail.password=pswd
# Set this value to UTF-8 or similar for encoding of email messages as required
mail.encoding=UTF-8
# Set this value to 7bit or similar for Asian encoding of email headers as required
mail.header=7bit
mail.from.default=user_name@domain.es
mail.smtp.auth=true
mail.smtp.timeout=3000

I have asked my mail provider and they say that there is not IP filtering or anything like that, that can be causing the "blocking"

any ideas??? did you find anything like this when you tried??

Thanks in advance mate