AnsweredAssumed Answered

Email notification example

Question asked by javydreamercsw on Oct 30, 2006
Latest reply on Dec 5, 2006 by javydreamercsw
I've been reading across the post for how to set up the email for notifications since it seems is not an out-of-the-box feature. I found the following in the System administration manual:

Configuring email
You can configure the Alfresco repository to send e-mails from an SMTP server.
Currently the repository does not support secure SMTP servers. In V1.2 the
mail.username may be anonymous.

The procedure involves:
 Copying part of a default configuration file
 Pasting the snippet into a new file.
 Saving the file in the <extension> directory.
➢ To configure email
1. Browse to the file:
<configRoot>/alfresco/repository.properties
Warning: You are recommended not to directly modify any property in a default file.
2. Copy the following block of email properties:
# Email configuration
mail.host=
mail.port=25
mail.username=anonymous
mail.password=
3. Create a new file in the <extension> directory.
4. Copy the email properties block into this file.
5. Modify any property to your required value as follows (you can delete any
unmodified property, because it will retain the default value from
repository.properties):
mail.host=<the name of your SMTP host>
mail.port=<the port that your SMTP service runs on (the default is
25)>
mail.username=<the username of the account you want e-mail to be sent
from>
mail.password=<the password>
6. Save the file with a meaningful name that ends with .properties
7. Ensure that your new file is pointed to, so that it can be found at server startup
(refer to "About pointing to customized configuration files", on page 7).

I looked into the system and the email properties are already in the repository.properties file. The created an email.properties file with the specified contents and obviously the required values. Here's an example:

mail.host=smtp.google.com
mail.port=587
mail.username=myeamil@gmail.com
mail.password=mypasword

The following the section "About pointing to customized configuration files > Pointing to customized files (non-web client) in <extension>
directory" and added the following line to custom-db-and-data-context.xml


<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>

<!–
       This shows the common minimum configuration overrides.
       By default, the content and indexes are located at a relative location, which should only
       be used when doing a quick preview of the Alfresco server.
–>
<beans>
  
    <!– overriding to point to custom properties –>
    <bean id="repository-properties" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
        <property name="ignoreUnresolvablePlaceholders">
            <value>true</value>
        </property>
        <property name="locations">
            <list>
                <value>classpath:alfresco/repository.properties</value>
                <value>classpath:alfresco/version.properties</value>
                <value>classpath:alfresco/domain/transaction.properties</value>
      <value>classpath:alfresco/email.properties</value>

                <!– Override data location properties –>
                <value>classpath:alfresco/extension/custom-data-location.properties</value>
                <!– Override database connection properties –>
                <value>classpath:alfresco/extension/custom-db-connection.properties</value>
            </list>
        </property>
    </bean>

    <bean id="hibernateConfigProperties" class="org.springframework.beans.factory.config.PropertiesFactoryBean">
        <property name="locations">
            <list>
                <value>classpath:alfresco/domain/hibernate-cfg.properties</value>

                <!– Override hibernate dialect –>
                <value>classpath:alfresco/extension/custom-hibernate-dialect.properties</value>
            </list>
        </property>
    </bean>
   
</beans>

Then restarted the server but no email received after activating a workflow with email actions (the rest of the rules worked).

Any idea and/or example?

Thanks in advance.

Outcomes