4

I am trying to send mail using sendmail settings but i am not receiving the mail I can see the mail sent in development log.

config/application.rb

    config.action_mailer.delivery_method = :sendmail
    config.action_mailer.sendmail_settings = {
      :location => '/usr/sbin/sendmail',
      :arguments => '-i -t'
   }
   config.action_mailer.perform_deliveries = true
   config.action_mailer.raise_delivery_errors = true

mailers/Notifier.rb

class Notifier < ActionMailer::Base
   default :from => "deepika@xxx.com"
   def welcome_email
     mail(:to => "deepika@xxx.com",   :subject => "Welcome to My Site test mail")
   end 
end

And i am calling Notifier.welcome_email.deliver from index method.

I can see log

Sent mail to deepika@xxx.com (339ms)
Date: Wed, 10 Apr 2013 15:16:33 +0530
From: deepika@xxx.com
To: deepika@xxx.com
Message-ID: <516534f983356_30f3262c7c84610d2@cybage-virtual-machine.mail>
Subject: Welcome to My Site test mail
Mime-Version: 1.0
Content-Type: text/html;
 charset=UTF-8
Content-Transfer-Encoding: 7bit

<p>Thanks for joining and have a great day!</p> 

But i am not receiving mail.

when i do service sendmail status i am getting

MSP: is run via cron (20m)
MTA: 123995 /usr/sbin/sendmail-mta -Am -L sm-mta -bd -q10m
UID        PID  PPID  C STIME TTY          TIME CMD
root     123995     1  0 15:36 ?        00:00:00 sendmail: MTA: accepting connections          
Daemon Status: (process 132996) Queue runner

Current number of children: 1
QueueDir free disk space (in blocks): 285222800
Load average: 1
Child Process 139595 Status: accepting connections
Child Process 144035 Status: console socket child

QUE: Same as MTA

Also when i do vi /var/mail/root, I am getting following

This is a MIME-encapsulated message

--r3A9kDux012954.1365587178/cybage-virtual-machine.cybage.com

The original message was received at Wed, 10 Apr 2013 15:02:21 +0530
from localhost
with id r3Adsdsd9WLU5012559

   ----- The following addresses had permanent fatal errors -----
<deepika@xxx.com>
    (reason:   Client was not authenticated)

   ----- Transcript of session follows -----
... while talking to mail.xxx.com.:
>>> MAIL From:<> SIZE=268814
<<< 530 5.7.1 Client was not authenticated
Service unavailable

Can you please tell me what is the reason behind not receiving mail.

Deepika
  • 826
  • 6
  • 14
  • Can you change your setting to gmail and check if it works or not???But i think for this gmail should be allow by your proxy but still you can check http://stackoverflow.com/questions/5026098/sending-email-from-gmail-rails-3 – Salil Apr 10 '13 at 10:35
  • Also refer http://guides.rubyonrails.org/action_mailer_basics.html#example-action-mailer-configuration – Salil Apr 10 '13 at 10:38
  • @Salil, I don't want smtp setting. To setup gmail, i'll have to configure smtp instead of sendmail. – Deepika Apr 10 '13 at 10:41
  • @Deepika am getting same error what you asked, did you solve this. – God Nov 18 '13 at 13:03
  • @God I used smtp settings then... – Deepika Nov 19 '13 at 10:51
  • @Deepika ok i have to do it in sendmail. thank u – God Nov 19 '13 at 11:08

0 Answers0