[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] Socket Pipe?



I'm writing a sort of router that should open an SMTP connection to a host,
and recieve one from a client. Once this connection is made, my program
must act as a relay between the two.

The problem is that I don't think I can use a simple for loop. Send doesn't
always follow recieve in SMTP and so I need a way, if there is one, to make
a pipe directly from one to the other, hopefully not involving my code at
all. Is there a way to do that? If not, does anyone have any other
suggestions?

Thanks for any help you can give.

- strider

PS- This is an example SMTP connection straight out of the RFC, if it'll help:

R: 220 BBN-UNIX.ARPA Simple Mail Transfer Service Ready
S: HELO USC-ISIF.ARPA
R: 250 BBN-UNIX.ARPA

S: MAIL FROM:<Smith@USC-ISIF.ARPA>
R: 250 OK

S: RCPT TO:<Jones@BBN-UNIX.ARPA>
R: 250 OK

S: RCPT TO:<Green@BBN-UNIX.ARPA>
R: 550 No such user here

S: RCPT TO:<Brown@BBN-UNIX.ARPA>
R: 250 OK

S: DATA
R: 354 Start mail input; end with <CRLF>.<CRLF>
S: Blah blah blah...
S: ...etc. etc. etc.
S: .
R: 250 OK

S: QUIT
R: 221 BBN-UNIX.ARPA Service closing transmission channel


--

Therefore we do not lose heart. Though outwardly we are wasting away,
yet inwardly we are being renewed day by day. For our light and momentary
troubles are achieving for us an eternal glory that far outweighs them all.

2 Corinthians 4:16, 17


  |
--+--
  |
  |



===== Want to unsubscribe from this list?
===== Send mail with body "unsubscribe" to macperl-request@macperl.org