Archived Forum Post

Index of archived forum posts

Question:

Several questions on mailman,imap,http,socket

Nov 26 '12 at 01:43

I bought component revently and I`m pretty happy about that. But I have still several questions. So I will be very glad, if you clarify them.

  1. For imap I can set AuthMethod property to "CRAM-MD5", "NTLM", "PLAIN", or "LOGIN". As far as I know pop3 also supports several authorization options: ORDINARY, APOP,CRAMMD5 . In your MailMan lib I just see UseApop property, but how can I setup crammd5 method for pop3 ?

  2. For mailman, imap and http libraries - how can I setup proxy timeout?

  3. For sockets proxy does not work (nor http (with/without authorization), neither socks5 - i tried both paid and free proxies). For cases of auth proxies usage I always get authorization error (the same proxies work for http QuickGetStr) Can you advice me any provider whose proxies work with your sockets lib?

  4. How can I set maximum redirects allowed for QuickGetStr (from http library)? FollowRedirects property it is the flag, but where can I set redirects number?

  5. Does PostUrlEncoded take into consideration the same properties as QuickGetStr? I mean the following properties: http.Referer,http.UserAgent,http.FollowRedirects,http.MaxResponseSize,http.ConnectTimeout,http.ReadTimeout,http.UpdateCache,http.FetchFromCache = false,http.SaveCookies,http.SendCookies,http.CookieDir (Chilkat.Http http = new Chilkat.Http())


Answer

  1. Chilkat does not support CRAM-MD5 for POP3.
  2. The existing timeout properties for the various classes/objects also apply to the communications with the proxies.
  3. If Chilkat does not work for a particular proxy server, I would need to test directly with that proxy server to reproduce the problem. I can assure you that Chilkat works with proxy servers (HTTP and SOCKS5) and has been tested and is used by many Chilkat customers.
  4. If FollowRedirects is used, there is an internal limit hard-coded to about 10 redirects. If you need something more specific, your application should instead handle the redirects explicitly.
  5. The PostUrlEncoded method takes an HttpRequest object for one of its arguments. Properties that are HTTP request header fields will come from the HttpRequest object. Properties that specify a behavior, such as ReadTimeout, FetchFromCache, etc. apply to all HTTP methods. (Except where it doesn't make sense. For example, no POST's will be fetched from cache.)

Answer

where should I send you proxy server ip,port,login,pass to test?


Answer

Several more questions: 1. how can I set alternative dns for mailman.MxLookup(...) ? 2. is any caching mechanism implemented in mailman.MxLookup(...) ? 3. How can I setup alternative MAIL FROM for mailman.SendEmail(...) ?


Answer

The PostUrlEncoded method takes an HttpRequest object for one of its arguments. Properties that are HTTP request header fields will come from the HttpRequest object. Properties that specify a behavior, such as ReadTimeout, FetchFromCache, etc. apply to all HTTP methods. (Except where it doesn't make sense. For example, no POST's will be fetched from cache.)

what about cookies? and how can I setup referer and user agent in this case? They are request header fields, but where can I set them for Chilkat.HttpRequest ? also how can I add any alternative headers to the request? For QuickGetStr I was setting that in the following way (listed below), but how can I set them for PostUrlEncoded ?

Chilkat.Http http = new Chilkat.Http();

if (extraHeaders != null) { IDictionaryEnumerator extraHeadersEnumerator = extraHeaders.GetEnumerator();

                while (extraHeadersEnumerator.MoveNext())
                {
                    http.AddQuickHeader(extraHeadersEnumerator.Key.ToString(), extraHeadersEnumerator.Value.ToString());
                }
            }

            http.Referer = referer;
            http.UserAgent = userAgent;

Answer

I already sent to admin@chilkatsoft.com proxy server ip,port,login,pass, when should I wait for the answer?


Answer

I just need to know definitely does proxy work with sockets lib or not.


Answer

Yes, they do. However, your particular proxies only allow HTTP traffic. I tested both your HTTP and SOCKS proxies with Chilkat HTTP, and Chilkat works fine with them. However, your proxies DO NOT allow non-HTTP traffic, i.e. non-HTTP protocol traffic, such as SMTP, IMAP, etc. Chilkat's proxy implementation is functioning correctly, it's just that your particular proxy servers reject all non-HTTP traffic.


Answer

but I tried SOCKS (which send to you) with SMTP and IMAP - works with both. Ok if these ones does not work with sockets lib - can you give any proxy or any provider, which can work with your socket lib? Any example (maybe from your previous customers?)


Answer

The Chilkat Socket API works fine with HTTP and SOCKS proxies -- but your proxy servers do not allow non-HTTP traffic. For example, if the destination port is 80, your proxy server allows it. If the port is something like 25, it is rejected. I tested this with Chilkat Socket using the following C++ code:

// ...

sock.put_SocksVersion(5);
sock.put_SocksHostname("yourIpAddress");
sock.put_SocksUsername("yourLogin");
sock.put_SocksPassword("yourPassword");
sock.put_SocksPort(1080);

// This is successful:
bool success = sock.Connect("www.chilkatsoft.com",80,false,2000);

// If you change it to port 25, it does not.
bool success = sock.Connect("www.cknotes.com",25,false,2000);

printf("%s\n",sock.lastErrorText());

Answer

ok I will now try to find provider with proxies allowing other ports