Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

553 5.7.1 <mydomain>: Sender address rejected: not owned by user [email protected]

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 [email protected]

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  => "[email protected]",
    :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!

like image 787
Siddhant Avatar asked Feb 16 '14 20:02

Siddhant


1 Answers

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 [email protected], which is obviously not the same as [email protected]

And the solution was:

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

like image 199
Jared Beck Avatar answered Nov 14 '22 06:11

Jared Beck