Problem. MailerBehaviour in eApps

After hours of playing with the Mailer behaviour on my eApps virtual
server I’m about to give up and find other way to do a contact form. The
email does not get delivered. So in case anybody can see any flaws in my
setup here it is…

environment.rb

Configure ActionMailer

ActionMailer::Base.delivery_method = :smtp
ActionMailer::Base.server_settings = {
:address => “mail.integrallis.com”,
:port => 587,
:domain => “xxxxxxxxxxxxxxx”,
:user_name => “xxxxxxxx”,
:password => “xxxxxxxxxx”,
:authentication => :login
}

I have tested this sending email from this smtp server using a mail
client.

In my contacts page I have:

admin part:

mailers:
contact:
subject: Contact Request
from: [email protected]
redirect_to: /en/contact/thank-you
recipients:
- [email protected]

body part:

body part

Contact us

Your name:

Your email:

Your comments:

email part:

Name: <r:mailer:get name=“name” />
Email: <r:mailer:get name=“email” />
Comments: <r:mailer:get name=“comments” />

Here what I see on my production.log

Processing SiteController#show_page (for 69.218.201.157 at 2007-01-28
17:56:17) [POST]
Parameters: {“mailer”=>{“name”=>“test”, “comments”=>“test”,
“subject”=>“Contact Request!”, “email”=>“[email protected]”},
“action”=>“show_page”, “url”=>[“en”, “contact”],
“mailer_name”=>“contact”, “controller”=>“site”}
Completed in 0.04633 (21 reqs/sec) | DB: 0.00970 (20%) | 200 OK
[http://www.integrallis.com/en/contact]

I’ve search all my other logs but don’t see any errors.

A couple of questions:

  • Is there an easy way to test ActionMailer?
  • I’m using a lightbox for the contact form and the redirect doesn’t
    seem to work. I always get the contact form after the post which is not
    what I want, I want the page that launched the contact form.
  • And of course getting an email delivered would be nice :wink:

Any help will be appreciated.

Cheers,
Brian

Brian,

Here’s my settings on Eapps-

config.action_mailer.server_settings = {
:address => “127.0.0.1”,
:port => 25,
:domain => “example.com”,
:authentication => :login,
:user_name => “blah”,
:password => “blah”,
}
config.action_mailer.perform_deliveries = true

admin part:

mailers:
contact:
subject: Contact Request
from: [email protected]
redirect_to: /en/contact/thank-you
recipients:
- [email protected]

This should be “config” part, right, not “admin”?

and it’s YAML, so it’s white space sensitive-

mailers:
contact:
subject

Make sure, it’s exactly (whitespace wise) like:
http://mattmccray.com/svn/rails/plugins/radiant_mailer_behavior/README

Another good log to check is /var/log/maillog - this will tell you about
un/sucessful mail send attempts.

Hope this helps,
Todd

Quoting Brian Sam-Bodden [email protected]:

Todd,
Thanks for the reply. I took a few days off from messing with this.
One thing that I am noticing is that when I SSH into the virtual server
and send a test email using telnet like (noticed that I didn’t use AUTH
LOGIN):

telnet 127.0.0.1 25
HELO integrallis.com
MAIL FROM: [email protected]
RCPT TO: [email protected]
DATA
Subject: Test
From: [email protected]
To: [email protected]
A simple test

.
QUIT

I see this in the /var/log/maillog

Jan 31 23:07:37 integrallis sendmail[32499]: l1147Q0U032499:
integrallis.virtual.vps-host.net [127.0.0.1] did not issue
MAIL/EXPN/VRFY/ETRN during connection to stdin
Jan 31 23:10:05 integrallis sendmail[1407]: l1147vJL001407:
from=[email protected], size=113, class=0, nrcpts=1,
msgid=[email protected],
proto=SMTP, relay=integrallis.virtual.vps-host.net [127.0.0.1]
Jan 31 23:10:05 integrallis sendmail[1407]: l1147vJL001407: Milter add:
header: Received-SPF: pass (integrallis.virtual.vps-host.net: domain of
[email protected] designates 127.0.0.1 as permitted sender)
receiver=integrallis.virtual.vps-host.net; client-ip=127.0.0.1;
helo=integrallis.com; [email protected];
x-software=spfmilter 0.97 spfmilter with
libspf2-1.0.0;
Jan 31 23:10:07 integrallis sendmail[5918]: l1147vJL001407:
to=[email protected], delay=00:00:57, xdelay=00:00:02,
mailer=esmtp, pri=120113, relay=mxmail.register.com. [205.158.62.41],
dsn=2.0.0, stat=Sent (Ok: queued as 980094A446E)

but when I try to send an email with the mailer behaviour I get
something like:

Jan 31 23:12:51 integrallis sendmail[9959]: l114CpQj009959: from=root,
size=0, class=0, nrcpts=0,
msgid=[email protected],
relay=root@localhost
Jan 31 23:12:55 integrallis sendmail[10032]: l114CtPM010032: from=root,
size=0, class=0, nrcpts=0,
msgid=[email protected],
relay=root@localhost
Jan 31 23:14:35 integrallis sendmail[12212]: l114EZ8o012212: from=root,
size=0, class=0, nrcpts=0,
msgid=[email protected],
relay=root@localhost
Jan 31 23:14:39 integrallis sendmail[12250]: l114Ednt012250: from=root,
size=0, class=0, nrcpts=0,
msgid=[email protected],
relay=root@localhost

I tried taking out the :authentication, :user_name and :password from my
ActionMailer config but that didn’t work either. Also noticed that
before I still had action_mailer in the frameworks to skip (doh!). So I
changed that to:

Skip frameworks you’re not going to use

config.frameworks -= [ :action_web_service ]

and my ActionMailer configuration now looks like:

Configure ActionMailer

ActionMailer::Base.raise_delivery_errors = true
ActionMailer::Base.delivery_method = :smtp
ActionMailer::Base.perform_deliveries = true
ActionMailer::Base.server_settings = {
:address => “127.0.0.1”,
:port => 25,
:domain => “integrallis.com”,
:user_name => “sender”,
:password => “********”,
:authentication => :login
}

Yet the emails are still not being delivered. This is just bizarre to
say the least. Next thing I’m gonna try is to change the delivery_method
form :smtp to whatever it is that let’s you go against sendmail
directly. If you have any more ideas I’ll love to hear them.

Thanks,
Brian

Todd McGrath wrote:

Brian,

Here’s my settings on Eapps-

config.action_mailer.server_settings = {
:address => “127.0.0.1”,
:port => 25,
:domain => “example.com”,
:authentication => :login,
:user_name => “blah”,
:password => “blah”,
}
config.action_mailer.perform_deliveries = true

admin part:

mailers:
contact:
subject: Contact Request
from: [email protected]
redirect_to: /en/contact/thank-you
recipients:
- [email protected]

This should be “config” part, right, not “admin”?

and it’s YAML, so it’s white space sensitive-

mailers:
contact:
subject

Make sure, it’s exactly (whitespace wise) like:
http://mattmccray.com/svn/rails/plugins/radiant_mailer_behavior/README

Another good log to check is /var/log/maillog - this will tell you about
un/sucessful mail send attempts.

Hope this helps,
Todd

Quoting Brian Sam-Bodden [email protected]: