Re: [Catalyst] Sending Email from Page?

2011-03-21 Thread Octavian Rasnita

From: "John M. Dlugosz" 
On 3/21/2011 2:47 PM, Octavian Rasnita orasnita-at-gmail.com 
|Catalyst/Allow to home| wrote:


If you use that key, the module won't report the error. If you don't use 
it and there will appear some errors, it will generate a detailed error. 
The error is generated by Email::Sender::Simple directly.


It will be something like "unable to establish SMTP connection" plus ~ 1 
kB of error trace.


I found it; thanks.  I started a discussion on PerlMonks because $@ was 
empty, even though letting the program die instead showed all the error 
info.  You must use Try::Tiny to try/catch around it.




I prefered to use send() or try_to_send() depending on the user's 
preference - if he wants or not to have the errors reported, but yes, using 
Try::Tiny may be a good alternative that should be investigated.


Octavian



___
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/


Re: [Catalyst] Sending Email from Page?

2011-03-21 Thread Octavian Rasnita

From: "John M. Dlugosz" 
On 3/21/2011 2:41 PM, Octavian Rasnita orasnita-at-gmail.com 
|Catalyst/Allow to home| wrote:


If you want this, it is more simple, because you can try to send the 
message directly, but if the message is not sent, your page visitors will 
be able to read that a certain message was not sent, but they won't be 
able to do anything to send it, unless they try again, by filling again a 
subscription form or something like that.


So don't tell them it wasn't sent; just drop it on the floor instead, 
because it would just confuse them?


I'm not expecting any errors once the deployment is shaken-out, but my 
feedback message states that it was not sent and suggests using the mailto 
link instead (and hyperlinks it within the message).  And the form is 
still shown filled out, so the person can copy/paste his content to a file 
to save, rather than losing it.




This is the job of a... job queue. It tries to send the message or execute 
another task you give it, and if it can't execute it, it marks it as 
not-executed and you will be able to see later the errors found. This way 
you can put it to try for more times to do that job automaticly.


But as I said, if you have the mail server running on the same server and if 
you just need to send a single message, you don't need a job queue. If you 
need to send thousands of messages after you have made a selection of the 
recipients from a database, it might take less time to insert a few 
thousands records in a database than to send those messages directly.


So sending the messages directly is not very scalable.

Octavian


___
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/


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

2011-03-21 Thread Andrew Rodland
On Monday, March 21, 2011 09:12:52 PM John M. Dlugosz wrote:
> On 3/21/2011 4:46 PM, Dave Rolsky autarch-at-urth.org |Catalyst/Allow to 
home| wrote:
> > 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.
> 
> Ah, that's very good to know.
> 
> However, I don't seem to have a program called 'sendmail' on the path.
> I had installed Postfix via the Debian package.

The postfix debian package installs sendmail as /usr/sbin/sendmail which isn't 
on the path for non-root users by default. Not sure why, exactly.

Andrew

___
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/


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

2011-03-21 Thread John M. Dlugosz
On 3/21/2011 9:07 PM, Andrew Rodland andrew-at-cleverdomain.org |Catalyst/Allow to home| 
wrote:

There doesn't need to be any "instead of". The email view doesn't set any
response body, so the default view will still run later on by whatever means
usually runs it (i.e. RenderView).



I thought "forward" was like a redirect, in that it stopped working here and went there 
instead.
The examples are misleading, as that is the last line in the body!  I see from the docs 
that forward is indeed a "call"


___
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/


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

2011-03-21 Thread John M. Dlugosz

On 3/21/2011 4:46 PM, Dave Rolsky autarch-at-urth.org |Catalyst/Allow to home| 
wrote:
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.


Ah, that's very good to know.

However, I don't seem to have a program called 'sendmail' on the path.
I had installed Postfix via the Debian package.

___
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/


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

