参数说明

authentication

mail服务器所要求的验证方法.

参数值有:

  • :login

需要登录验证,设置此参数后,必须设置以下两个参数

      user_name: redmine@example.net
      password: redmine
  • :none 不需要登录

设置此参数后,切记不要包含user_name和password参数

 

delivery_method

mail发送方式

参数值有:

  • :smtp

          smtp同步方式发送邮件,在新建或修改问题的同时发送mail

  • :async_smtp

          smtp异步方式发送邮件,发送mail和操作同步进行

  • :sendmail

           sendmail发送方式

  • :async_sendmail

           sendmail异步发送邮件

 

配置文件说明

普通SMTP配置

配置文件在config目录下的email.yml,普通smtp验证配置如下,其中“production”表示是生产环境,如果使用的是开发环境,需要将其修改为“development”:

Java代码
  1. # Outgoing email settings  
  2.   
  3. production:  
  4.   email_delivery:  
  5.     delivery_method: :smtp  
  6.     smtp_settings:  
  7.       address: “smtp.example.net”  
  8.       port: 25  
  9.       domain: “example.net”  
  10.       authentication: :login  
  11.       user_name:“redmine@example.net”  
  12.       password: redmine  

gmail配置

production:
  email_delivery:
    delivery_method: :smtp
    smtp_settings:
      tls: true
      enable_starttls_auto: true
      address: "smtp.gmail.com" 
      port: '587'
      domain: "smtp.gmail.com" 
      authentication: :plain
      user_name: "your_email@gmail.com" 
      password: "your_password"
 

smtp不需要验证参数

Java代码
  1. production:  
  2.   email_delivery:  
  3.     delivery_method: :smtp  
  4.     smtp_settings:  
  5.       address: smtp.knology.net  
  6.       port: 25  
  7.       domain: cybersprocket.com  
  8.       authentication: :none  
 

sendmail配置

如果采用的是sendmail,如果你服务器上安装的unix操作系统,并且没有安装SMTP客户端,可以考虑采用sendmail方式直接发送邮件,配置远离同上,但是需要将

Java代码
  1. delivery_method: :sendmail  

 即可