Hi, i messed around with sending emails.
It works fine, but, in the Network it doesnt work.
My question ist, is there a funktion out, wich get the proxy atomatically ? Or are ther other solutions ?

Greets Forginforcer !
Posted on 2003-04-08 04:47:37 by Forginforcer
No, there is no magic API that gets the proxy info, that is why all internet capable apps you install have a section where you enter your proxy info. The proxy information is stored in the registry. If you are using wininet, you can specify to use the default proxy info from the registry when you open up a connection. But then again, you are probably not using wininet to send emails :)
Posted on 2003-04-08 06:24:35 by sluggy
you can hunt down the IE proxy settings in the registry though, can't you?
Posted on 2003-04-08 06:27:03 by f0dder
From what I know (maybe I understood you wrong) a proxy does not relay e-mails. Only HTTP and, eventually, FTP transfers.
Generally all outgoing e-mail is handled by a SMTP server (which *could* be the same machine as the proxy server, but not necessary). So I think that you would need to figure out the SMTP server on your LAN.
Anyway, once you have the ip address or name of the smtp server you should establish a connection with it on TCP port 25 and 'talk' with it using the SMTP protocol. See RFC 2821 for details on that.

Hope any of this helps.
Posted on 2003-04-08 07:48:31 by Hawkuletz
thats it is !
the port for the smtp could 110 or 55 or 101.
the what can i do ???
Posted on 2003-04-08 08:57:51 by Forginforcer

From what I know (maybe I understood you wrong) a proxy does not relay e-mails. Only HTTP and, eventually, FTP transfers.
Hope any of this helps.


mm..... a proxy relay what you want. He doesn't care of what he is transmitting.

By default some proxy just relay 25(mail),110(mail),80,8080 and common stuff like that,
some other transfert everything by default. But this can be customized.

A proxy that will only relay ftp and http may be necessary in special conditions
(if you set up a content-filtering, you mainly care only of http), but in a general
way a proxy restricted to ftp/http will not be of a great help.....

Finding a mail server doesn't mean that you'll be allowed to use it. If this mail
server is corretly configured, he will refuse to relay. To be able to use a server,
you have to be authenticated on it. Meaning you know his adress or name. Using
a smtp server from an anonymous point of view is usually not allowed.

I would go back on finding the proxy, grabbing it from the registry seem to be the
most simple, if don't find it, try the gateway, they are usually the same machine.

regards
etherlord
Posted on 2003-04-08 09:16:47 by etherlord
.. the port for SMTP is 25 (decimal :) )
110 (decimal) is the port for POP3
a typical session is as follows:

telnet 193.230.153.3 25
Trying 193.230.153.3...
Connected to 193.230.153.3.
Escape character is '^]'.
220 hercule.hades.ro ESMTP Postfix
ehlo sts.office.deck.ro
250-hercule.hades.ro
250-PIPELINING
250-SIZE 10240000
250-ETRN
250 8BITMIME
mail from: hawkuletz@sts.office.deck.ro
250 Ok
rcpt to: hawk@deck.ro
250 Ok
data
354 End data with <CR><LF>.<CR><LF>
Subject: Test message
Sample body of message
second line
and so on
finally we will end the message on the next line
.
250 Ok: queued as 886A1EB735
quit
221 Bye
Connection closed by foreign host.

First message is one begining with 220, telling you that there is a SMTP server on the other end, and that it is ready to accept requests
you reply with EHLO <your_machine_name><CR><LF>
the server replies with a series of informative messages, all begining with 250 (ASCII characters 2, 5 and 0, NOT a byte with the value 250)
IF you have a 250 then the server agrees to continue communication with you :)
Next you should send the command MAIL FROM: <sender_email_address><CR><LF>
IF the server replies with 250 (end, eventually an OK, than you can proceed)
Send RCPT TO: <destination_email_address><CR><LF>
Again, wait for the 250 message
optionally you may send another RCPT line as above, that is if you want more recipients for your email.
Send DATA
IFaccepted, the SMTP server returns a 354 Intermediate reply and considers all succeeding lines up to but not including the end of mail data indicator to be the message text. When the end of text is successfully received and stored the SMTP-receiver sends a 250 OK reply.
In the above example you see that the next line is Subject: <subject>
this line is part of the message body. It is special only because most e-mail client programs (I think all e-mail client programs) interpret that line as being the subject of the message. However, that is not mandatory.
Finally send the body of the e-mail program.
Finish with <CR><LF>.<CR><LF>
IF everything is in order, you get the 250 reply and you send QUIT<CR><LF> to end session with server.

For more information, I would advise you to read RFC2821 at http://www.ietf.org/rfc/rfc2821.txt

PS: Sorry, I forgot something.. some *very* old SMTP servers won't respond to EHLO with 250. If that is the case you should try sending HELO <your_machine_name><CR><LF> If you still don't get the 250 response than you should abort communication, nevertheless sending QUIT<CR><LF> (this is said to be good practice :) )

Good luck!
Posted on 2003-04-08 09:52:17 by Hawkuletz
The dude was right, you can use any "transparent" proxy protocol.
Examples are socksv4 and http's CONNECT method (a loose kind of webproxy)
You can shove any TCP data you like through a transparent proxy.
It's not really important whether its SMTP email, some kind of chat, whatever, after the proxy connection is established, you can forget its there.
Posted on 2003-04-08 10:30:54 by Homer
hi, for example i want to open a sock5 conection.
Then I need the serverIP(proxy-server-ip) and the port.
My Proxy use 808 for http and for sock5 1080.

smtp I cant configurate.

Where I have to programm that the programm run on client pc ?
Posted on 2003-04-08 11:49:08 by Forginforcer
Hi, after discussing this:
http://www.asmcommunity.net/board/index.php?topic=12250
I need to programm a configuration for the mailroutine, so its possible to send an email also from network.

Thanks !
Posted on 2003-04-08 12:46:19 by Forginforcer
Please post networking related topics in the networking forum (the other post was in a wrong forum as well).

Futhermore I don't understand what you want. Is this something different or still the same as your question in the other thread?

Thomas
Posted on 2003-04-08 13:13:54 by Thomas
Hi Thomas.
when i send a mail, I have to connect to the host. - But thats doesnt work when I'm coneted throug a proxy.
Do you know what I mean ?
Posted on 2003-04-08 14:35:07 by Forginforcer
But what's the difference between this thread and your previous one?

edit: I merged your threads into one.

EvilHomer2k has already told you how to connect through the proxy, just read some protocol documentation about socksv4/5.

Thomas
Posted on 2003-04-08 14:38:46 by Thomas
But I cant replace the mailhost with the proxy.
Posted on 2003-04-08 15:28:38 by Forginforcer