From: Daniel Bye Date: 2007-10-03T03:17:50+09:00 Subject: Re: Net::POP3 and Firewall --sdtB3X0nJg68CQEu Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Oct 03, 2007 at 02:50:19AM +0900, Mike Ho wrote: > This code woks on my home PC - i.e. no firewall. Does anyone know what's= =20 > needed for it to run from behind a firewall? > ############### > require 'net/pop' >=20 >=20 > pop =3D Net::POP3.new('pop.mail.yahoo.co.uk', 110, false) > pop.start('myUserName', 'myPwd') > if pop.mails.empty? > puts 'No mail.' > else > i =3D 0 > pop.each_mail do |m| > File.open("inbox/#{i}", 'w') do |f| >=20 > f.write m.pop > end >=20 >=20 > i +=3D 1 > end > puts "#{pop.mails.size} mails popped." > end > pop.finish >=20 > ################# >=20 > I'd really appreciate any thoughts or comments. I don't know of any programmatic way to do this - have you spoken to your firewall administrator? He will need to allow POP3 traffic out to the=20 Internet (at least from the box hosting your app to the POP3 server it is trying to contact) and back again. You could also check out SOCKS, which may enable you to proxy through the firewall. Dan --=20 Daniel Bye _ ASCII ribbon campaign ( ) - against HTML, vCards and X - proprietary attachments in e-mail / \ --sdtB3X0nJg68CQEu Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQFHAok4ixf5fBYiFmoRAnXcAKDFmk/R9GdeCOL0H/eA1Tb5MbJkbwCbB6E9 xYufqwTYBi31KN1BI9wQJSc= =+B0c -----END PGP SIGNATURE----- --sdtB3X0nJg68CQEu--