...is like to have a cutter that doesn't cut! :)
Hello, I'm working on Action Mailer, with a simple email confirmation
when a user signs up.
So, basically when I try to register myself on my local server, the
registration goes just fine, without errors nor failures, but I
ultimately don't receive any email from myself, even though the app is
supposed and structured to do so.
For instance , I have the Notifier model structured so :
class Notifier < ActionMailer::Base
default :from => "###MY EMAIL###"
def welcome(user)
@user = user
mail (:to => user.email , :subject => "Signed up successfully")
end
end
...and my UserController :
def create
@user = User.new(params[:user])
respond_to do |format|
if @user.save
Notifier.welcome(@user).deliver
format.html { redirect_to(@user, :notice => "User #{@user.name }
was successfully created.") }
format.xml { render :xml => @user, :status => :created,
:location => @user }
else
format.html { render :action => "new" }
format.xml { render :xml => @user.errors, :status =>
:unprocessable_entity }
end
end
end
I've got a Gmail account , and in my environments/development.rb I
configured the gmail account in this way :
config.action_mailer.smtp_settings = {
:address => "smtp.gmail.com",
:port => 587,
:domain => "gmail.com",
:authentication => "plain",
:user_name => "MY EMAIL",
:password => '#MY PASSWORD',
:enable_starttls_auto => true
}
Any idea???
Thank you very much!
Leo
on 2011-08-29 12:43
on 2011-08-29 13:50
Are you running the server in development mode? Are you getting any errors in your log?
on 2011-08-29 14:43
Nope, the log shows a -I guess- normal session : Sent mail to leo.mmcm@gmail.com (4245ms) Date: Mon, 29 Aug 2011 14:39:43 +0200 From: leo.mmcm@gmail.com To: leo.mmcm@gmail.com Message-ID: <4e5b888f9c7e6_6a0482ece0c86423a@e4r.local.mail> Subject: Iscrizione completa! Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Redirected to http://0.0.0.0:3000/users/46 Completed 302 Found in 4711ms The really weird thing is that I tried to send an email to a fake address, and then, in that case I receive an email from Email Delivery Subsystem, with the normal notice about an inexistent domain, so it means that ActionMailer actually works, but for some reason I'm not able to receive the email I send to myself. I can't see any evident clue in here, let me know if you see one : Delivery to the following recipient failed permanently: sdpaoksdjf@gmailasd.ca Technical details of permanent failure: DNS Error: Domain name not found ----- Original message ----- Received: by 10.227.38.22 with SMTP id z22mr2606056wbd.7.1314614527794; Mon, 29 Aug 2011 03:42:07 -0700 (PDT) Return-Path: <leo.mmcm@gmail.com> Received: from gmail.com (93-45-120-143.ip102.fastwebnet.it [93.45.120.143]) by mx.google.com with ESMTPS id fd4sm3622444wbb.30.2011.08.29.03.42.05 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 29 Aug 2011 03:42:06 -0700 (PDT) Date: Mon, 29 Aug 2011 12:45:06 +0200 From: leo.mmcm@gmail.com To: sdpaoksdjf@gmailasd.ca Message-ID: <4e5b6db295886_6a0482f465146412f@e4r.local.mail> Subject: Iscrizione completa! Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit
on 2011-08-29 14:53
Right, this is weird. I didn't change a single line and tried again to register with the usual email address and this time I received the message! Some conflict at ISP level maybe? Could be? Thank you guys, Leo
on 2011-08-29 14:55
On Aug 29, 2011, at 8:43 AM, Leo M. wrote: > charset=UTF-8 > to receive the email I send to myself. > > Date: Mon, 29 Aug 2011 12:45:06 +0200 > From: leo.mmcm@gmail.com > To: sdpaoksdjf@gmailasd.ca > Message-ID: <4e5b6db295886_6a0482f465146412f@e4r.local.mail> > Subject: Iscrizione completa! > Mime-Version: 1.0 > Content-Type: text/plain; > charset=UTF-8 > Content-Transfer-Encoding: 7bit > Is this mail being sent/received on a DSL/Cable modem? Your ISP may be filtering mail sent directly by your computer as an anti-spam measure. Since you entered an intentionally garbled address as a testing measure, then your localhost might not have been able to forward it to the next hop, and the error message may have come from whatever you use for sendmail on your local computer. In the case of a well-formed message, your machine may have sent it on to the next mailserver in the chain, which would be your ISP, and they looked at it, decided you were not a real server, and dropped it on the floor without comment. Now if you're sending from a real server with an MX record and everything, then I have no idea. Walter
on 2011-08-29 15:16
Walter Davis wrote in post #1019034: > On Aug 29, 2011, at 8:43 AM, Leo M. wrote: > >> charset=UTF-8 >> to receive the email I send to myself. >> >> Date: Mon, 29 Aug 2011 12:45:06 +0200 >> From: leo.mmcm@gmail.com >> To: sdpaoksdjf@gmailasd.ca >> Message-ID: <4e5b6db295886_6a0482f465146412f@e4r.local.mail> >> Subject: Iscrizione completa! >> Mime-Version: 1.0 >> Content-Type: text/plain; >> charset=UTF-8 >> Content-Transfer-Encoding: 7bit >> > > Is this mail being sent/received on a DSL/Cable modem? Your ISP may be > filtering mail sent directly by your computer as an anti-spam measure. > > Since you entered an intentionally garbled address as a testing > measure, then your localhost might not have been able to forward it to > the next hop, and the error message may have come from whatever you > use for sendmail on your local computer. > > In the case of a well-formed message, your machine may have sent it on > to the next mailserver in the chain, which would be your ISP, and they > looked at it, decided you were not a real server, and dropped it on > the floor without comment. > > Now if you're sending from a real server with an MX record and > everything, then I have no idea. > > Walter Thank you for your reply. IMO what you say is likely, but right now it's somehow solved by itself :°) A pity though, I would have known where was the catch. Thanks Leo
on 2011-08-29 15:53
On Aug 29, 2011, at 9:16 AM, Leo M. wrote: >>> Subject: Iscrizione completa! >> >> looked at it, decided you were not a real server, and dropped it on > :) > A pity though, I would have known where was the catch. > > Thanks > Leo Given what happened, I have yet another theory: My ISP (Speakeasy) uses a method they call "graylisting" to cut down on spam. When they receive an e-mail from an unknown or untrusted server, they send back the WAIT(RandomNumberOfSeconds) command. Any real mail server knows what to do with that, and they do. SpamBot2000 running on infected Windows XP boxen (but I repeat myself!) don't, and the mail is dropped on the floor. You may have just encountered the RandomNumberOfSeconds here. When testing locally, I send to my MobileMe account, which seems to process all mail nearly instantaneously. My Speakeasy account and my Gmail account (which forwards into it) have the delay effect, so I never can tell if my mailer is working. Walter
Please log in before posting. Registration is free and takes only a minute.
Existing account
(Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
Log in with Google account | Log in with Yahoo account
No account? Register here.