Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230
From a cursory look my best guess is that your regular expression does not match and therefore no mail is sent. You could try to deduce where it fails by adding some debug statements.
I checked that my mailx would send messages, then I created the stripped-down version of your script as noted below and it worked for me.
You could remove the test and see if the print will work. You could also make the print go to STDOUT if you suspect the mailx-pipe chain ... cheers, drl
#!/usr/bin/perl
# @(#) p1 Demonstrate mail from perl script.
use strict;
use warnings;
use Carp;
my ($mail);
my ($program) = "mailx";
my ($recipient) = "drl";
my ($domain) = '@leap';
open $mail, "|-", "$program -s test $recipient$domain"
|| croak("Can't fork $program, error $!");
print $mail scalar localtime(), "\n";
print $mail "hello, world.\n";
close $mail || croak("Can't close $program: error $!");
exit(0);
["Sure, I can help you with that." -- USBank voice recognition system.
( Mn, 2.6.x, AMD-64 3000+, ASUS A8V Deluxe, 3 GB, SATA + IDE, NV34 )
Debian Wiki | Packages | Backports | Netinstall