cancel
Showing results for 
Search instead for 
Did you mean: 

Configurazione Mail

_valerio_
Champ in-the-making
Champ in-the-making
Ciao a tutti, sto scrivendo questo post perchè ho trovato dei problemi nella configurazione di alfresco per quanto concerne le impostazioni SMTP. Vagando su questo forum mi sono imbattuto in diverse discussioni su come impostare il sistema, ma ho trovato delle differenze rispetto a quelle che sono le mie ipostazioni e sono un po confuso a riguardo; mi spiego meglio:
1) sul wiki di alfresco ho trovato due impostazioni: Inbound Email Server Configuration e Outbound Email Server Configuration; io vorrei semplicemente che, quando vado ad agiungere un utente, esso riceva delle mail con le sue credenziali ; allora queli delle due impostazioni devo usare?
2) io non ho il file tomcat/shared/classes/alfresco/extension/customrepository.properties. quindi lo devo creare ?
3) devo modificare C:\Alfresco\tomcat\shared\classes\repository.properties  nel seguente modo?
 mail.host = smtp.gmail.com
mail.port = 465
mail.transport.protocol = smtp
mail.username = someuser@gmail.com
mail.password= asecretpassword
mail.smtp.auth = true
mail.smtp.socketFactory.port = 465
mail.smtp.socketFactory.class = javax.net.ssl.SSLSocketFactory
mail.smtp.socketFactory.fallback = false
mail.smtp.timeout = 25000
mail.smtp.starttls.enable = true
4)ho trovato su un sito che si devono modificare i files alfresco/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/repository.properties
inserendo il seguente codice
mail.host = smtp.gmail.com
mail.port = 465
mail.transport.protocol = smtp
mail.username = someuser@gmail.com
mail.password= asecretpassword
mail.smtp.auth = true
mail.smtp.socketFactory.port = 465
mail.smtp.socketFactory.class = javax.net.ssl.SSLSocketFactory
mail.smtp.socketFactory.fallback = false
mail.smtp.timeout = 25000
mail.smtp.starttls.enable = true
è giusto?
5)va modificato il file C:\Alfresco\tomcat\webapps\alfresco\WEB-INF\classes\alfresco\core-services-context.xml nel seguente modo?
<!–                        –>
<!– 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.transport.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>
      <prop key="mail.smtp.socketFactory.port">${mail.smtp.socketFactory.port}</prop>
      <prop key="mail.smtp.socketFactory.class">${mail.smtp.socketFactory.class}</prop>
      <prop key="mail.smtp.socketFactory.fallback">${mail.smtp.socketFactory.fallback}</prop>
      <prop key="mail.smtp.timeout">${mail.smtp.timeout}</prop>
    </props>
  </property>
</bean>
se qualcuno potesse scrivere dettagliatamente la procedura da seguire dal primo all'ultimo passo mi farebbe un grosso favore

grazie a tutti
11 REPLIES 11

openpj
Elite Collaborator
Elite Collaborator
Visto che stai usando come protocollo SMTP e non SMTPS, prova in questo modo:

# Outbound SMTP properties

# use these properties to configure the out-bound SMTP server.
mail.host=mx1.XXXX.it
mail.port=25
mail.username=alfresco@XXXXXX.it
mail.password=XXXXXXX
mail.encoding=UTF-8
mail.from.default=alfresco@XXXXXX.it
mail.protocol=smtp

# Additional Java Mail properties for SMTP protocol
#mail.smtp.auth=true
mail.smtp.debug=true
mail.smtp.timeout=5000
#mail.smtp.starttls.enable=true

# Additional Java Mail properties for SMTPS protocol
#mail.smtps.auth=true
#mail.smtps.starttls.enable=false


#use these properties to send test message during start of subsystem
mail.testmessage.send=false
mail.testmessage.to=
mail.testmessage.subject=Outbound SMTP
mail.testmessage.text=The Outbound SMTP email subsystem is working.

Spero ti aiuti a risolvere  Smiley Wink

massimilianobf
Champ in-the-making
Champ in-the-making
Ho, provato a fare la tua configurazione ma va in eccezione!!


2012-05-31 12:35:38,160  ERROR [activities.feed.FeedNotifierImpl] [DefaultScheduler_Worker-2] Exception during notification of feeds
org.alfresco.error.AlfrescoRuntimeException: 04310000 Failed to send email to:alfresco@XXXXX.it
   at org.alfresco.repo.action.executer.MailActionExecuter.prepareAndSendEmail(MailActionExecuter.java:606)
   at org.alfresco.repo.action.executer.MailActionExecuter.executeImpl(MailActionExecuter.java:333)
   at org.alfresco.repo.action.executer.ActionExecuterAbstractBase.execute(ActionExecuterAbstractBase.java:196)
   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.alfresco.repo.management.subsystems.SubsystemProxyFactory$1.invoke(SubsystemProxyFactory.java:65)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
   at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
   at $Proxy225.execute(Unknown Source)
   at org.alfresco.repo.action.ActionServiceImpl.directActionExecution(ActionServiceImpl.java:780)
   at org.alfresco.repo.action.ActionServiceImpl.executeActionImpl(ActionServiceImpl.java:700)
   at org.alfresco.repo.action.ActionServiceImpl.executeAction(ActionServiceImpl.java:538)
   at org.alfresco.repo.action.ActionServiceImpl.executeAction(ActionServiceImpl.java:524)
   at org.alfresco.repo.action.ActionServiceImpl.executeAction(ActionServiceImpl.java:789)
   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.invokeJoinpointUsingReflection(AopUtils.java:309)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
   at org.alfresco.repo.security.permissions.impl.AlwaysProceedMethodInterceptor.invoke(AlwaysProceedMethodInterceptor.java:34)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
   at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:46)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
   at org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:147)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
   at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
   at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
   at $Proxy37.executeAction(Unknown Source)
   at org.alfresco.repo.activities.feed.FeedNotifierImpl.sendMail(FeedNotifierImpl.java:483)
   at org.alfresco.repo.activities.feed.FeedNotifierImpl.prepareAndSendEmail(FeedNotifierImpl.java:461)
   at org.alfresco.repo.activities.feed.FeedNotifierImpl$1.execute(FeedNotifierImpl.java:295)
   at org.alfresco.repo.activities.feed.FeedNotifierImpl$1.execute(FeedNotifierImpl.java:292)
   at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:388)
   at org.alfresco.repo.activities.feed.FeedNotifierImpl.executeInternal(FeedNotifierImpl.java:291)
   at org.alfresco.repo.activities.feed.FeedNotifierImpl.execute(FeedNotifierImpl.java:222)
   at org.alfresco.repo.activities.feed.FeedNotifierJob$1.doWork(FeedNotifierJob.java:67)
   at org.alfresco.repo.security.authentication.AuthenticationUtil.runAs(AuthenticationUtil.java:519)
   at org.alfresco.repo.activities.feed.FeedNotifierJob.execute(FeedNotifierJob.java:63)
   at org.quartz.core.JobRunShell.run(JobRunShell.java:216)
   at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:563)
Caused by: org.springframework.mail.MailSendException: Failed messages: javax.mail.SendFailedException: Invalid Addresses;
  nested exception is:
   com.sun.mail.smtp.SMTPAddressFailedException: 530 Authentication required
; message exceptions (1) are:
Failed message 1: javax.mail.SendFailedException: Invalid Addresses;
  nested exception is:
   com.sun.mail.smtp.SMTPAddressFailedException: 530 Authentication required

   at org.springframework.mail.javamail.JavaMailSenderImpl.doSend(JavaMailSenderImpl.java:440)
   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)
   … 44 more