553 5.7.1 <mydomain>: Sender address rejected: not owned by user admin@mydomain.com

自闭症网瘾萝莉.ら 提交于 2019-12-10 02:06:05

问题


In a rails4 application, I am trying to send emails by configuring smtp settings but I am getting the following error:

553 5.7.1 : Sender address rejected: not owned by user admin@mydomain.com

I am using the following settings:

config.action_mailer.delivery_method = :smtp
  ActionMailer::Base.smtp_settings = {
    :address  => "smtp.mydomain.com",
    :port  => 25,
    :domain  => "mydomain.com",
    :user_name  => "admin@mydomain.com",
    :password  => "CorrectPassword",
    :authentication  => :plain,
    :enable_starttls_auto => true,
    :openssl_verify_mode => 'none'
  }

  config.action_mailer.default_url_options = {:host => "mydomain.com"}

The same works when I use my gmail account settings. I got my domain from bigrock.com and all MX Records are verified. I am able to send emails manually (by logging in webmail.mydomain.com). This issue has delayed the release of my site by quite a few days. Please Help!


回答1:


As @marc-b commented,

The mail server is rejecting your email because you're trying to send from a username which differs from the username you're logging in as, e.g. you've set the From: to be no-reply@mydomain.com, which is obviously not the same as admin@mydomain.com

And the solution was:

.. You are right. ... I changed the "from" field's value to same as user_name.



来源:https://stackoverflow.com/questions/21816348/553-5-7-1-mydomain-sender-address-rejected-not-owned-by-user-adminmydomain

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!