BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

POP3Proxy using Indy TIdMappedPOP3

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Internet Winsock
View previous topic :: View next topic  
Author Message
marshmathers
Guest





PostPosted: Sun Nov 28, 2004 3:51 pm    Post subject: POP3Proxy using Indy TIdMappedPOP3 Reply with quote



 HI,
I am trying to create a POP3 Proxy server using Indy 9 TIdMappedPOP3.
First I want to get the mail server from pop3 client. Secondly I want to
capture the data from server; only Messages (header, body etc.); not
those server replies(+OK etc.). I used to get "Host is empty" error. I
fixed it by specifying VHost := servername in the Outbound Connect
event. But I want to get that servername from the client itself. At
present I am specifying it manually. So how can I accomplish these two
tasks of servername and messages in TIdMessage format from OnboundData
event. Please help me.........

Thanx in advance.



--- posted by geoForum on http://delphi.newswhat.com
Back to top
Thomas Wegner
Guest





PostPosted: Sun Nov 28, 2004 5:43 pm    Post subject: Re: POP3Proxy using Indy TIdMappedPOP3 Reply with quote



Look in the TIdHTTPProxyServer from Indy10.
---------------------------------------------
Thomas Wegner
Cabrio Meter - The Weather Plugin for Trillian
http://www.wegner24.de

"marshmathers" <mmathers (AT) 37 (DOT) com> schrieb im Newsbeitrag
news:41aa01b1 (AT) newsgroups (DOT) borland.com...
Quote:
HI,
I am trying to create a POP3 Proxy server using Indy 9 TIdMappedPOP3.
First I want to get the mail server from pop3 client. Secondly I want to
capture the data from server; only Messages (header, body etc.); not
those server replies(+OK etc.). I used to get "Host is empty" error. I
fixed it by specifying VHost := servername in the Outbound Connect
event. But I want to get that servername from the client itself. At
present I am specifying it manually. So how can I accomplish these two
tasks of servername and messages in TIdMessage format from OnboundData
event. Please help me.........

Thanx in advance.



--- posted by geoForum on http://delphi.newswhat.com



Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Sun Nov 28, 2004 11:48 pm    Post subject: Re: POP3Proxy using Indy TIdMappedPOP3 Reply with quote




"marshmathers" <mmathers (AT) 37 (DOT) com> wrote


Quote:
First I want to get the mail server from pop3 client.

TIdMappedPOP3 already handles that automatically for you. You need to
configure your POP3 client to connect through a proxy. You cannot configure
your client to treat the TIdMappedPOP3 as the server because the client
needs to send extra data that tells the TIdMappedPOP3 where the actual
server is located.

If your client does not directly support proxies, then you can try
specifying the server hostname in your POP3 username, ie:

myusername#theserverhostname

Quote:
Secondly I want to capture the data from server; only
Messages (header, body etc.); not those server replies(+OK etc.).

The replies are required.

Quote:
I used to get "Host is empty" error.

Your POP3 client is not configured to connect via a proxy.

Quote:
I fixed it by specifying VHost := servername in the Outbound Connect
event.

I assume you actually mean the OnCheckHostPort event, not the
OnOutboundConnect event.

Quote:
But I want to get that servername from the client itself.

Then you need to configure the client properly to begin with.

Quote:
So how can I accomplish these two tasks of servername and messages in
TIdMessage format from OnboundData event.

You cannot get the data in TIdMessage format with TIdMappedPOP3
automatically. It is not designed for that. It is just a straight client
<-> server proxy, passing raw data between them. Nothing else. No message
parsing at all. If you need TIdMessage support than you have to provide
your own support for it by using the OnOutboundData to parse the received
POP3 data manually before it is sent to the client. Since the data is
received in its raw format, it will probably take several OnOutboundData
event triggerings for you to process the data properly.


Gambit



Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Sun Nov 28, 2004 11:49 pm    Post subject: Re: POP3Proxy using Indy TIdMappedPOP3 Reply with quote


"Thomas Wegner" <tomaten (AT) t-online (DOT) de> wrote

Quote:
Look in the TIdHTTPProxyServer from Indy10.

He is using Indy 9, not Indy 10. Besides, what does that demo have to with
POP3 proxying?


Gambit



Back to top
marshmathers
Guest