2011-03-21 Thread Denny
On Mon, 2011-03-21 at 20:56 -0500, John M. Dlugosz wrote:
> I didn't like that one (the mail view) because I don't follow: if your 
> function sends 
> email instead of generating a web page, what happens to the UA on the other 
> end of the 
> network who triggered that URL?

It's not instead of, it's as well as.  The forward to the Email view
sends the email, but the method it is called from still does whatever it
does.



signature.asc
Description: This is a digitally signed message part
___
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/


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

2011-03-21 Thread Andrew Rodland
On Monday, March 21, 2011 08:56:55 PM John M. Dlugosz wrote:
> On 3/21/2011 1:37 PM, will trillich will.trillich-at-serensoft.com
> |Catalyst/Allow to
> 
> home| wrote:
> > $c->stash->{*email*} = {
> > 
> >  from   =>  $c->config->{email_from},
> >  'reply-to' =>  $c->user->email_name,
> >  to =>  $c->user->email_name,
> >  cc =>  join(',', @cc),
> >  subject=>  $subj,
> >  body   =>  $message,
> > 
> > };
> > $c->forward( $c->view('Email') );
> 
> I didn't like that one (the mail view) because I don't follow: if your
> function sends email instead of generating a web page, what happens to the
> UA on the other end of the network who triggered that URL?

There doesn't need to be any "instead of". The email view doesn't set any 
response body, so the default view will still run later on by whatever means 
usually runs it (i.e. RenderView).

Andrew

___
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/


Re: [Catalyst] Sending Email from Page?

2011-03-21 Thread John M. Dlugosz

On 3/21/2011 2:47 PM, Octavian Rasnita orasnita-at-gmail.com |Catalyst/Allow to 
home| wrote:


If you use that key, the module won't report the error. If you don't use it and 
there will appear some errors, it will generate a detailed error. The error is 
generated by Email::Sender::Simple directly.

It will be something like "unable to establish SMTP connection" plus ~ 1 kB of 
error trace.


I found it; thanks.  I started a discussion on PerlMonks because $@ was empty, even though 
letting the program die instead showed all the error info.  You must use Try::Tiny to 
try/catch around it.


___
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/


Re: [Catalyst] Sending Email from Page?

2011-03-21 Thread John M. Dlugosz

On 3/21/2011 2:41 PM, Octavian Rasnita orasnita-at-gmail.com |Catalyst/Allow to 
home| wrote:


If you want this, it is more simple, because you can try to send the message 
directly, but if the message is not sent, your page visitors will be able to 
read that a certain message was not sent, but they won't be able to do anything 
to send it, unless they try again, by filling again a subscription form or 
something like that.

So don't tell them it wasn't sent; just drop it on the floor instead, because it would 
just confuse them?


I'm not expecting any errors once the deployment is shaken-out, but my feedback message 
states that it was not sent and suggests using the mailto link instead (and hyperlinks it 
within the message).  And the form is still shown filled out, so the person can copy/paste 
his content to a file to save, rather than losing it.


___
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/


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

2011-03-21 Thread John M. Dlugosz
On 3/21/2011 1:37 PM, will trillich will.trillich-at-serensoft.com |Catalyst/Allow to 
home| wrote:

$c->stash->{*email*} = {
 from   =>  $c->config->{email_from},
 'reply-to' =>  $c->user->email_name,
 to =>  $c->user->email_name,
 cc =>  join(',', @cc),
 subject=>  $subj,
 body   =>  $message,
};
$c->forward( $c->view('Email') );



I didn't like that one (the mail view) because I don't follow: if your function sends 
email instead of generating a web page, what happens to the UA on the other end of the 
network who triggered that URL?


___
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/


Re: [Catalyst] Sending Email from Page?

2011-03-21 Thread John M. Dlugosz
On 3/21/2011 11:45 AM, Kutbuddin Doctor ksdoctor-at-sanfordburnham.org |Catalyst/Allow to 
home| wrote:

Can someone post instructions for using postfix withing catalyst?

