cancel
Showing results for 
Search instead for 
Did you mean: 

SMTP Server authentication error

mautidavis
Champ in-the-making
Champ in-the-making
Dear all,

When inviting users to a site I get the message that the invite has been successfully sent but when I check the catalina.out log file, i find the error below:


09:28:55,397 User:admin ERROR [action.executer.MailActionExecuter] Failed to send email to pkabugi@nacc.or.ke
org.springframework.mail.MailSendException; nested exception details (1) are:
Failed message 1:
com.sun.mail.smtp.SMTPSendFailedException: 530 5.7.1 Client was not authenticated

        at com.sun.mail.smtp.SMTPTransport.issueSendCommand(SMTPTransport.java:1275)
        at com.sun.mail.smtp.SMTPTransport.mailFrom(SMTPTransport.java:895)
        at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:524)
        at org.springframework.mail.javamail.JavaMailSenderImpl.doSend(JavaMailSenderImpl.java:388)
        at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:332)
        at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:347)
        at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:336)
        at org.alfresco.repo.action.executer.MailActionExecuter.executeImpl(MailActionExecuter.java:352)
        at org.alfresco.repo.action.executer.ActionExecuterAbstractBase.execute(ActionExecuterAbstractBase.java:127)
        at org.alfresco.repo.action.ActionServiceImpl.directActionExecution(ActionServiceImpl.java:592)
        at org.alfresco.repo.action.ActionServiceImpl.executeActionImpl(ActionServiceImpl.java:529)
        at org.alfresco.repo.action.ActionServiceImpl.executeAction(ActionServiceImpl.java:391)
        at org.alfresco.repo.action.ActionServiceImpl.executeAction(ActionServiceImpl.java:379)
        at org.alfresco.repo.action.ActionServiceImpl.executeAction(ActionServiceImpl.java:600)
        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.springframework.aop.support.AopUtils.invokeJoinpointUsingReflectio

Please take note that this started happening when we migrated from Ms Exchange 2003 to Ms Exchange 2007 server.

Anybody with an idea on what happened or what is the problem?

I will appreciate any insight in sorting out this authentication problem.

Regards,
Davis M Onsakia
4 REPLIES 4

tonyc
Champ in-the-making
Champ in-the-making
My guess is that the exchange server 2007 settings do not allow relaying by default.  This prevents other mail servers from using yours to relay emails (usally for spam).  Have a look at the following link which shows how to allow relay exceptions.

http://blogs.techrepublic.com.com/networking/?p=373'>
http://blogs.techrepublic.com.com/networking/?p...


Good Luck

mautidavis
Champ in-the-making
Champ in-the-making
Hi Tonyc,

Thanks.

That sorted out my problem perfectly.

Regards,
Davis M Onsakia

mmtman
Champ in-the-making
Champ in-the-making
In case this is useful to anyone else out there:

You don't need to enable an anonymous relay on the Exchange server.  Rather, first make sure that the Exchange server is able to send mail from an authenticated user from outside properly, then test it, and then setup the outbound mail settings in Alfresco.

Here's how to get started and what I did to make sure that Exchange was setup properly:
    1. Setup a mailbox that will be used to send the Alfresco email.  See other online documentation for how to do this.
    2. For the receiver connector (SMTP, port 25) General properties, make sure the the FQDN is set to that of the server.
    3. For the receiver connector (SMTP, port 25) Authentication properties, make sure the following are checked:
      Transport Layer Security (TLS)
      Basic Authentication
      Exchange Server authentication
Next, you need to test the Exchange server to be sure that you can authenticate a user with SMTP.  I'm not going to spell out how to do this, but you can use the information in the link below to help you test your setup; basically it uses telnet to test the authentication mechanism:
http://www.computerperformance.co.uk/exchange2010/exchange_2010_smtp_auth_login.htm#3%29_SMTP_Auth_L...
You should be able to authenticate from outside the network that your Exchange server is part of before you can setup Alfresco to work properly.

Last, you need to setup Alfresco to be able to send outbound emails through Exchange.  Below is what is needed in your alfresco-global.properties file: (Note: you need to change the lines that have <…> in them. Also, your username and password don't need to be base64 encoded😞

### Outbound E-mail configuration ###
mail.host=<your_Exchange_IP_Address>
mail.port=25
mail.protocol=smtp
mail.smtp.starttls.enable=false
mail.smtp.auth=true
mail.smtp.timeout=30000
mail.encoding=UTF-8
mail.from.default=<your_email_address>
mail.username=<your_username>
mail.password=<your_password>

## Uncomment the lines below to test the Outbound Email configuration
#mail.testmessage.send=true
#mail.testmessage.to=<some_email_address>
#mail.testmessage.subject=Outbound SMTP
#mail.testmessage.text=The Outbound SMTP email subsystem is working.

email.server.allowed.senders=.*\@<your_company>\.com

If all goes well (and you uncommented the lines for testing the outbound email configuration), you should receive a test email to the email address you specified in the "testmessage" block.  Now, if you've enabled invitation notification emails, Alfresco should be able to send them.

Final thoughts: If this doesn't work for you, make sure that you're able to complete the first two steps or else you'll never be able to do the third one.  There may be some lines in in the Outbound Email Configuration code block that might be able to be changed (i.e. mail.smtp.starttls.enable) or removed  (i.e. email.server.allowed.senders) but I didn't change anything once I got it working.  When/if I have time I may go back and change these settings and see if I can remove/improve anything.

Keywords: smtp Microsoft Exchange anonymous relay outbound email configuration

mmtman
Champ in-the-making
Champ in-the-making
I want to add that if setup Exchange to require user authentication, then it will not let you send e-mail invitations when users are added/nominated to join a site.  This is supposedly fixed in 4.0.1 with the option of mail.from.enable=false, but as the community only has 4.0.d at the time of writing this (and adding mail.from.enable option=false did nothing, I had to find another solution. 

The solution that I came up with was to give the user that I had specified in the outbound email configuration "Send-As" permission for all mailboxes in Exchange.  So, first make sure you have a user mailbox setup in Exchange to be your Alfresco outbound emailer ("Alfresco emailer") and also make sure that this information is setup in Alfresco as described the post above.  Second, you can give your "Alfresco emailer" "Send-As" permissions in Exchange by running the command below in the Exchange Management Shell, making sure to replace the user information as appropriate:

get-mailbox | Add-ADPermission -user '<DOMAIN\username>' –ExtendedRights 'Send As'

Now, Alfresco shouldn't give an error at all when sending email invitations, because the "Alfresco emailer" can send email as any user that is currently in the Exchange Server.  You will need to add the "Alfresco emailer" whenever you add a new user, unless you look up how to make the "Send-As" permission be inherited. 

If you want to undo this, you may want to check this link below.  In conjunction with that link, I noticed that if you remove the permission from one mailbox manually, it gives you the command it ran to do so. You can Ctlr+C to get the command and then probably modify it to run through all the users and remove it.  I have only tried this to the point of seeing the command but not trying to use the command against all the mailboxes, so I can't say it will actually work; however, the command had a few more options than the on in the link below.
http://social.technet.microsoft.com/Forums/en-US/exchange2010/thread/4f419236-ffbd-455d-a6ab-ad69ef7...