Saturday, April 14, 2007

More on how we use tunneling

Here is one more example of how we use our own tunneling. We needed to import messages from mbx format(Eudora) into gmail. We knew that there is a utility, GML(Google Mail Loader), to scan mailboxes and send individual email through an SMTP server to gmail: http://www.marklyon.org/gmail/
The problem was that typically ISPs block access to other SMTP servers and limit or throttle access to their own SMTP server. So, here is the way we used it:
In socks2http through PortMapper we created the following mapping:
Local port 25 ==> localhost, port 25
This means that local port 25 is forwarded to 'localhost'. However 'localhost' is resolved on the gateway which means that SMTP server on the gateway will be used for forwarding email. Our SMTP server is configured to accept email only from the same box, which works out well as the gateway running on the same box with SMTP server will be its SMTP client. In this case GML utility should be configured to use 'localhost' as SMTP server(in GML localhost resolves to the machine where socks2http is running).
Everything worked as planned, except we ran into a small snag. Instead of GML utility
we used our own SMTP sender(to avoid built-in 2 second delay) which flooded gmail server with emails and caused it to throttle our emails. In order to overcome it we had to put a 1 second delay between sending emails. This method allowed us to import over 10000 emails in about 3 hours.

For objectivity sake we need to mention that there is another way to import mail into gmail using imap/pop3 server and gmail's fetch from pop3 function: http://www.zoliblog.com/blog/_archives/2007/3/28/2840555.html
However it seems that realistically you need a commercial imap account to accomplish it.

No comments: