This information is outdated, check this page for the latest information!!!
You will require a jailbroken device for this. This is a combination of existing techniques and additional portforwards. The ‘tethering’ trick using 3proxy (socks) works but not for your mail (on OSX) unless you use thunderbird instead of mail.app The other option is to use ‘slirp’ but i did not find a usable slirp-binary for the 2.0 firmware of the device.
If you have access to a proxy server, use that and continue on at the SSH part, otherwise read on and install the socks service on the device. For mail.app you will need SSH, as apparently socks won’t work there 🙁
Be aware that using your device as a gateway may not be approved by your provider!
Socks (Safari, Firefox & Thunderbird, Socks-capable applications)
- Device : From Cydia install ‘Mobile Terminal’ and ‘3proxy’ packages.
- Mac : Create a new wireless network (click on the wireless icon and create network)
- Device : Connect to the wireless network and check your IP address (presumably a 169.xxx address)
- Device : Start MobileTerminal, wait for the prompt and type ‘socks’ and press ENTER
- Device : Now press the home button (which will leave MobileTerminal running in the background) and start safari and browse to a webpage (google.com?)
- Mac : Start preferences, choose network settings, airport, proxy. Apply the socks proxy and use the IP address from the device and port 1080. Press apply/ok
- Mac : Start safari and browse to a page, this should work now
- Mac : Mail.app won’t work (see SSH part)
- Mac : Firefox/Thunderbird will work when you apply dns-over-socks. To do this type ‘about:config’ in Firefox or browse to Preferences/General/Button-configuration-editor. Next type ‘socks’ in the filter bar (on top of current window) and adjust the socks…dns entry to ‘true’ (doubleclicking will do the trick). Now browsing with firefox or fetching mail with thunderbird will work
- Mac : Other socks compatible applications can use the device’s IP address and port 1080 (type 4 if i recall correctly).
- Device : When done start MobileTerminal again and press-hold the home button for 6-10 seconds to close MobileTerminal which in result will close socks
SSH (Mail.app, Safari/firefox using proxies, any other non-socks application)
- Device : From Cydia install ‘OpenSSH’ and make sure it’s activated (for security purposes change your password using MobileTerminal or SSH itself (log in remotely). You might want to install BossPrefs using Cydia to have a nice application on your device where you can switch on/off things including SSH (saves battery power)
- Mac : Create a new wireless network (click on the wireless icon and create network)
- Device : Connect to the wireless network and check your IP address (presumably a 169.xxx address)
- Mac : Start the terminal application and enter “sudo ssh -Lxxxx:ip.ad.dr.ess:yyyy root@ip.ho.ne.IP” where ip.ph.on.IP is the device’s IP address (presumably a 169.xxx address) the ip.ad.dr.ess is the address of your mailserver, xxxx is a port chosen number (i prefer 9993) and yyyy is the port number of your mailserver (993 incase of secure imap). You will be logged into your iphone, just leave it there.
- Mac : Change your mail.app preferences to use port 9993 on localhost instead of 993 on ip.ad.dr.ess and test your connection.
- You can add as many -L xxxx:ip.ad.dr.ess:yyyy combinations as you want (just seperate them with spaces) so the same goes for the outgoing smtp which can be -L2525:mail.somewhere.us:25 but make sure you are allowed to send mail through there. Most of the times your milage may improve by using your device’s provider (mail.vodafone.co.uk:25 for example).