Re: Help! (with sendmail after upgrade)

2004-09-13 Thread John Delacour
At 10:52 am -0400 13/9/04, Sherm Pendley wrote:
Ouch! That's very sendmail-specific, and you'll be in trouble if you 
need to switch to a different mailer. I'd suggest a mailer-agnostic 
approach using Mail::Sendmail. (It's name is derived from what it 
does - i.e. it sends mail - rather than the name of a specific 
mailer.)
Or even more generic and accessible Net::SMTP
#!/usr/local/bin/perl -w
use Net::SMTP;
my $debug=1;
if ($debug) {
  $| = 1;
  open( STDERR, qq~>&STDOUT~ );
}
$smtp = Net::SMTP->new('localhost', Debug => $debug);
# or ISP's SMTP host instead of localhost
$smtp->mail('[EMAIL PROTECTED]');
$smtp->to('[EMAIL PROTECTED]');
$smtp->data();
$smtp->datasend("To: [EMAIL PROTECTED]");
$smtp->datasend("Subject: test\n");
$smtp->datasend("\n");
$smtp->datasend("A simple test message\n");
$smtp->dataend();
$smtp->quit;
# JD


Re: Help! (with sendmail after upgrade)

2004-09-13 Thread John Delacour
At 11:12 am -0500 13/9/04, Bill Stephenson wrote:
Have you enabled sendmail (or postfix on 10.3) ?
How exactly does one do that?



Re: Help! (with sendmail after upgrade)

2004-09-13 Thread Bill Stephenson
On Sep 13, 2004, at 7:41 AM, John Delacour wrote:
I've just found out that no emails have been sent by perl scripts 
since then.
Have you enabled sendmail (or postfix on 10.3) ?

How exactly does one do that?
Bill


Re: BBEdit 8.0 vs JEdit

2004-09-13 Thread Sherm Pendley
On Sep 12, 2004, at 1:32 PM, The Ghost wrote:
Other than JEdit, my other choice would be KDE's KATE (K Advance Text 
Editor).  (This may now be Quantra, I don't know).  Excellent syntax 
highlighting control, integrated command line, a nice file browser 
(good for looking at logs quickly),  The only problem is I don't know 
how to put it on a Mac, but I'm sure it can be done.  If anyone knows 
how to do this or can point me to the right documentation it'd be much 
appreciated.
KATE is available through Fink. I'm not certain what specific package, 
although kdeutils3 or kdevelop seems likely.

sherm--


Re: Help! (with sendmail after upgrade)

2004-09-13 Thread Sherm Pendley
On Sep 12, 2004, at 8:20 PM, John Horner wrote:
Any ideas? Here's a test script which runs without any problems, but 
no email is sent (or, to be logical, no email is received):

#!/usr/bin/perl -w
use CGI;
use CGI::Carp qw(fatalsToBrowser);
$mailprog = '/usr/sbin/sendmail -i -t';
open(MAIL,"|$mailprog") || die "$!";
print MAIL "To: [EMAIL PROTECTED]" || die "$!";
print MAIL "From:  [EMAIL PROTECTED]" || die "$!";
print MAIL "Subject: Test of Email Script\n\n"|| die "$!";
print MAIL "Test of Email Script\n"|| die "$!";
close (MAIL) || die "$!";
print "Content-type:text/html\n\n";
print "ran with no problems?";
Ouch! That's very sendmail-specific, and you'll be in trouble if you 
need to switch to a different mailer. I'd suggest a mailer-agnostic 
approach using Mail::Sendmail. (It's name is derived from what it does 
- i.e. it sends mail - rather than the name of a specific mailer.)

#!/usr/bin/perl -w
use CGI;
use CGI::Carp qw(fatalsToBrowser);
use Mail::Sendmail;
my %mail = (
'To'=>   '[EMAIL PROTECTED]',
'From' =>'[EMAIL PROTECTED]',
'Subject' => 'Email test',
'Message' => 'This is a test. If this were a real email...',
);
sendmail(%mail) or die($Mail::Sendmail::error);
print CGI::header('text/plain'), 'No problems';
sherm--


Re: BBEdit 8.0 vs JEdit

2004-09-13 Thread Pete Prodoehl
The Ghost wrote:
I'd really like to reiterate the suggestion to try JEdit.  It used to 
have some problems on OS X, but in 4.2 Final they are cleared up.  It 
has everything with the SFTP, multi-file search/replace with regex 
(better than BBEdit's in IMO), and all that fancy stuff, the only thing 
it doesn't currently have to my knowledge is the ability to execute a 
script from the program.  However, with it's plugin architecture I 
believe this will come in the future.

Ryan
As long as someone brought up jEdit, I'll toss in my 2 cents...
You can execute scripts from jEdit, there are a number of ways, using 
the console plugin, a commando file, a macro, etc... Perhaps the problem 
is that there are multiple ways of doing things, so there's not the "one 
true way" to do something, but asking on the mailing list usually gets 
you some good answers.

A few other nice things about jEdit are: active development, good 
support, open-source, multi-platform... and if you like to customize, 
extend, and hack the heck out of your editor, it's ready, willing, and 
able...

Pete



Re: Help! (with sendmail after upgrade)

2004-09-13 Thread John Delacour
At 10:20 am +1000 13/9/04, John Horner wrote:
I upgraded a mac used as a webserver from 10.1 to 10.2 a week or so ago.
I've just found out that no emails have been sent by perl scripts since then.
Have you enabled sendmail (or postfix on 10.3) ?
JD


Help! (with sendmail after upgrade)

2004-09-13 Thread John Horner
I upgraded a mac used as a webserver from 10.1 to 10.2 a week or so ago.
I've just found out that no emails have been sent by perl scripts since then.
When I ran the offending scripts, they complained about missing 
folders: /var/spool/clientmqueue/ and /var/spool/mqueue/ -- I created 
those folders and set permissions, and now scripts run without any 
errors, but the emails are not sent.

Any ideas? Here's a test script which runs without any problems, but 
no email is sent (or, to be logical, no email is received):

#!/usr/bin/perl -w
use CGI;
use CGI::Carp qw(fatalsToBrowser);
$mailprog = '/usr/sbin/sendmail -i -t';
open(MAIL,"|$mailprog") || die "$!";
print MAIL "To: [EMAIL PROTECTED]" || die "$!";
print MAIL "From:  [EMAIL PROTECTED]" || die "$!";
print MAIL "Subject: Test of Email Script\n\n"|| die "$!";
print MAIL "Test of Email Script\n"|| die "$!";
close (MAIL) || die "$!";
print "Content-type:text/html\n\n";
print "ran with no problems?";

   "Have You Validated Your Code?"
John Horner(+612 / 02) 9333 2110
Senior Developer, ABC Online  http://www.abc.net.au/