I have been seeing several (earlier) posts recommending Email::Sender.
I see instructions in Email::Sender for SMTP and sendmail, but no config options for 
postfix. I was only able to find Postfix mentioned in unrelated Perl modules 
(Mail::Postfix::Postdrop).


So if you have a local postfix running, how do you send an email to that service from 
within catalyst? I'm hoping the example will show how to setup connections to server in 
MyApp.pm and use it throughout the catalyst application.


Nothing to it:  I just used the NMTP option in Sender or whatever fancier module defers to 
it (I'm usig Mail::Builder::Simple).  I think the default 'sendmail' would just call it, 
too.  If some mail server is running locally and listening to the usual ports, it should work!


For Postfix, the relevant option is

smtpd_recipient_restrictions= ... ,permit_mynetworks, ...

which allows it to accept mail from a server on the same machine without pestering for a 
password or client certificate or anything.


I also had to make sure the submitted email was "just right", as my rules are rather 
picky.  The error messages are clear: need full From address, etc.


--John



___
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/


Re: [Catalyst] Sending Email from Page?

2011-03-21 Thread John M. Dlugosz
On 3/21/2011 9:16 AM, Jorge Gonzalez jorge.gonzalez-at-daikon.es |Catalyst/Allow to home| 
wrote:
I really don't see the point in using an Email model. Just use the email sending module 
from the controller (Mail::Builder::Simple or whatever) and setup a local postfix which 
accepts outbound emails from local connections, and you're done. All queuing will be 
done by postfix, where it belongs.

My feelings exactly.



You need to install a local mail server so that the Catalyst app does not get stuck 
trying to send. We can assume that messages sent from localhost will be handed over to 
the local MTA pretty quickly (besides corner cases like full mailspool and the like). 
This MTA can be a full-blown one, or one configured to use use a smart host.
I have Postfix on that server already.  I found it was easy to add a rule to accept 
connections from the local machine (as well as the existing rule for accepting 
authenticated connections) without adding another socket.  I'm not expecting it to handle 
a big load.  But I think I understand the point: set up a server that doesn't have much to 
do, and have it forward to the larger system.  Rather than a separate queueing process, 
Postfix _is_ such a queue process; just use another one of those.




Catalyst offers you some posibilities, but it does not force you to use them. To me, 
using a model for sending email is like hammering a nail with a screw driver. You can 
surely do it, but it's simpler to use the hammer. Even if you have a fancy screw driver. 
:-)
I might want to make it easy to change the email address the form directs to, without 
having it in the Controller PM file.  I'm sure I can add my own sections to the config 
without having to make a class to receive them, right?  I really need to understand the 
config better.


Thanks for the tips.


___
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/


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

2011-03-21 Thread Charlie Garrison

Good morning,

On 21/03/11 at 11:17 AM -0700, Kutbuddin Doctor 
 wrote:



All of the Transport examples are either SMTP or sendmail.


Postfix is sendmail compatibile as far as injecting into the 
local mail queue. All distros I've seen for postfix will replace 
`sendmail` with a version that injects into postfix queue.


So that's why you haven't found any docco specific to using 
postfix; it's the same as using sendmail.



Charlie

--
   Ꮚ Charlie Garrison ♊ 

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/


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

2011-03-21 Thread Dave Rolsky

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.



-dave

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

___
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/


Re: [Catalyst] Sending Email from Page?

2011-03-21 Thread Octavian Rasnita
From: "John M. Dlugosz" 
> Reading the page for Catalyst::Helper::Model::Email, and assuming that a ')' 
> keeps getting 
> lost, it's just a simple to use but you look up an object via Model first.  
> What is the 
> benefit of that?  I suppose you can have more than one configuration pre-set, 
> but I don't 
> see that happening.  Is there some other advantage or conceptional purpose 
> for making a 
> "feature" or "content sink" or "side effect call" presented as a Model?


Yes you can define more email models, one for sending with Gmail, another one 
with your SMTP server and so on.

