From eab96a512e587e2bb55e2cad7cd1faa058f100c9 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Mon, 13 Feb 2012 18:25:23 +0100 Subject: check-mail-addr.pl: add from argument Signed-off-by: Florian Pritz --- check-mail-addr.pl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/check-mail-addr.pl b/check-mail-addr.pl index 773830d..4aa1d0b 100755 --- a/check-mail-addr.pl +++ b/check-mail-addr.pl @@ -7,8 +7,8 @@ use Net::Domain qw(hostfqdn hostdomain); use Net::DNS; use Data::Dumper; -if(@ARGV != 1) { - print "usage: ", basename($0), " \n"; +if(@ARGV < 1) { + print "usage: ", basename($0), " []\n"; exit; } @@ -30,6 +30,7 @@ sub post { } my $email = $ARGV[0]; +my $from = $ARGV[1] ? $ARGV[1] : ""; $email =~ m/.*@(.*)/; my $domain = $1; @@ -44,7 +45,7 @@ my $socket = IO::Socket::INET->new( print "<< ".$socket->getline; post $socket,"EHLO ".hostfqdn()."\r\n"; -post $socket, "MAIL FROM:<>\r\n"; +post $socket, "MAIL FROM:<$from>\r\n"; post $socket, "RCPT TO:<$email>\r\n"; post $socket, "QUIT\r\n"; -- cgit v1.2.3-24-g4f1b