4

我正在尝试使用 sendmail 设置发送邮件,但我没有收到邮件我可以在开发日志中看到发送的邮件。

配置/应用程序.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

Notifier.welcome_email.deliver从索引方法调用。

我可以看到日志

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> 

但我没有收到邮件。

当我这样做service sendmail status的时候

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

另外,当我这样做时vi /var/mail/root,我正在关注

这是一条 MIME 封装的消息

--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

你能告诉我收不到邮件的原因是什么吗?

4

0 回答 0