But the most important thing is that you can use the same configuration files 
and the same syntax for sending email from Catalyst and from a cron job.

Catalyst is just a glue and you can use Mail::Builder::Simple very easy in 
Catalyst directly.
Catalyst::Helper::Model::Email is helpful just because it allows you to use the 
configuration from your models or from the configuration file of your app and 
you can share that configuration among different Catalyst controllers and 
standalone programs which are ran as cron jobs.

(And if you need to send UTF-8 encoded messages, you also don't need to do the 
encoding nor to create the MIME headers yourself.)

>> The most simple way is not the best. The best way is to send the messages in 
>> a job queue 
>> and let the worker module to send the message immediately or whenever the 
>> mail server is 
>> free.
>> If you send the message directly from your application, in that moment the 
>> server might 
>> not be free and the user would need to wait too much until the message is 
>> sent, or the 
>> mail server might give a timeout and in that case the message is lost 
>> because the 
>> application doesn't send it again when the mail server is free.
> 
> I like being able to get a return result so I know it was sent!
> If that is not possible on a real server, is there some module already that 
> does this?

If you want this, it is more simple, because you can try to send the message 
directly, but if the message is not sent, your page visitors will be able to 
read that a certain message was not sent, but they won't be able to do anything 
to send it, unless they try again, by filling again a subscription form or 
something like that.



> Hmm, maybe it depends on the mailer used?  Postfix just queues the incoming 
> message 
> anyway!  Why am I needing to duplicate what it already does?  Would another 
> queue process 
> in front of it be less likely to get stuck?

If the mail server is running locally, not on another server, and if you are 
sure that it runs fine, then you don't need a job queue.

Octavian



___
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/


Re: [Catalyst] Sending Email from Page?

2011-03-21 Thread Octavian Rasnita
From: "Jorge Gonzalez" 
> Catalyst offers you some posibilities, but it does not force you to use 
> them. To me, using a model for sending email is like hammering a nail 
> with a screw driver. You can surely do it, but it's simpler to use the 
> hammer. Even if you have a fancy screw driver. :-)
> 
> Regards
> J.

Yes, it is very simple to use Mail::Builder::Simple directly, but there are 
some advantages when using it in a model:

- You can share the configuration data among more controllers and even external 
programs;

- You need to write less code in your controllers;

- It is more elegant, because it uses the Catalyst style - you don't need to 
"use Mail::Builder::Simple" in every controller in which you need to send 
mail...

You can send email by just using:

$c->model( 'Email' )->send(
from => ['m...@myhost.com', 'My Name'],  #This line can be also defined in 
the configuration file and not here
to => 'someb...@anotherhost.net',
subject => 'The subject',
htmltext => 'Hello world',
attachment => $c->uri_for('/path/to/attachment.pdf'),
);

Octavian


___
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/


Re: [Catalyst] Sending Email from Page?

2011-03-21 Thread Octavian Rasnita
From: "John M. Dlugosz" 
> On 3/21/2011 1:48 AM, Octavian Rasnita orasnita-at-gmail.com |Catalyst/Allow 
> to home| wrote:
>>
>> You can use any of them or Catalyst::Helper::Model::Email. The plugin is no 
>> longer 
>> recommended.
> 
> It looks like "helper" just installs a dummy Model that calls 
> Mail::Builder::Simple.  So I 
> thought I'd just call that.  But, there is no documentation as to the return 
> value, and 
> the code appears to return 1 if it makes it to the end.  But what does it 
> return on error, 
> and where is the error particulars?


In Mail::Builder::Simple you can find about "live_on_error".

If you use that key, the module won't report the error. If you don't use it and 
there will appear some errors, it will generate a detailed error. The error is 
generated by Email::Sender::Simple directly.

It will be something like "unable to establish SMTP connection" plus ~ 1 kB of 
error trace.

Octavian


___
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/


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

2011-03-21 Thread will trillich
You're probably overthinking this. :)

