[Catalyst] Requesting example code for postfix and Email::Sender

Dave Rolsky autarch at urth.org
Mon Mar 21 21:46:49 GMT 2011

On Mon, 21 Mar 2011, Kutbuddin Doctor wrote:

> I am looking for an example of how to configure catalyst to use postfix on 
> localhost to send email (mostly application notifications) via catalyst.
> And especially example code from someone who has done this successfully. I 
> have seen several recommendations for using Email::Sender with catalyst but 
> no examples of how to do this with postfix running locally. All of the 
> Transport examples are either SMTP or sendmail. The rest of 
> Email::Sender::Transport CPAN documentation is very sparse.

As Will pointed out in his email, you're overthinking this.

However, I think his suggestion that you connect to port 25 is a poor 
choice. The problem here is that this assumes that the server will always 
answer and be able to process the SMTP request.

That's a bad assumption. You could check the SMTP request status and 
retry, or you could make your life a lot easier, and use the sendmail 
binary. This isn't Sendmail specific since basically every mail server 
provides the same implementation of a binary called "sendmail".

Usually, this will be implemented as something that just writes a file to 
the server's mail queue, without relying on the server actually running. 
The server will pick it up when it runs, and will handle it from there.

TL;DR - Use Email::Sender::Transport::Sendmail unless you have a really 
good reason to use something else.


http://VegGuide.org               http://blog.urth.org
Your guide to all that's veg      House Absolute(ly Pointless)

More information about the Catalyst mailing list