0

我们在 4 个电子邮件服务器(8 个域)中为我们自己的电子邮件帐户成功使用了 iRedMail。

我们基于 RoR 开发 Web 应用程序。我们想知道通过 rails 和 devise gem、https://github.com/plataformatec/devise发送给用户的 iRedMail 配置是什么、密码提醒、电子邮件确认等。地址和有什么区别领域?如何测试?

谷歌搜索并在 iRedMail 论坛发帖不成功后,我们只找到 smt gmail 配置,请在下面找到。

提前致谢!

==== 设计配置/环境/development.rb ====

SMTP GMAIL 配置:

config.action_mailer.raise_delivery_errors = true

config.action_mailer.delivery_method = :smtp

config.action_mailer.perform_deliveries = true

config.action_mailer.default_url_options = { :host => 'localhost:3000' }

config.action_mailer.smtp_settings = {

:address => "smtp.gmail.com",

:port => 587,

:domain => "mail.google.com",

:user_name => "my@gmail.com",

:password => "mypassword",

:authentication => :plain,

:enable_starttls_auto => true

}

==== 后端 ====

  1. iRedMail 0.9.7 MARIADB 版。
  2. 全新 OVZ-6GB 中的 Debian GNU/Linux 9 (stretch)
  3. Mysql/MariaDB w/adminer
  4. Apache/2.4.25 (Debian)
  5. PHP 7.0.19-1
  6. Ruby 2.5.0、Rails 5.1.5 和 Phusion 乘客 5.2.1
  7. 没有错误:/var/log/iredapd/iredapd.log

==============================

4

1 回答 1

0

编辑 DEVISE config/environments/development.rb

config.action_mailer.raise_delivery_errors = true
config.action_mailer.delivery_method = :smtp
config.action_mailer.perform_deliveries = true
config.action_mailer.default_url_options = { :host => 'localhost:3000' }
config.action_mailer.smtp_settings = {
:address => "mx.coopeu.com",
:port => 587,
:domain => "mx.cooopeu.com",
:user_name => "coopeu@coopeu.com",
:password => "password",
:authentication => :plain,
:enable_starttls_auto => true
}

还引发错误:ConfirmationsController#create 中的 Net::SMTPFatalError

554 5.7.1:收件人地址被拒绝:发件人与 SMTP 验证用户名不同


这意味着您使用用户“coopeu@coopeu.com”进行 SMTP 身份验证,但指定用户“someone-else@somedomain.com”作为发件人地址。如果您需要允许此 smtp 用户的发件人地址不匹配,您可以在 /opt/iredapd/settings.py 中添加一个设置以允许它,如下所示: ALLOWED_LOGIN_MISMATCH_SENDERS = ['coopeu@coopeu.com']

修改“settings.py”后重启iredapd。


它工作正常

于 2018-10-26T13:02:52.377 回答