summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2012-02-13 18:25:23 +0100
committerFlorian Pritz <bluewind@xinu.at>2012-02-13 18:25:50 +0100
commiteab96a512e587e2bb55e2cad7cd1faa058f100c9 (patch)
tree263a69d9d2aad631a1d3d003d11f12179a357770
parent03a3ba0aed2a36ca9e7f6cbc93bc7739a5e57a27 (diff)
downloadbin-eab96a512e587e2bb55e2cad7cd1faa058f100c9.tar.gz
bin-eab96a512e587e2bb55e2cad7cd1faa058f100c9.tar.xz
check-mail-addr.pl: add from argument
Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rwxr-xr-xcheck-mail-addr.pl7
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";