Daniel Bye
10/2/2007 6:18:00 PM
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
> needed for it to run from behind a firewall?
> ###############
> require 'net/pop'
>
>
> pop = Net::POP3.new('pop.mail.yahoo.co.uk', 110, false)
> pop.start('myUserName', 'myPwd')
> if pop.mails.empty?
> puts 'No mail.'
> else
> i = 0
> pop.each_mail do |m|
> File.open("inbox/#{i}", 'w') do |f|
>
> f.write m.pop
> end
>
>
> i += 1
> end
> puts "#{pop.mails.size} mails popped."
> end
> pop.finish
>
> #################
>
> 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
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
--
Daniel Bye
_
ASCII ribbon campaign ( )
- against HTML, vCards and X
- proprietary attachments in e-mail /