sendmail issue

sendmail issue

am 20.09.2007 21:02:19 von lerameur

HI again,

I wrote this small script to test my send mail. The script is placed
in the root directory and has the executable permission. It runs
without error, but I never received the email:

#!/usr/bin/perl -w
use strict;

open ( MAIL, "| /usr/lib/sendmail -t" );
print MAIL "From: email address\n";
print MAIL "To: lerameur\@yahoo.com\n";
print MAIL "Subject: Something here \n\n";
close ( MAIL );


k

Re: sendmail issue

am 20.09.2007 21:09:35 von Eric Schwartz

lerameur writes:
> I wrote this small script to test my send mail. The script is placed
> in the root directory and has the executable permission. It runs
> without error, but I never received the email:

If that's the case, then your problem isn't in your perl script; it's
in your mail server. I recommend finding a newsgroup related to your
mail server, and asking about it there.

-=Eric

Re: sendmail issue

am 20.09.2007 21:16:14 von Dummy

lerameur wrote:
>
> I wrote this small script to test my send mail. The script is placed
> in the root directory and has the executable permission. It runs
> without error,

Because you ignore any errors that may be generated.

> but I never received the email:
>
> #!/usr/bin/perl -w
> use strict;
>
> open ( MAIL, "| /usr/lib/sendmail -t" );
> print MAIL "From: email address\n";
> print MAIL "To: lerameur\@yahoo.com\n";
> print MAIL "Subject: Something here \n\n";
> close ( MAIL );

open my $MAIL, '|-', '/usr/lib/sendmail', '-t'
or die "Cannot open pipe to sendmail: $!";

print $MAIL <<'MAIL' or warn "Cannot print to sendmail: $!";
From: email address
To: lerameur@yahoo.com
Subject: Something here

MAIL

close $MAIL
or warn $! ? "Error closing sendmail pipe: $!"
: "Exit status $? from sendmail";



John
--
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order. -- Larry Wall

Re: sendmail issue

am 20.09.2007 21:17:49 von glex_no-spam

lerameur wrote:
> HI again,
>
> I wrote this small script to test my send mail. The script is placed
> in the root directory and has the executable permission. It runs
> without error,
How do you know? You don't handle any errors.



>but I never received the email:
>
> #!/usr/bin/perl -w
> use strict;
>
> open ( MAIL, "| /usr/lib/sendmail -t" );
> print MAIL "From: email address\n";
> print MAIL "To: lerameur\@yahoo.com\n";
> print MAIL "Subject: Something here \n\n";
> close ( MAIL );

Does it work via the command line?

Re: sendmail issue

am 20.09.2007 21:41:59 von lerameur

I wrote this with the die command

#!/usr/bin/perl -w
use strict;

open ( MAIL, "| /usr/lib/sendmail -t" ) or die ("Cannot open pipe to
sendmail: $!");
print MAIL "From: email address\n";
print MAIL "To: lerameur\@yahoo.com\n";
print MAIL "Subject: Something here \n\n";
close ( MAIL ) or die ("Cannot close sendmail: $!");

no errors, no mail receives


k

Re: sendmail issue

am 20.09.2007 21:54:47 von Tony Curtis

lerameur wrote:
> I wrote this with the die command
>
> #!/usr/bin/perl -w
> use strict;
>
> open ( MAIL, "| /usr/lib/sendmail -t" ) or die ("Cannot open pipe to
> sendmail: $!");
> print MAIL "From: email address\n";
> print MAIL "To: lerameur\@yahoo.com\n";
> print MAIL "Subject: Something here \n\n";
> close ( MAIL ) or die ("Cannot close sendmail: $!");
>
> no errors, no mail receives

then, as someone previously pointed out, the problem must be somewhere
outside of perl, e.g. your local sendmail setup.

hth
t

Re: sendmail issue

am 20.09.2007 21:58:56 von Glenn Jackman

At 2007-09-20 03:41PM, "lerameur" wrote:
> I wrote this with the die command
>
> #!/usr/bin/perl -w
> use strict;
>
> open ( MAIL, "| /usr/lib/sendmail -t" ) or die ("Cannot open pipe to
> sendmail: $!");
> print MAIL "From: email address\n";
> print MAIL "To: lerameur\@yahoo.com\n";
> print MAIL "Subject: Something here \n\n";
> close ( MAIL ) or die ("Cannot close sendmail: $!");
>
> no errors, no mail receives

Ask your sysadmin to see what's happening in sendmail's log file, or
look in /var/adm or /var/log

--
Glenn Jackman
"You can only be young once. But you can always be immature." -- Dave Barry

Re: sendmail issue

am 20.09.2007 22:14:27 von smallpond

On Sep 20, 3:02 pm, lerameur wrote:
> HI again,
>
> I wrote this small script to test my send mail. The script is placed
> in the root directory and has the executable permission. It runs
> without error, but I never received the email:
>
> #!/usr/bin/perl -w
> use strict;
>
> open ( MAIL, "| /usr/lib/sendmail -t" );
> print MAIL "From: email address\n";
> print MAIL "To: lerameur\@yahoo.com\n";
> print MAIL "Subject: Something here \n\n";
> close ( MAIL );
>
> k


Because you never gave it the end of the email, which
is defined as a "." on a line by itself.

Re: sendmail issue

am 20.09.2007 22:31:16 von Glenn Jackman

At 2007-09-20 04:14PM, "smallpond" wrote:
> On Sep 20, 3:02 pm, lerameur wrote:
> > open ( MAIL, "| /usr/lib/sendmail -t" );
> > print MAIL "From: email address\n";
> > print MAIL "To: lerameur\@yahoo.com\n";
> > print MAIL "Subject: Something here \n\n";
> > close ( MAIL );
>
> Because you never gave it the end of the email, which
> is defined as a "." on a line by itself.

Although the sendmail man page does say "sendmail reads its standard
input _up to an EOF_, or a line with a single dot".


--
Glenn Jackman
"You can only be young once. But you can always be immature." -- Dave Barry