cancel
Showing results for 
Search instead for 
Did you mean: 

configure smtp

jogisarge
Champ in-the-making
Champ in-the-making
Hi,

we have now alfresco running on a win 7 64 Bit machine.
The emails should be send from our existing emailserver on a webserver hosted by 1und1.
in the file C:\Alfresco\tomcat\shared\classes\alfresco-global.properties i add the following

mail.host=smtp.1und1.de
mail.port=25
mail.username=username
mail.password=pass
mail.encoding=UTF-8
mail.from.default=fromadress
mail.smtp.auth=true
the emailadress exists on our webserver.
if i try to invite somebody, the following error comes in the logfile

Caused by: org.springframework.mail.MailSendException; nested exceptions (1) are:
Failed message 1: javax.mail.SendFailedException: Invalid Addresses;
  nested exception is:
   com.sun.mail.smtp.SMTPAddressFailedException: 550 must be authenticated

whats wrong with my config ?

by jogi
2 REPLIES 2

dcoales
Champ in-the-making
Champ in-the-making
Sorry to hijack your thread but I wanted to say that I have exactly the same problem.  I have tried following the guide here http://wiki.alfresco.com/wiki/Outbound_E-mail_Configuration and this thread here http://forums.alfresco.com/en/viewtopic.php?f=9&t=36053 but I can't seem to get it to work.

Some of the threads suggest it is an issue with smtps vs smtp settings since the default mailService bean javaMailProperties has the following two lines in it:
<prop key="mail.smtps.auth">${mail.smtps.auth}</prop>
<prop key="mail.smtps.starttls.enable">${mail.smtps.starttls.enable}</prop>

but no property for mail.smtp.auth.

To try to work around this I have set up my global properties like this:
mail.host=auth.smtp.1and1.co.uk
mail.port=25
mail.username=********
mail.password=*******
mail.encoding=UTF-8
mail.from.default=*******
mail.smtp.auth=true
mail.protocol=smtp

mail.testmessage.send=true
mail.testmessage.to=david.coales@accipia.com
mail.testmessage.subject=Outbound SMTP test
mail.testmessage.text=Outbound SMTP is working

I have then created a file called custom-email-context.xml in the directory {tomcat-home}/shared/classes/alfresco/extension
with the following content:
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>

<beans>
<!–                        –>
<!– MAIL SERVICE           –>
<!–                        –>

<bean id="mailService" class="org.springframework.mail.javamail.JavaMailSenderImpl">
    <property name="host">
        <value>${mail.host}</value>
    </property>
    <property name="port">
        <value>${mail.port}</value>
    </property>
    <property name="protocol">
        <value>${mail.protocol}</value>
    </property>
    <property name="username">
        <value>${mail.username}</value>
    </property>
    <property name="password">
        <value>${mail.password}</value>
    </property>
    <property name="defaultEncoding">
        <value>${mail.encoding}</value>
    </property>
    <property name="javaMailProperties">
        <props>
            <prop key="mail.smtp.auth">${mail.smtp.auth}</prop>
        </props>
    </property>
</bean>
</beans>


This still produces the 550 message.  Any ideas anyone ?

dcoales
Champ in-the-making
Champ in-the-making
Ok I've now got smtp working.  There seemed to be two issues:

Firstly the default outboutSMTP-context.xml file in the directory {tomcat_home}/webapps/alfresco/WEB-INF/classes/alfresco/subsystems/email/OutboundSMTP contains the following javaMailSender properties

           
<prop key="mail.smtps.auth">${mail.smtps.auth}</prop>
            <prop key="mail.smtps.starttls.enable">${mail.smtps.starttls.enable}</prop>

However I am not using smtps but smtp so these lines should be

          
 <prop key="mail.smtp.auth">${mail.smtp.auth}</prop>
            <prop key="mail.smtp.starttls.enable">${mail.smtp.starttls.enable}</prop>
Actually I'm not even sure if the second property is required but I changed it anyway. You could try dropping it.

To overwrite these lines I created my own config file in {tomcat_home}/shared/classes/alfresco/extension called custom-email-context.xml with a new mailService bean with the above properties set.

And this leads me to the second problem.  The above changes didn't work because it seems that my custom file is being ignored (not sure why and would be grateful if someone could tell me).  So I then changed the default config file under the WEB-INF directory instead.

This then worked with the following entries in my global properties file:
mail.smtp.auth=true
mail.protocol=smtp
mail.smtp.starttls.enable=true

I'm finally receiving outbound SMTP messages.

Hope this helps.