FAQ
Hi everyone. I have been developing an app for quite some time on a local
machine here (OS X 10.4) which at various times throughout its life it needs
to send out e-mails. I have been using Catalyst::Plugin::Email to send
those e-mails, using authenticated SMTP from an e-mail account I have with
Rackspace. My configuration looks like this:

__PACKAGE__->config->{email} = [
'SMTP',
'my.smtp.server',
username => 'MyUsername',
password => 'MyPassword',
];

Then in my app, whenever I need to send an e-mail, I use:

$c->email(
header => [
From => '<me@mydomain.com> Me',
To => 'email@recipient.com',
Subject => 'The Subject.',
],
body => "$body",
);


It's been working great during development, I get all the e-mails when they
are supposed to be going out. The problem is that now that I am getting
close to finished, I have done a test deployment to my public web server
(CentOS 5.2), and now e-mails no longer get sent. I have verified that
Catalyst::Plugin::Email is installed, and that I have the correct config
information. Everything else about the app runs, and when it comes to a
place where an e-mail should go out, it gets by it with no problem, but yet
I never receive the e-mails. Also, I am unable to find any error log entry
that might point me in the right direction.

So my question is, first of all, is there something blindingly obvious I
might be missing during deployment? Is there anything else that needs to be
installed for Catalyst::Plugin::Email to work that I might not have
installed - but yet would not cause the app to fail at startup? And
finally, where should I look for any clues as to what is going on (like
error logs, etc...)?

Thanks for any help!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20091202/5ff3a6e7/attachment.htm