PostPosted: Mon Nov 29, 2004 3:36 am    Post subject: Re: POP3Proxy using Indy TIdMappedPOP3 Reply with quote

ThanX Remy. Thanx a lot.

My real intenstion was to create something like what Norton Antivirus
do. It scans every email to and from the computer for virus. But it does
not require any client configs (like username#servername), a knd of hand
free approach. Can we accomplish similar tasks with Indy 9? Secondly can
you offer me some help with regard to parsing raw data to TIdMessage
format? My real intention is to create somthing like Norton Email
scanning using ClamAV database.



--- posted by geoForum on http://delphi.newswhat.com
Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Mon Nov 29, 2004 7:07 am    Post subject: Re: POP3Proxy using Indy TIdMappedPOP3 Reply with quote


"marshmathers" <mmathers (AT) 37 (DOT) com> wrote


Quote:
My real intenstion was to create something like what Norton
Antivirus do. It scans every email to and from the computer
for virus. But it does not require any client configs (like
username#servername), a knd of hand free approach.

Then you cannot use TIdMappedPOP3 for that at all. TIdMappedPOP3 requires
that the client be specifically configured to connect to it instead of the
actual SMTP server. What you are asking for now is to allow the client to
connect to the actual server directly and you intercept all data that is
transmitted on that connection. That kind of handling is beyond Indy's
capabilities. You have to write an NDIS driver that hooks the WinSock stack
directly instead. Indy has no provisions for that, nor is it designed for
that type of programming.

Quote:
Secondly can you offer me some help with regard to parsing
raw data to TIdMessage format?

Why do you need to use TIdMessage at all? Why not just scan the raw data
as-is?

If you must parse it, then you will have to buffer everything that is
transmitted, and then parse the POP3 commands as per the RFCs. When you
receive a DATA command, you can save that raw data to a stream, such as a
TMemoryStream, and then use TIdMessage's LoadFromStream() method.

Quote:
My real intention is to create somthing like Norton Email
scanning using ClamAV database.

I do not know what either of those are like.


Gambit



Back to top
marshmathers
Guest





PostPosted: Mon Nov 29, 2004 8:09 am    Post subject: Re: POP3Proxy using Indy TIdMappedPOP3 Reply with quote

Thanx for your clues on NDIS driver and idea to parse raw data after
DATA command. I'll try.......



--- posted by geoForum on http://delphi.newswhat.com
Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Mon Nov 29, 2004 9:17 pm    Post subject: Re: POP3Proxy using Indy TIdMappedPOP3 Reply with quote


"Remy Lebeau (TeamB)" <no.spam (AT) no (DOT) spam.com> wrote


Quote:
You have to write an NDIS driver that hooks the WinSock
stack directly instead. Indy has no provisions for that, nor is
it designed for that type of programming.

Have a look at WinPCap(http://winpcap.polito.it) if you do not want to write
a new driver from scratch.


Gambit



Back to top
marshmathers
Guest





PostPosted: Tue Nov 30, 2004 4:56 pm    Post subject: Re: POP3Proxy using Indy TIdMappedPOP3 Reply with quote

Remy,
I already have a copy of it. Btut can we sniff packets using a WAN
adapter in WinPcap. I also heard about some kind of firewall issues. Any
way now iam thinking of working in Indy way. :-)


Quote:
Have a look at WinPCap(http://winpcap.polito.it) if you do not want to
write a new driver from scratch.




--- posted by geoForum on http://delphi.newswhat.com

Back to top
Gavin Watkinson
Guest





PostPosted: Wed Dec 01, 2004 11:12 am    Post subject: Re: POP3Proxy using Indy TIdMappedPOP3 Reply with quote


WinPCap is a protocal driver only, you will be able to see all the
packets but you wont be able to change them, WinPcap takes a copy of the
packet transmitted and gives it to you to look at.

Good for packet sniffing but no good if you want to change any data

Gavin

Quote:
Remy,
I already have a copy of it. Btut can we sniff packets using a WAN
adapter in WinPcap. I also heard about some kind of firewall issues. Any
way now iam thinking of working in Indy way. :-)



Have a look at WinPCap(http://winpcap.polito.it) if you do not want to

write a new driver from scratch.



--- posted by geoForum on http://delphi.newswhat.com

Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Internet Winsock All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.