# Problem. MailerBehaviour in eApps

**URL:** <https://www.ruby-forum.com/t/problem-mailerbehaviour-in-eapps/83706>\
**Category:** Radiant CMS\
**Created:** [January 29, 2007, 1:48am UTC](https://www.ruby-forum.com/t/problem-mailerbehaviour-in-eapps/83706 "2007-01-29T01:48:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brian\_Sam-Bodden](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/4da419/32.png) [@Brian\_Sam-Bodden](https://www.ruby-forum.com/u/Brian_Sam-Bodden)\
**Post date:** [January 29, 2007, 1:48am UTC](https://www.ruby-forum.com/t/problem-mailerbehaviour-in-eapps/83706/1 "2007-01-29T01:48:40Z")

</div>

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](http://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: removed\_email\_address@domain.invalid  
redirect\_to: /en/contact/thank-you  
recipients:  
- removed\_email\_address@domain.invalid

# body part:

# body part

## Contact us

Your **name** :

Your **email** :

Your **comments** :

- 
- Cancel

# 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”=\>“removed\_email\_address@domain.invalid”},  
“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](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 😉

Any help will be appreciated.

Cheers,  
Brian

---

<div class="post-metadata">

**Author:** ![Brian\_Sam-Bodden](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/4da419/32.png) [@Brian\_Sam-Bodden](https://www.ruby-forum.com/u/Brian_Sam-Bodden)\
**Post date:** [January 29, 2007, 1:35pm UTC](https://www.ruby-forum.com/t/problem-mailerbehaviour-in-eapps/83706/2 "2007-01-29T13:35:51Z")

</div>

Brian,

Here’s my settings on Eapps-

config.action\_mailer.server\_settings = {  
:address =\> “127.0.0.1”,  
:port =\> 25,  
:domain =\> “[example.com](http://example.com)”,  
:authentication =\> :login,  
:user\_name =\> “blah”,  
:password =\> “blah”,  
}  
config.action\_mailer.perform\_deliveries = true

> # admin part:
> 
> mailers:  
> contact:  
> subject: Contact Request  
> from: removed\_email\_address@domain.invalid  
> redirect\_to: /en/contact/thank-you  
> recipients:  
> - removed\_email\_address@domain.invalid

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](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 [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

---

<div class="post-metadata">

**Author:** ![Brian\_Sam-Bodden](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/4da419/32.png) [@Brian\_Sam-Bodden](https://www.ruby-forum.com/u/Brian_Sam-Bodden)\
**Post date:** [February 1, 2007, 4:15pm UTC](https://www.ruby-forum.com/t/problem-mailerbehaviour-in-eapps/83706/3 "2007-02-01T16:15:43Z")

</div>

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](http://integrallis.com)  
MAIL FROM: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
RCPT TO: [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
DATA  
Subject: Test  
From: removed\_email\_address@domain.invalid  
To: removed\_email\_address@domain.invalid  
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](http://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=[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid), size=113, class=0, nrcpts=1,  
msgid=[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid),  
proto=SMTP, [relay=integrallis.virtual.vps-host.net](http://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](http://integrallis.virtual.vps-host.net): domain of  
removed\_email\_address@domain.invalid designates 127.0.0.1 as permitted sender)  
[receiver=integrallis.virtual.vps-host.net](http://receiver=integrallis.virtual.vps-host.net); client-ip=127.0.0.1;  
[helo=integrallis.com](http://helo=integrallis.com); envelope-from=removed\_email\_address@domain.invalid;  
x-software=spfmilter 0.97 [spfmilter](http://www.acme.com/software/spfmilter/) with  
libspf2-1.0.0;  
Jan 31 23:10:07 integrallis sendmail[5918]: l1147vJL001407:  
to=[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid), delay=00:00:57, xdelay=00:00:02,  
mailer=esmtp, pri=120113, [relay=mxmail.register.com](http://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=[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid),  
relay=root@localhost  
Jan 31 23:12:55 integrallis sendmail[10032]: l114CtPM010032: from=root,  
size=0, class=0, nrcpts=0,  
msgid=[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid),  
relay=root@localhost  
Jan 31 23:14:35 integrallis sendmail[12212]: l114EZ8o012212: from=root,  
size=0, class=0, nrcpts=0,  
msgid=[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid),  
relay=root@localhost  
Jan 31 23:14:39 integrallis sendmail[12250]: l114Ednt012250: from=root,  
size=0, class=0, nrcpts=0,  
msgid=[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid),  
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](http://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](http://example.com)”,  
> :authentication =\> :login,  
> :user\_name =\> “blah”,  
> :password =\> “blah”,  
> }  
> config.action\_mailer.perform\_deliveries = true
> 
> > # admin part:
> > 
> > mailers:  
> > contact:  
> > subject: Contact Request  
> > from: removed\_email\_address@domain.invalid  
> > redirect\_to: /en/contact/thank-you  
> > recipients:  
> > - removed\_email\_address@domain.invalid
> 
> 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](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 [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):
