cancel
Showing results for 
Search instead for 
Did you mean: 

Mail sent after migration

dranakan
Champ on-the-rise
Champ on-the-rise
Hello,

I'am doing a test migration (from 3.4d -> 4.0d under Rhel5.6/Mysql). I don't want that the users get some mails and I see during the startup than Alfresco wants to send some mails.


2012-02-17 11:07:44,298  ERROR [action.executer.MailActionExecuter] [DefaultScheduler_Worker-4] Failed to send email to abc@abc.ch
org.springframework.mail.MailSendException: Mail server connection failed; nested exception is javax.mail.MessagingException: Unknown SMTP host: smtp.example.com;
  nested exception is:
        java.net.UnknownHostException: smtp.example.com. Failed messages: javax.mail.MessagingException: Unknown SMTP host: smtp.example.com;
  nested exception is:
        java.net.UnknownHostException: smtp.example.com; message exception details (1) are:
Failed message 1:
javax.mail.MessagingException: Unknown SMTP host: smtp.example.com;
  nested exception is:
        java.net.UnknownHostException: smtp.example.com
        at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1280)
        at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:370)
        at javax.mail.Service.connect(Service.java:275)
        at org.springframework.mail.javamail.JavaMailSenderImpl.doSend(JavaMailSenderImpl.java:389)
        at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:340)
        at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:355)
        at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:344)
        at org.alfresco.repo.action.executer.MailActionExecuter.prepareAndSendEmail(MailActionExecuter.java:574)
        at org.alfresco.repo.action.executer.MailAc


How can I know how much mails will be send ? How can Idelete these mails before setting the mail server ?

Thank you.
2 REPLIES 2

mrogers
Star Contributor
Star Contributor
option 1) Send the email to a "test server".
option 2) Turn off email sending.
option 3) There's also a "test mode" flag you may be able to set that.
option 4) Spring in your own mailSender action.

dranakan
Champ on-the-rise
Champ on-the-rise
Thank you.

I added in  tomcat/webapps/alfresco/WEB-INF/classes/alfresco/subsystems/email/OutboundSMTP/outboundSMTP-context.xml

<bean id="mail" class="org.alfresco.repo.action.executer.MailActionExecuter" parent="action-executer">

<property name="testMode">
            <value>true</value>
          </property>
….

Add the debug log4j to see which mails will be send. tomcat/webapps/alfresco/WEB-INF/classes/log4j.properties

log4j.logger.org.alfresco.repo.action.executer=debug

More 30 mails want to be sent to the users… (subject : Alfresco Share: Recent Activities).
After a restart the mails want not to be send… Now I can remove the testMode.