diff options
author | Florian Pritz <bluewind@xinu.at> | 2012-02-13 18:25:23 +0100 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2012-02-13 18:25:50 +0100 |
commit | eab96a512e587e2bb55e2cad7cd1faa058f100c9 (patch) | |
tree | 263a69d9d2aad631a1d3d003d11f12179a357770 | |
parent | 03a3ba0aed2a36ca9e7f6cbc93bc7739a5e57a27 (diff) | |
download | bin-eab96a512e587e2bb55e2cad7cd1faa058f100c9.tar.gz bin-eab96a512e587e2bb55e2cad7cd1faa058f100c9.tar.xz |
check-mail-addr.pl: add from argument
Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rwxr-xr-x | check-mail-addr.pl | 7 |
1 files 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), " <emailaddress>\n"; +if(@ARGV < 1) { + print "usage: ", basename($0), " <emailaddress> [<from>]\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"; |