Whether it's postfix or exim or any other daemon really shouldn't matter.
Your code will connect to SMTP server "localhost" on port "25". If you can
send an email from the command line (via 'mutt' or 'mail' etc) then you
should be ready to go:

First

$ *script/myapp_create.pl view Email Email*

Then

#myapp.conf

stash_key= *email*

content_type = text/plain
charset  = utf-8



Then in a controller...

$c->stash->{*email*} = {
from   => $c->config->{email_from},
'reply-to' => $c->user->email_name,
to => $c->user->email_name,
cc => join(',', @cc),
subject=> $subj,
body   => $message,
};
$c->forward( $c->view('Email') );

Note on the manpage (below) that it will default to LOCALHOST and SMTP
unless you specify otherwise
http://search.cpan.org/~dhoss/Catalyst-View-Email-0.31/lib/Catalyst/View/Email.pm


On Mon, Mar 21, 2011 at 6:17 PM, Kutbuddin Doctor <
ksdoc...@sanfordburnham.org> 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.
>
> Thanks for the help!
>
> cheers,
> Kutbuddin
>
> --
>
>
>
>
>
>
> ___
> 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/
>



-- 
11 cheers for binary!
___
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/


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

2011-03-21 Thread Kutbuddin Doctor
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.


Thanks for the help!

cheers,
Kutbuddin

--






___
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/


Re: [Catalyst] Sending Email from Page?

2011-03-21 Thread Peter Edwards
On 21 March 2011 16:45, Kutbuddin Doctor wrote:

> Can someone post instructions for using postfix withing catalyst?
>
> I have been seeing several (earlier) posts recommending Email::Sender.
> I see instructions in Email::Sender for SMTP and sendmail, but no config
> options for postfix. I was only able to find Postfix mentioned in unrelated
> Perl modules (Mail::Postfix::Postdrop).
>
>
It's a Unix sysadmin task to set up Postfix (or another mail system [1]) ,
it's not really anything to do with Perl programming
http://www.postfix.org/docs.html

Once you have a mail server listening on localhost you can then send to it
using Email::Sender.

Regards, Peter
1. http://en.wikipedia.org/wiki/Comparison_of_mail_servers
___
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/


Re: [Catalyst] GSOC Flyer for participation

2011-03-21 Thread Julien Sobrier
BTW, does anybody have any contact at perlfoundation.org? Their
website is used for spam. For example:
http://www.perlfoundation.org/data/workspaces/perl6/attachments/credy:20110321123553-19-10773/files/log21.html

Julien

On Mon, Mar 21, 2011 at 6:33 AM, Mark Keating  wrote:
> Further to my previous email, there is a flyer available as a pdf at:
>
> http://www.community.markkeating.me.uk/promotion/GSOC-2011-Flyer.pdf
>
> This can be printed out and displayed on notice boards or handed to students
> in your area, if you have a couple of hours to print these out and
> distribute them in appropriate locations it would be much appreciated.
>
> Kind regards
>
> Mark
>
> --
> Mark Keating BA (Hons)          |  Writer, Photographer, Cat-Herder
> Managing Director               |  Shadowcat Systems Limited
> Director/Secretary              |  Enlightened Perl Organisation
> co-Leader                       |  North West England Perl Mongers
> http://www.shadowcat.co.uk      |  http://www.enlightenedperl.org
> http://northwestengland.pm.org  |  http://linkedin.com/in/markkeating
>
>
> ___
> 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/


Re: [Catalyst] Sending Email from Page?

2011-03-21 Thread Bill Moseley
On Sun, Mar 20, 2011 at 11:48 PM, Octavian Rasnita wrote:

> From: "John M. Dlugosz" 
>
>  Any pointers as to the right (or best) way to send an email from my
>> Catalyst App?
>> I see there is a Plugin::Email and also a View::Email, which seems to be
>> something totally different?
>>
>
> You can use any of them or Catalyst::Helper::Model::Email. The plugin is no
> longer recommended.
>
> The most simple way is not the best. The best way is to send the messages
> in a job queue and let the worker module to send the message immediately or
> whenever the mail server is free.
>