Search Discussions

  • Greg Matheson at Dec 3, 2009 at 12:23 am

    On Wed, 02 Dec 2009, Meeko wrote:

    Hi everyone. I have been developing an app for quite some time on a local
    machine here (OS X 10.4) which at various times throughout its life it needs
    to send out e-mails.
    It's been working great during development, I get all the e-mails when they
    are supposed to be going out. The problem is that now that I am getting
    close to finished, I have done a test deployment to my public web server
    (CentOS 5.2), and now e-mails no longer get sent.
    Is SELinux enabled? See the httpd_selinux manpage.
  • Meeko at Dec 3, 2009 at 1:51 am
    SELinux is disabled (see below). Also, on the same machine I have several
    other non-Catalyst perl apps that I use Net::SMTP to send e-mail with, and
    they work fine so I know that e-mail can get out on this machine. There's
    just something about Catalyst::Plugin::Email that is not sending them, and
    leaving no visible errors/warnings/logs that I can find to try to figure out
    why.

    [root@host ~]# /usr/sbin/sestatus
    SELinux status: disabled

    On Wed, Dec 2, 2009 at 7:23 PM, Greg Matheson wrote:
    On Wed, 02 Dec 2009, Meeko wrote:

    Hi everyone. I have been developing an app for quite some time on a local
    machine here (OS X 10.4) which at various times throughout its life it needs
    to send out e-mails.
    It's been working great during development, I get all the e-mails when they
    are supposed to be going out. The problem is that now that I am getting
    close to finished, I have done a test deployment to my public web server
    (CentOS 5.2), and now e-mails no longer get sent.
    Is SELinux enabled? See the httpd_selinux manpage.

    _______________________________________________
    List: Catalyst@lists.scsys.co.uk
    Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
    Searchable archive:
    http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
    Dev site: http://dev.catalyst.perl.org/
    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20091202/62e7c604/attachment.htm
  • Charlie Garrison at Dec 3, 2009 at 2:53 am
    Good afternoon,
    On 2/12/09 at 8:51 PM -0500, Meeko wrote:

    SELinux is disabled (see below). Also, on the same machine I have several
    other non-Catalyst perl apps that I use Net::SMTP to send e-mail with, and
    they work fine so I know that e-mail can get out on this machine. There's
    just something about Catalyst::Plugin::Email that is not sending them, and
    leaving no visible errors/warnings/logs that I can find to try to figure out
    why.
    How about wrapping the $c->email() statement in eval {} and
    checking for errors? I don't know if that will help but easy
    enough to test.

    Charlie

    --
    ? Charlie Garrison ? <garrison@zeta.org.au>
    ? PO Box 141, Windsor, NSW 2756, Australia

    O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
    http://www.ietf.org/rfc/rfc1855.txt
  • Meeko at Dec 3, 2009 at 5:54 am
    I did what you said, wrapping in an eval, and no errors occured. However, I
    think I have narrowed the problem down some. Here is what I have
    discovered:

    I changed the configuration of Catalyst::Plugin::Email to use an
    unauthenticated SMTP server which I own (I have relaying disabled, and only
    have the IP address of my web server on the allow relay domains - so its not
    an open relay). This is actually the SMTP server that my other non-Catalyst
    Net::SMTP scripts use. Well, needless to say, once I changed that the
    Catalyst app began happily sending e-mails with Catalyst::Plugin::Email I
    could keep it this way if I had to, but would rather not because I don't
    know how long I am going to keep this other mail server around. This was
    part of the reason why I began moving my e-mail activity to Rackspace, I
    don't want to have to deal with maintaining a mail server in the future.

    So anyway, back to Catalyst::Plugin::Email with authenticated SMTP...

    I think the issue I am having is actually with the username and passwords
    being sent encrypted in Base64. I have verified that I am able to perform
    an AUTH LOGIN on the Rackspace SMTP server from my web server by doing a
    telnet my.smtp.server 25; HELO host; AUTH LOGIN; <Base64 encoded Username>;
    <Base64 encoded Password>, and I get a 235 2.7.0 Authentication successful.
    So I know this web server is capable of authenticating on the SMTP server.

    So now my thoughts turn to, why would the username and password not be
    encoded properly with perl on my web server, but it does work on my Mac at
    home? Just as a quickie, I updated my MIME::Base64 to the newest version,
    and re-started. No such luck.

    Any other ideas on where to look next, now that I have been able to uncover
    more information?
    On Wed, Dec 2, 2009 at 9:53 PM, Charlie Garrison wrote:

    Good afternoon,


    On 2/12/09 at 8:51 PM -0500, Meeko wrote:

    SELinux is disabled (see below). Also, on the same machine I have several
    other non-Catalyst perl apps that I use Net::SMTP to send e-mail with, and
    they work fine so I know that e-mail can get out on this machine. There's
    just something about Catalyst::Plugin::Email that is not sending them, and
    leaving no visible errors/warnings/logs that I can find to try to figure
    out
    why.
    How about wrapping the $c->email() statement in eval {} and checking for
    errors? I don't know if that will help but easy enough to test.

    Charlie

    --
    � Charlie Garrison ♊ <garrison@zeta.org.au>
    〠 PO Box 141, Windsor, NSW 2756, Australia

    O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
    http://www.ietf.org/rfc/rfc1855.txt


    _______________________________________________
    List: Catalyst@lists.scsys.co.uk
    Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
    Searchable archive:
    http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
    Dev site: http://dev.catalyst.perl.org/
    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20091203/295982db/attachment.htm
  • Andy Betteridge at Dec 3, 2009 at 9:30 am
    Hi,

    Have you tried running a tcpdump on the session to see what's being sent to
    the mail server?


    Cheers,
    Andy.
    On Thu, Dec 3, 2009 at 5:54 AM, Meeko wrote:

    I did what you said, wrapping in an eval, and no errors occured. However,
    I think I have narrowed the problem down some. Here is what I have
    discovered:

    I changed the configuration of Catalyst::Plugin::Email to use an
    unauthenticated SMTP server which I own (I have relaying disabled, and only
    have the IP address of my web server on the allow relay domains - so its not
    an open relay). This is actually the SMTP server that my other non-Catalyst
    Net::SMTP scripts use. Well, needless to say, once I changed that the
    Catalyst app began happily sending e-mails with Catalyst::Plugin::Email I
    could keep it this way if I had to, but would rather not because I don't
    know how long I am going to keep this other mail server around. This was
    part of the reason why I began moving my e-mail activity to Rackspace, I
    don't want to have to deal with maintaining a mail server in the future.

    So anyway, back to Catalyst::Plugin::Email with authenticated SMTP...

    I think the issue I am having is actually with the username and passwords
    being sent encrypted in Base64. I have verified that I am able to perform
    an AUTH LOGIN on the Rackspace SMTP server from my web server by doing a
    telnet my.smtp.server 25; HELO host; AUTH LOGIN; <Base64 encoded Username>;
    <Base64 encoded Password>, and I get a 235 2.7.0 Authentication successful.
    So I know this web server is capable of authenticating on the SMTP server.

    So now my thoughts turn to, why would the username and password not be
    encoded properly with perl on my web server, but it does work on my Mac at
    home? Just as a quickie, I updated my MIME::Base64 to the newest version,
    and re-started. No such luck.

    Any other ideas on where to look next, now that I have been able to uncover
    more information?
    On Wed, Dec 2, 2009 at 9:53 PM, Charlie Garrison wrote:

    Good afternoon,


    On 2/12/09 at 8:51 PM -0500, Meeko wrote:

    SELinux is disabled (see below). Also, on the same machine I have several
    other non-Catalyst perl apps that I use Net::SMTP to send e-mail with,
    and
    they work fine so I know that e-mail can get out on this machine.
    There's
    just something about Catalyst::Plugin::Email that is not sending them,
    and
    leaving no visible errors/warnings/logs that I can find to try to figure
    out
    why.
    How about wrapping the $c->email() statement in eval {} and checking for
    errors? I don't know if that will help but easy enough to test.

    Charlie

    --
    � Charlie Garrison ♊ <garrison@zeta.org.au>
    〠 PO Box 141, Windsor, NSW 2756, Australia

    O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
    http://www.ietf.org/rfc/rfc1855.txt


    _______________________________________________
    List: Catalyst@lists.scsys.co.uk
    Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
    Searchable archive:
    http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
    Dev site: http://dev.catalyst.perl.org/

    _______________________________________________
    List: Catalyst@lists.scsys.co.uk
    Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
    Searchable archive:
    http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
    Dev site: http://dev.catalyst.perl.org/
    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20091203/c6855727/attachment.htm
  • Alexander Hartmaier at Dec 3, 2009 at 10:02 am
    You shouldn't use C::P::Email any more, there is no need for that
    function to be a Catalyst plugin.

    Take a look at Catalyst::View::Email(::Template) instead!

    --
    Best regards, Alex


    Am Mittwoch, den 02.12.2009, 21:46 +0100 schrieb Meeko:
    Hi everyone. I have been developing an app for quite some time on a
    local machine here (OS X 10.4) which at various times throughout its
    life it needs to send out e-mails. I have been using
    Catalyst::Plugin::Email to send those e-mails, using authenticated
    SMTP from an e-mail account I have with Rackspace. My configuration
    looks like this:

    __PACKAGE__->config->{email} = [
    'SMTP',
    'my.smtp.server',
    username => 'MyUsername',
    password => 'MyPassword',
    ];

    Then in my app, whenever I need to send an e-mail, I use:

    $c->email(
    header => [
    From => '<me@mydomain.com> Me',
    To => 'email@recipient.com',
    Subject => 'The Subject.',
    ],
    body => "$body",
    );


    It's been working great during development, I get all the e-mails when
    they are supposed to be going out. The problem is that now that I am
    getting close to finished, I have done a test deployment to my public
    web server (CentOS 5.2), and now e-mails no longer get sent. I have
    verified that Catalyst::Plugin::Email is installed, and that I have
    the correct config information. Everything else about the app runs,
    and when it comes to a place where an e-mail should go out, it gets by
    it with no problem, but yet I never receive the e-mails. Also, I am
    unable to find any error log entry that might point me in the right
    direction.

    So my question is, first of all, is there something blindingly obvious
    I might be missing during deployment? Is there anything else that
    needs to be installed for Catalyst::Plugin::Email to work that I might
    not have installed - but yet would not cause the app to fail at
    startup? And finally, where should I look for any clues as to what is
    going on (like error logs, etc...)?

    Thanks for any help!

    *"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
    T-Systems Austria GesmbH Rennweg 97-99, 1030 Wien
    Handelsgericht Wien, FN 79340b
    *"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
    Notice: This e-mail contains information that is confidential and may be privileged.
    If you are not the intended recipient, please notify the sender and then
    delete this e-mail immediately.
    *"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*
  • Kieren Diment at Dec 3, 2009 at 11:38 am

    On Thu, Dec 3, 2009 at 9:02 PM, Alexander Hartmaier wrote:
    You shouldn't use C::P::Email any more, there is no need for that
    function to be a Catalyst plugin.

    Take a look at Catalyst::View::Email(::Template) instead!
    I agree. There's a working example with
    Catalyst::View::Email::Template in chapter 11 of the book (source code
    available from here: http://www.apress.com/book/view/1430223650 )

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcatalyst @
categoriescatalyst, perl
postedDec 2, '09 at 8:46p
activeDec 3, '09 at 11:38a
posts8
users6
websitecatalystframework.org
irc#catalyst

People

Translate

site design / logo © 2022 Grokbase