ghostils has asked for the wisdom of the Perl Monks concerning the following question:
Here are the session dumps with my various personal info changed. TMobile:#-SMS Gateway over SMTP e-mail protocol: #-(c)ode by Brodie Ponas #- #- User Socket, and Select Packages: use IO::Socket; use IO::Select; use Socket; use Net::SMTP; #-first arg is ip address #-2nd arg is port: foreach $arg (@ARGV) { $_ = $arg; #-Address: if (m/\-addr\:(.+)/i) {$address = $1;} #-Port: if (m/\-port\:(.+)/i) {$port = $1;} } #-Setup sockets: $ConnectionSocket = new IO::Socket::INET(Listen => 1, LocalHost => $ad +dress ,LocalPort => $port); $SelectHandle = new IO::Select( $ConnectionSocket ); print "iLs SMS SMTP Gateway Listening...\r\n"; print "LocalAddr: $address\r\n"; print "LocalPort: $port\r\n"; $isRecvData = 0; while(@Connections = $SelectHandle->can_read) { foreach $SocketHandle (@Connections) { #-Incomming Connection: if($SocketHandle == $ConnectionSocket) { # Create a new socket $NewClient = $ConnectionSocket->accept; $SelectHandle->add($NewClient); print "Client Connect ", $NewClient->peerhost, ":", $NewCl +ient->peerport, "\r\n"; #-Tell mail client we are ready: print $NewClient "220\r\n"; } #-Established Connections: else { # Process socket data: #-We are recv'n the actual SMTP DATA field now, we don' +t want to send anythign back to the client: if ($isRecvData == 1) { $Data = <$SocketHandle>; $_ = $Data; #-End of Data: reset flag: send OK: if (m/\./i) { print $SocketHandle "250\r\n"; $isRecvData = 0; } print "$Data\r\n"; next; } #-Recv Stream: $Data = <$SocketHandle>; $_ = $Data; if (m/QUIT/i) { print $SocketHandle "221\r\n"; $SelectHandle->remove($SocketHandle); $SocketHandle->close; } #-Start of DATA: elsif(m/DATA/i) { print $SocketHandle "250\r\n"; $isRecvData = 1; } #-Any other command we just give them an OK we just car +e about the data messaage and sender address for now: else {print $SocketHandle "250\r\n";} print "$Data"; } $Data = ""; } }
Comcast Session------------------------------------ EHLO mailx05.tmomail.net MAIL From:<1231231234@tmomail.net> RCPT To:<bp@myserver.org> DATA RSET QUIT ------------------------------------
Anyone have a better grasp of SMS->Email SMTP that could chime in here? Thanks, -Brodie------------------------------------ EHLO alnrmhc13.comcast.net MAIL FROM:<bponas@comcast.net> RCPT TO:<bponas@myserver.org> DATA Received: from myserver (c-67-168-213-7.hsd1.wa.comcast.net[67.168.213 +.7]) by comcast.net (alnrmhc13) with SMTP id <20070509184137b1300do65ie>; Wed, 9 May 2007 18:41:37 +00 +00 From: "bponas" <bponas@comcast.net> To: <bponas@myserver.org> Subject: RE: COMCAST PLAINTEST SEND FROM SERVER TEST Date: Wed, 9 May 2007 11:38:48 -0700 Message-ID: <NEEMKLLCMPCCPEPDMOCFIEKACCAA.bponas@comcast.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527 Importance: Normal In-Reply-To: <NEEMKLLCMPCCPEPDMOCFEEKACCAA.bponas@comcast.net> TADAH DOES MY STUFF WORK? . QUIT -------------------------------------
|
|---|