That's good advice in general.  But, in a lot of ways mail, using a local
MTA, fits that role.



> If you send the message directly from your application, in that moment the
> server might not be free and the user would need to wait too much until the
> message is sent, or the mail server might give a timeout and in that case
> the message is lost because the application doesn't send it again when the
> mail server is free.
>  Octavian
>
>
>
> ___
> 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/
>



-- 
Bill Moseley
mose...@hank.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/


Re: [Catalyst] Sending Email from Page?

2011-03-21 Thread Kutbuddin Doctor

Can someone post instructions for using postfix withing catalyst?

I have been seeing several (earlier) posts recommending Email::Sender.
I see instructions in Email::Sender for SMTP and sendmail, but no config 
options for postfix. I was only able to find Postfix mentioned in 
unrelated Perl modules (Mail::Postfix::Postdrop).


So if you have a local postfix running, how do you send an email to that 
service from within catalyst? I'm hoping the example will show how to 
setup connections to server in MyApp.pm and use it throughout the 
catalyst application.


thanks,
Kutbuddin

On 3/21/11 7:16 AM, Jorge Gonzalez wrote:

I really don't see the point in using an Email model. Just use the email
sending module from the controller (Mail::Builder::Simple or whatever)
and setup a local postfix which accepts outbound emails from local
connections, and you're done. All queuing will be done by postfix, where
it belongs.

You need to install a local mail server so that the Catalyst app does
not get stuck trying to send. We can assume that messages sent from
localhost will be handed over to the local MTA pretty quickly (besides
corner cases like full mailspool and the like). This MTA can be a
full-blown one, or one configured to use use a smart host.

Catalyst offers you some posibilities, but it does not force you to use
them. To me, using a model for sending email is like hammering a nail
with a screw driver. You can surely do it, but it's simpler to use the
hammer. Even if you have a fancy screw driver. :-)

Regards
J.

El 21/03/11 08:51, John M. Dlugosz escribió:

On 3/21/2011 1:48 AM, Octavian Rasnita orasnita-at-gmail.com
|Catalyst/Allow to home| wrote:

You can use any of them or Catalyst::Helper::Model::Email. The plugin
is no longer recommended.

It looks like "helper" just installs a dummy Model that calls
Mail::Builder::Simple.  So I thought I'd just call that.  But, there
is no documentation as to the return value, and the code appears to
return 1 if it makes it to the end.  But what does it return on error,
and where is the error particulars?


___
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/



--
Kutbuddin Doctor, PhD
Bioinformatics Shared Resource,
Sanford-Burnham Medical Research Institute
http://www.sanfordburnham.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/


Re: [Catalyst] Sending Email from Page?

2011-03-21 Thread Jorge Gonzalez
I really don't see the point in using an Email model. Just use the email 
sending module from the controller (Mail::Builder::Simple or whatever) 
and setup a local postfix which accepts outbound emails from local 
connections, and you're done. All queuing will be done by postfix, where 
it belongs.


You need to install a local mail server so that the Catalyst app does 
not get stuck trying to send. We can assume that messages sent from 
localhost will be handed over to the local MTA pretty quickly (besides 
corner cases like full mailspool and the like). This MTA can be a 
full-blown one, or one configured to use use a smart host.


Catalyst offers you some posibilities, but it does not force you to use 
them. To me, using a model for sending email is like hammering a nail 
with a screw driver. You can surely do it, but it's simpler to use the 
hammer. Even if you have a fancy screw driver. :-)


Regards
J.

El 21/03/11 08:51, John M. Dlugosz escribió:
On 3/21/2011 1:48 AM, Octavian Rasnita orasnita-at-gmail.com 
|Catalyst/Allow to home| wrote:


You can use any of them or Catalyst::Helper::Model::Email. The plugin 
is no longer recommended.


It looks like "helper" just installs a dummy Model that calls 
Mail::Builder::Simple.  So I thought I'd just call that.  But, there 
is no documentation as to the return value, and the code appears to 
return 1 if it makes it to the end.  But what does it return on error, 
and where is the error particulars?



___
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/


[Catalyst] GSOC Flyer for participation

2011-03-21 Thread Mark Keating

Further to my previous email, there is a flyer available as a pdf at:

http://www.community.markkeating.me.uk/promotion/GSOC-2011-Flyer.pdf

This can be printed out and displayed on notice boards or handed to 
students in your area, if you have a couple of hours to print these out 
and distribute them in appropriate locations it would be much appreciated.


Kind regards

Mark

--
Mark Keating BA (Hons)  |  Writer, Photographer, Cat-Herder
Managing Director   |  Shadowcat Systems Limited
Director/Secretary  |  Enlightened Perl Organisation
co-Leader   |  North West England Perl Mongers
http://www.shadowcat.co.uk  |  http://www.enlightenedperl.org
http://northwestengland.pm.org  |  http://linkedin.com/in/markkeating


___
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/


Re: [Catalyst] redirect and ajax

2011-03-21 Thread Eden Cardim
> "piccard" == piccard   writes:

piccard> yes, thank u, this was my emergency-solution. I just
piccard> thought it could also be done by the server, more elegantly
piccard> ;-)

Redirections are always implemented by the client, all the server does
is set a header. If the redirection isn't happening, your JS client
isn't respecting the header. So yes, you need to write code on the
client-side that does the redirection for you.

-- 
Eden Cardim
Software Engineer
Shadowcat Systems Ltd.
http://www.shadowcat.co.uk
http://blog.edencardim.com

___
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/


Re: [Catalyst] Sending Email from Page?

2011-03-21 Thread John M. Dlugosz

On 3/21/2011 1:48 AM, Octavian Rasnita orasnita-at-gmail.com |Catalyst/Allow to 
home| wrote:


You can use any of them or Catalyst::Helper::Model::Email. The plugin is no longer 
recommended.


It looks like "helper" just installs a dummy Model that calls Mail::Builder::Simple.  So I 
thought I'd just call that.  But, there is no documentation as to the return value, and 
the code appears to return 1 if it makes it to the end.  But what does it return on error, 
and where is the error particulars?



___
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/


Re: [Catalyst] Sending Email from Page?

2011-03-21 Thread John M. Dlugosz

On 3/21/2011 1:48 AM, Octavian Rasnita orasnita-at-gmail.com |Catalyst/Allow to 
home| wrote:


You can use any of them or Catalyst::Helper::Model::Email. The plugin is no longer 
recommended.
So I see.  It's a simple wrapper that just integrates Catalyst config files, and that 
suits by purpose.  But trying to figure out how to use it I find the underlying stuff is 
deprecated.


Reading the page for Catalyst::Helper::Model::Email, and assuming that a ')' keeps getting 
lost, it's just a simple to use but you look up an object via Model first.  What is the 
benefit of that?  I suppose you can have more than one configuration pre-set, but I don't 
see that happening.  Is there some other advantage or conceptional purpose for making a 
"feature" or "content sink" or "side effect call" presented as a Model?





The most simple way is not the best. The best way is to send the messages in a job queue 
and let the worker module to send the message immediately or whenever the mail server is 
free.
If you send the message directly from your application, in that moment the server might 
not be free and the user would need to wait too much until the message is sent, or the 
mail server might give a timeout and in that case the message is lost because the 
application doesn't send it again when the mail server is free.


I like being able to get a return result so I know it was sent!
If that is not possible on a real server, is there some module already that 
does this?
Hmm, maybe it depends on the mailer used?  Postfix just queues the incoming message 
anyway!  Why am I needing to duplicate what it already does?  Would another queue process 
in front of it be less likely to get stuck?


___
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/