#!/usr/local/bin/perl # Need to use socket services use IO::Socket; use strict; my($remote_host, $sender, $recipient, $remote_port, $line, $response, $socket, $flag); $remote_host = "127.0.0.1"; $remote_port = 10027; $socket = IO::Socket::INET->new(PeerAddr => $remote_host, PeerPort => $remote_port, Proto => "tcp", Type => SOCK_STREAM) or die "Couldn't connect to $remote_host:$remote_port : $@\n"; ## print $socket "HELO localhost\n"; print $socket "HELO $remote_host\n"; $response = <$socket>; ##### ## split $ARGV on the commas... ## @pratip=split(/,/,@ARGV); ##### ## changed ARGV to pratip... $sender = shift(@ARGV); print "MAIL FROM: <$sender>\n"; print $socket "MAIL FROM: <$sender>\n"; $response = <$socket>; ##### ## With the $@ from procmailrc, there seems to be a comma at the ## end of the string. There may need to be an addition made to ## the while() loop that verifies that $recipient is not an ## empty string. while ($recipient = shift(@ARGV)) { print "RCPT TO: <$recipient>\n"; print $socket "RCPT TO: <$recipient>\n"; $response = <$socket>; } print $socket "DATA\n"; $response = <$socket>; while (defined($line = )) { print $socket "$line"; } print $socket "\n.\n"; $response = <$socket>; print $socket "QUIT\n"; close($socket); exit(0);