【问题标题】:Rails w/devise authentication what is the configuration of iRedMail?Rails w/devise authentication iRedMail 的配置是什么?
【发布时间】:2018-08-15 15:30:28
【问题描述】:

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

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

在iRedMail论坛上谷歌和发帖不成功后,我们只找到smt gmail config,请在下面找到。

提前致谢!

==== 设计配置/环境/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
  4. Apache/2.4.25 (Debian)
  5. PHP 7.0.19-1
  6. Ruby 2.5.0、Rails 5.1.5 和 Phusion Passenger 5.2.1
  7. 没有错误:/var/log/iredapd/iredapd.log

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

【问题讨论】:

    标签: ruby-on-rails devise iredmail


    【解决方案1】:

    编辑 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-01-01
      • 2023-02-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-01-05
      • 1970-01-01
      • 2011-08-13
      相关资源
      最近更新 更多