2001-07-18 16:45:55 -04:00
=begin
2001-12-13 14:15:21 -05:00
= net/pop.rb
2001-07-18 16:45:55 -04:00
== <20> <> <EFBFBD> Υ 饤<CEA5> ֥<EFBFBD> <D6A5> <EFBFBD> <EFBFBD> ˤĤ<CBA4> <C4A4> <EFBFBD>
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 뤿<EFBFBD> <EFBFBD> <EFBFBD> Υ ץ<EFBFBD> <EFBFBD> ȥ<EFBFBD> <EFBFBD> <EFBFBD> POP3 (Post Office Protocol version 3) <20> <>
<EFBFBD> <EFBFBD> <EFBFBD> 饤<EFBFBD> ֥<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ǥ<EFBFBD> <EFBFBD> <EFBFBD> POP3 <20> μ<EFBFBD> <CEBC> <EFBFBD> <EFBFBD> <EFBFBD> [RFC1939]
((<URL:http://www.ietf.org/rfc/rfc1939.txt>)) <20> ˴ 𤤤Ƥ<F0A4A4A4> <C6A4> ޤ<EFBFBD> <DEA4> <EFBFBD>
== <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
=== <20> <EFBFBD> <E1A1BC> <EFBFBD> μ<EFBFBD> <CEBC> <EFBFBD>
2001-12-09 03:58:30 -05:00
<EFBFBD> ʲ<EFBFBD> <EFBFBD> Υ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ɤϡ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ƥե<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 'inbox/1' 'inbox/2'... <20> <>
<EFBFBD> <EFBFBD> <EFBFBD> ߡ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> о 夫<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ä<EFBFBD> <EFBFBD> ޤ<EFBFBD> <EFBFBD> <EFBFBD> pop3.server.address <20> <> Ŭ<EFBFBD> <C5AC>
<EFBFBD> ɤߤ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ƥ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2001-07-18 16:45:55 -04:00
require 'net/pop'
2001-12-09 03:58:30 -05:00
pop = Net::POP3.new( 'pop3.server.address', 110 )
pop.start( 'YourAccount', 'YourPassword' ) ###
if pop.mails.empty? then
puts 'no mail.'
else
i = 0
pop.each_mail do |m| # or "pop.mails.each ..."
File.open( 'inbox/' + i.to_s, 'w' ) {|f|
2001-07-18 16:45:55 -04:00
f.write m.pop
2001-12-09 03:58:30 -05:00
}
m.delete
i += 1
2001-07-18 16:45:55 -04:00
end
puts "#{pop.mails.size} mails popped."
2001-12-09 03:58:30 -05:00
end
pop.finish ###
POP <20> <> <EFBFBD> <EFBFBD> <EFBFBD> Фϥͥåȥ<C8A5> <EFA1BC> <EFBFBD> Τ ळ<CEA4> <E0A4B3> <EFBFBD> <EFBFBD> ¸ <EFBFBD> ߤ<EFBFBD> <DFA4> <EFBFBD> <EFBFBD> Τ ǡ<CEA4> <C7A1> ʤˤ<CAA4> <CBA4> Ż<EFBFBD> <C5BB> <EFBFBD> <F2A4B5A4> <EFBFBD>
<EFBFBD> ˤϤ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ˳<EFBFBD> <EFBFBD> ϼ<EFBFBD> ³<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ä<EFBFBD> <EFBFBD> 齪λ<EFBFBD> <EFBFBD> ³<EFBFBD> <EFBFBD> <EFBFBD> Ԥ<EFBFBD> <EFBFBD> ʤ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ф<EFBFBD> <EFBFBD> <EFBFBD>
<EFBFBD> ޤ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ԥ<EFBFBD> <EFBFBD> Τ <EFBFBD> Net::POP3#start <20> <> #finish <20> ǡ<EFBFBD> POP3 <20> <> <EFBFBD> ֥<EFBFBD> <D6A5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
<EFBFBD> Ϥ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ĤΥ <EFBFBD> åɤδ֤Ǥ<EFBFBD> <EFBFBD> <EFBFBD> ͭ<EFBFBD> <EFBFBD> <EFBFBD> ˤʤ<EFBFBD> <EFBFBD> ޤ<EFBFBD> <EFBFBD> <EFBFBD>
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> о <EFBFBD> <EFBFBD> Υ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> POPMail <20> <> <EFBFBD> ֥<EFBFBD> <D6A5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ȤȤ<C8A4> <C8A4> <EFBFBD> ɽ<EFBFBD> <C9BD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ƥ<EFBFBD> <C6A4> ꡢ<EFBFBD> <EAA1A2> <EFBFBD> <EFBFBD>
<EFBFBD> <EFBFBD> <EFBFBD> ֥<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ȤΥ <EFBFBD> åɤ<EFBFBD> <EFBFBD> Ƥ֤<EFBFBD> <EFBFBD> Ȥǥ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> äƤ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ä<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ꤹ<EFBFBD> <EFBFBD>
<EFBFBD> <EFBFBD> <EFBFBD> Ȥ<EFBFBD> <EFBFBD> Ǥ<EFBFBD> <EFBFBD> ޤ<EFBFBD> <EFBFBD> <EFBFBD> POP3#mails <20> Ϥ<EFBFBD> <CFA4> <EFBFBD> POPMail <20> <> <EFBFBD> ֥<EFBFBD> <D6A5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ȥ<EFBFBD> <C8A4> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ǥ<EFBFBD> <C7A4> ꡢ
POP3#each_mail <20> Ϥ<EFBFBD> <CFA4> <EFBFBD> <EFBFBD> <EFBFBD> mails.each <20> Υ <EFBFBD> <CEA5> 硼<EFBFBD> ȥ<EFBFBD> <C8A5> åȤǤ<C8A4> <C7A4> <EFBFBD>
2001-07-18 16:45:55 -04:00
=== û<> <C3BB> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
2001-12-09 03:58:30 -05:00
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ϥ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ƾ<EFBFBD> ά<EFBFBD> <EFBFBD> û<EFBFBD> <EFBFBD> <EFBFBD> ѥ<EFBFBD> åɤ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ˤ<EFBFBD> <EFBFBD> ʤ<EFBFBD> <EFBFBD> <EFBFBD> Ĺ<EFBFBD> Ǥ<EFBFBD> <EFBFBD> <EFBFBD>
<EFBFBD> ޤ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ֥<EFBFBD> <EFBFBD> å<EFBFBD> <EFBFBD> դ<EFBFBD> <EFBFBD> <EFBFBD> Net::POP3.start <20> <> <EFBFBD> Ȥ<EFBFBD> <C8A4> <EFBFBD> <EFBFBD> Ȥ<EFBFBD> POP3.new #start
#finish <20> <> ʻ <EFBFBD> <CABB> <EFBFBD> Ǥ<EFBFBD> <C7A4> ޤ<EFBFBD> <DEA4> <EFBFBD>
2001-07-18 16:45:55 -04:00
require 'net/pop'
2001-12-09 03:58:30 -05:00
Net::POP3.start( 'pop3.server.address', 110 )
'YourAccount', 'YourPassword' )
if pop.mails.empty? then
puts 'no mail.'
else
i = 0
pop.each_mail do |m| # or "pop.mails.each ..."
File.open( 'inbox/' + i.to_s, 'w' ) {|f|
f.write m.pop
}
m.delete
i += 1
end
puts "#{pop.mails.size} mails popped."
end
}
POP3#delete_all <20> <> <EFBFBD> Ȥ<EFBFBD> <C8A4> Ȥ<EFBFBD> <C8A4> <EFBFBD> <EFBFBD> <EFBFBD> #each_mail <20> <> m.delete <20> <>
ʻ <EFBFBD> <EFBFBD> <EFBFBD> Ǥ<EFBFBD> <EFBFBD> ޤ<EFBFBD> <EFBFBD> <EFBFBD>
require 'net/pop'
2001-07-18 16:45:55 -04:00
Net::POP3.start( 'pop3.server.address', 110,
'YourAccount', 'YourPassword' ) {|pop|
2001-12-09 03:58:30 -05:00
if pop.mails.empty? then
puts 'no mail.'
else
i = 0
pop.delete_all do |m|
File.open( 'inbox/' + i.to_s, 'w' ) {|f|
f.write m.pop
}
i += 1
end
end
2001-07-18 16:45:55 -04:00
}
<EFBFBD> <EFBFBD> <EFBFBD> 饹<EFBFBD> <EFBFBD> åɤ<EFBFBD> POP3.delete_all <20> <> <EFBFBD> Ȥ<EFBFBD> <C8A4> Ȥ<EFBFBD> <C8A4> <EFBFBD> <EFBFBD> <EFBFBD> û<EFBFBD> <C3BB> <EFBFBD> ʤ<EFBFBD> <CAA4> ޤ<EFBFBD> <DEA4> <EFBFBD>
require 'net/pop'
2001-12-09 03:58:30 -05:00
2001-07-18 16:45:55 -04:00
i = 0
Net::POP3.delete_all( 'pop3.server.address', 110,
'YourAccount', 'YourPassword' ) do |m|
File.open( 'inbox/' + i.to_s, 'w' ) {|f|
2001-12-09 03:58:30 -05:00
f.write m.pop
2001-07-18 16:45:55 -04:00
}
i += 1
end
=== <20> ե<EFBFBD> <D5A5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ľ<EFBFBD> ܽ<EFBFBD> <DCBD> <EFBFBD>
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ޤǤ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ǥ<EFBFBD> m.pop <20> <> <EFBFBD> <EFBFBD> ʬ<EFBFBD> ǥ<C7A5> <E1A1BC> <EFBFBD> <EFBFBD> <EFBFBD> ҤȤĤ<C8A4> ʸ<EFBFBD> <CAB8> <EFBFBD> <EFBFBD> <EFBFBD> Ȥ<EFBFBD> <C8A4> <EFBFBD>
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ȤäƤ<EFBFBD> <EFBFBD> ޤ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ȥ<EFBFBD> <EFBFBD> <EFBFBD> 3MB <20> <> <EFBFBD> 餤<EFBFBD> <E9A4A4> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʥ<CAA5> <E1A1BC> <EFBFBD> ξ<EFBFBD> <CEBE> <EFBFBD> <EFBFBD> <EFBFBD>
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ǤϤޤ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 礬<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ޤ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Τ 褦<EFBFBD> ʾ <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ϰʲ<EFBFBD> <EFBFBD> Τ 褦<EFBFBD> <EFBFBD> m.pop
<EFBFBD> <EFBFBD> File <20> <> <EFBFBD> ֥<EFBFBD> <D6A5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ȥ<EFBFBD> Ϳ <EFBFBD> <CDBF> <EFBFBD> <EFBFBD> <EFBFBD> ꤬<EFBFBD> Ȥ<EFBFBD> <C8A4> ޤ<EFBFBD> <DEA4> <EFBFBD>
require 'net/pop'
Net::POP3.delete_all( 'pop3.server.address', 110,
'YourAccount', 'YourPassword' ) do |m|
File.open( 'inbox', 'w' ) {|f|
2001-12-09 03:58:30 -05:00
m.pop f ####
2001-07-18 16:45:55 -04:00
}
end
=== APOP
2001-12-13 14:15:21 -05:00
Net::POP3 <20> <> <EFBFBD> 饹<EFBFBD> Τ <EFBFBD> <CEA4> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Net::APOP <20> <> <EFBFBD> 饹<EFBFBD> <E9A5B9> <EFBFBD> Ȥ<EFBFBD> <C8A4> ȡ<EFBFBD> ǧ<EFBFBD> ڻ<EFBFBD> <DABB> <EFBFBD> APOP <20> <>
<EFBFBD> Ȥ<EFBFBD> <EFBFBD> 褦<EFBFBD> ˤʤ<EFBFBD> <EFBFBD> ޤ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ޤ<EFBFBD> ưŪ<EFBFBD> ˥Ρ <EFBFBD> <EFBFBD> ޥ<EFBFBD> POP <20> <> APOP <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <F2A4B9A4> ˤϡ<CBA4>
<EFBFBD> ʲ<EFBFBD> <EFBFBD> Τ 褦<EFBFBD> <EFBFBD> Net::POP3.APOP() <20> <EFBFBD> åɤ<C3A5> <C9A4> Ȥ<EFBFBD> <C8A4> Τ <EFBFBD> <CEA4> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ǥ<EFBFBD> <C7A4> <EFBFBD>
2001-07-18 16:45:55 -04:00
require 'net/pop'
2001-12-13 14:15:21 -05:00
# use APOP authentication if $isapop == true
pop = Net::POP3.APOP($isapop).new( 'apop.server.address', 110 )
pop.start( YourAccount', 'YourPassword' ) {|pop|
2001-12-09 03:58:30 -05:00
# Rest code is same.
2001-07-18 16:45:55 -04:00
}
2001-12-13 14:15:21 -05:00
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ˡ<EFBFBD> ϥ<EFBFBD> <EFBFBD> 饹<EFBFBD> <EFBFBD> <EFBFBD> Τ <EFBFBD> <EFBFBD> Ѥ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Τ ǡ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 饹<EFBFBD> <EFBFBD> åɤ<EFBFBD> start <20> <> foreach<63> <68>
delete_all<EFBFBD> <EFBFBD> auth_only <20> ʤɤ<CAA4> APOP <20> ȤȤ<C8A4> <C8A4> ˻Ȥ<CBBB> <C8A4> ޤ<EFBFBD> <DEA4> <EFBFBD>
2001-07-18 16:45:55 -04:00
== Net::POP3 class
=== <20> <> <EFBFBD> 饹<EFBFBD> <EFBFBD> å<EFBFBD>
2001-08-16 23:08:45 -04:00
: new( address, port = 110, apop = false )
2001-07-18 16:45:55 -04:00
Net::POP3 <20> <> <EFBFBD> ֥<EFBFBD> <D6A5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ȥ<EFBFBD> <C8A4> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ޤ<EFBFBD> <DEA4> <EFBFBD> <EFBFBD> ޤ<EFBFBD> <DEA4> <EFBFBD> ³<EFBFBD> Ϥ<EFBFBD> <CFA4> ޤ<EFBFBD> <DEA4> <EFBFBD> <EFBFBD> <EFBFBD>
apop <20> <> <EFBFBD> <EFBFBD> <EFBFBD> Τ Ȥ<CEA4> <C8A4> <EFBFBD> APOP ǧ<> ڤ<EFBFBD> <DAA4> Ԥ<EFBFBD> <D4A4> <EFBFBD> <EFBFBD> ֥<EFBFBD> <D6A5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ȥ<EFBFBD> <C8A4> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ޤ<EFBFBD> <DEA4> <EFBFBD>
2001-08-16 23:08:45 -04:00
: start( address, port = 110, account, password )
: start( address, port = 110, account, password ) {|pop| .... }
2001-07-18 16:45:55 -04:00
address <20> <> port <20> ֥ݡ<D6A5> <DDA1> Ȥ<EFBFBD> <C8A4> <EFBFBD> ³<EFBFBD> <C2B3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> account <20> ѥ<EFBFBD> <D1A5> <EFBFBD> <EFA1BC>
password <20> <> POP <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ޤ<F3A4B7A4> <DEA4> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> port <20> <> nil <20> <> <EFBFBD> Ϥ<EFBFBD> <CFA4> <EFBFBD>
POP3 <20> Υ ǥե<C7A5> <D5A5> <EFBFBD> <EFBFBD> ȥݡ<C8A5> <DDA1> <EFBFBD> (110)<29> <> <EFBFBD> Ȥ<EFBFBD> <C8A4> ޤ<EFBFBD> <DEA4> <EFBFBD>
2001-12-09 03:58:30 -05:00
Net::POP3.start( addr, port, account, password ) {|pop|
pop.each_mail do |m|
file.write m.pop
m.delete
end
}
2001-07-18 16:45:55 -04:00
2001-12-13 14:15:21 -05:00
: APOP( is_apop )
bool <20> <> <EFBFBD> <EFBFBD> <EFBFBD> ʤ<EFBFBD> Net::APOP <20> <> <EFBFBD> 饹<EFBFBD> <E9A5B9> <EFBFBD> <EFBFBD> <EFBFBD> ʤ<EFBFBD> Net::POP3 <20> <> <EFBFBD> 饹<EFBFBD> <E9A5B9> <EFBFBD> ֤<EFBFBD> <D6A4> ޤ<EFBFBD> <DEA4> <EFBFBD>
<20> ʲ<EFBFBD> <CAB2> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Τ 褦<CEA4> ˻ȤäƤ<C3A4> <C6A4> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
# example 1
pop = Net::POP3::APOP($isapop).new( addr, port )
# example 2
Net::POP3::APOP($isapop).start( addr, port ) {|pop|
....
}
2001-08-16 23:08:45 -04:00
: foreach( address, port = 110, account, password ) {|mail| .... }
2001-07-18 16:45:55 -04:00
POP <20> <> <EFBFBD> å<EFBFBD> <C3A5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <F2B3ABA4> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> о <EFBFBD> <D0BE> Τ <EFBFBD> <CEA4> ٤ƤΥ <CEA5> <E1A1BC> <EFBFBD> <EFBFBD> <EFBFBD> Ф<EFBFBD> <D0A4> Ʒ <EFBFBD> <C6B7> <EFBFBD> <EFBFBD> ֤<EFBFBD> <D6A4> ޤ<EFBFBD> <DEA4> <EFBFBD>
<20> ʲ<EFBFBD> <CAB2> <EFBFBD> Ʊ<EFBFBD> <C6B1> <EFBFBD> Ǥ<EFBFBD> <C7A4> <EFBFBD>
Net::POP3.start( address, port, account, password ) {|pop|
2001-12-09 03:58:30 -05:00
pop.each_mail do |m|
yield m
end
2001-07-18 16:45:55 -04:00
}
# example
Net::POP3.foreach( 'your.pop.server', 110,
'YourAccount', 'YourPassword' ) do |m|
file.write m.pop
m.delete if $DELETE
end
2001-08-16 23:08:45 -04:00
: delete_all( address, port = 110, account, password )
: delete_all( address, port = 110, account, password ) {|mail| .... }
2001-07-18 16:45:55 -04:00
POP <20> <> <EFBFBD> å<EFBFBD> <C3A5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <F2B3ABA4> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> о <EFBFBD> <D0BE> Υ <CEA5> <E1A1BC> <EFBFBD> ٤ƺ<D9A4> <C6BA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ޤ<EFBFBD> <DEA4> <EFBFBD>
<20> ֥<EFBFBD> <D6A5> å<EFBFBD> <C3A5> <EFBFBD> Ϳ <EFBFBD> <CDBF> <EFBFBD> <EFBFBD> <EFBFBD> 줿<EFBFBD> <ECA4BF> <EFBFBD> Ϻ <EFBFBD> <CFBA> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ˥֥<CBA5> <D6A5> å<EFBFBD> <C3A5> ˤ<EFBFBD> <CBA4> Υ <CEA5> <E1A1BC> <EFBFBD> <EFBFBD>
<20> Ϥ<EFBFBD> <CFA4> ޤ<EFBFBD> <DEA4> <EFBFBD> <EFBFBD> ʲ<EFBFBD> <CAB2> <EFBFBD> Ʊ<EFBFBD> <C6B1> <EFBFBD> Ǥ<EFBFBD> <C7A4> <EFBFBD>
# example
Net::POP3.delete_all( addr, nil, 'YourAccount', 'YourPassword' ) do |m|
m.pop file
end
2001-08-16 23:08:45 -04:00
: auth_only( address, port = 110, account, password )
2001-07-18 16:45:55 -04:00
POP <20> <> <EFBFBD> å<EFBFBD> <C3A5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ǧ<EFBFBD> ڤ<EFBFBD> <DAA4> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ԥä<D4A4> <C3A4> <EFBFBD> ³<EFBFBD> <C2B3> <EFBFBD> ڤ<EFBFBD> <DAA4> ޤ<EFBFBD> <DEA4> <EFBFBD>
POP before SMTP <20> <> <EFBFBD> ѤǤ<D1A4> <C7A4> <EFBFBD>
# example
2001-12-09 03:58:30 -05:00
Net::POP3.auth_only( 'your.pop3.server',
nil, # using default (110)
'YourAccount',
'YourPassword' )
2001-07-18 16:45:55 -04:00
=== <20> <EFBFBD> å<EFBFBD>
: start( account, password )
: start( account, password ) {|pop| .... }
<20> <> <EFBFBD> ⡼<EFBFBD> ȥۥ<C8A5> <DBA5> ȤȤ<C8A4> <C8A4> <EFBFBD> ³<EFBFBD> Ϥ<F2B3ABBB> <CFA4> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ȥ<EFBFBD> account<6E> <74>
<20> ѥ<EFBFBD> <D1A5> <EFBFBD> ɤ<EFBFBD> password <20> <> <EFBFBD> Ȥä<C8A4> POP <20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ޤ<F3A4B7A4> <DEA4> <EFBFBD>
: active?
POP3 <20> <> <EFBFBD> å<EFBFBD> <C3A5> <EFBFBD> <EFBFBD> <EFBFBD> <F3A4ACB3> Ϥ<EFBFBD> <CFA4> <EFBFBD> <EFBFBD> Ƥ<EFBFBD> <C6A4> <EFBFBD> <EFBFBD> 鿿<EFBFBD> <E9BFBF>
: address
<20> <> ³<EFBFBD> <C2B3> <EFBFBD> 륢<EFBFBD> ɥ쥹
: port
<20> <> ³<EFBFBD> <C2B3> <EFBFBD> <EFBFBD> <EFBFBD> ݡ<EFBFBD> <DDA1> <EFBFBD> <EFBFBD> ֹ<EFBFBD>
: open_timeout
: open_timeout=(n)
<20> <> ³<EFBFBD> <C2B3> <EFBFBD> <EFBFBD> <EFBFBD> Ԥĺ<D4A4> <C4BA> <EFBFBD> <EFBFBD> ÿ<EFBFBD> <C3BF> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ÿ<EFBFBD> <C3BF> <EFBFBD> <EFBFBD> äƤ⥳<C6A4> ͥ<EFBFBD> <CDA5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
<20> <> <EFBFBD> <EFBFBD> <EFBFBD> ʤ<EFBFBD> <CAA4> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 㳰 TimeoutError <20> <> ȯ<EFBFBD> <C8AF> <EFBFBD> <EFBFBD> <EFBFBD> ޤ<EFBFBD> <DEA4> <EFBFBD>
: read_timeout
: read_timeout=(n)
<20> ɤߤ<C9A4> <DFA4> <EFBFBD> (read(1) <20> <> <EFBFBD> <EFBFBD> ) <20> ǥ֥<C7A5> <D6A5> å<EFBFBD> <C3A5> <EFBFBD> <EFBFBD> Ƥ褤<C6A4> <E8A4A4> <EFBFBD> <EFBFBD> <EFBFBD> ÿ<EFBFBD> <C3BF> <EFBFBD>
<20> <> <EFBFBD> <EFBFBD> <EFBFBD> ÿ<EFBFBD> <C3BF> <EFBFBD> <EFBFBD> äƤ<C3A4> <C6A4> ɤߤ<C9A4> <DFA4> <EFBFBD> <EFBFBD> ʤ<EFBFBD> <CAA4> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 㳰 TimeoutError <20> <> ȯ<EFBFBD> <C8AF> <EFBFBD> <EFBFBD> <EFBFBD> ޤ<EFBFBD> <DEA4> <EFBFBD>
: finish
POP3 <20> <> <EFBFBD> å<EFBFBD> <C3A5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> λ<EFBFBD> <CEBB> <EFBFBD> ޤ<EFBFBD> <DEA4> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> å<EFBFBD> <C3A5> <EFBFBD> <EFBFBD> <EFBFBD> <F3B3ABBB> <EFBFBD> <EFBFBD> ˤ<EFBFBD> <CBA4> Υ <CEA5> åɤ<C3A5>
<20> ƤФ줿<D0A4> <ECA4BF> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 㳰 IOError <20> <> ȯ<EFBFBD> <C8AF> <EFBFBD> <EFBFBD> <EFBFBD> ޤ<EFBFBD> <DEA4> <EFBFBD>
: mails
Net::POPMail <20> <> <EFBFBD> ֥<EFBFBD> <D6A5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ȥ<EFBFBD> <C8A4> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <F2A4ABA4> <EFBFBD> <EFBFBD> ޤ<EFBFBD> <DEA4> <EFBFBD>
<20> <> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ϥ<EFBFBD> <CFA5> å<EFBFBD> <C3A5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ϥ<F2B3ABBB> <CFA4> <EFBFBD> <EFBFBD> Ȥ<EFBFBD> <C8A4> ˼<EFBFBD> ưŪ<C6B0> ˹<EFBFBD> <CBB9> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ޤ<EFBFBD> <DEA4> <EFBFBD>
: each_mail {|popmail| .... }
: each {|popmail| .... }
pop3.mails.each <20> <> Ʊ<EFBFBD> <C6B1> <EFBFBD> Ǥ<EFBFBD> <C7A4> <EFBFBD>
: delete_all
: delete_all {|popmail| .... }
<20> <> <EFBFBD> <EFBFBD> <EFBFBD> о <EFBFBD> <D0BE> Υ <CEA5> <E1A1BC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ƾõ<C3B5> ޤ<EFBFBD> <DEA4> <EFBFBD>
<20> ֥<EFBFBD> <D6A5> å<EFBFBD> <C3A5> <EFBFBD> Ϳ <EFBFBD> <CDBF> <EFBFBD> <EFBFBD> <EFBFBD> 줿<EFBFBD> Ȥ<EFBFBD> <C8A4> Ͼõ<C3B5> <EEA4B9> <EFBFBD> <EFBFBD> <EFBFBD> ˤ<EFBFBD> <CBA4> <EFBFBD> POPMail <20> <> <EFBFBD> ֥<EFBFBD> <D6A5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ȥ<EFBFBD>
<20> ֥<EFBFBD> <D6A5> å<EFBFBD> <C3A5> <EFBFBD> <EFBFBD> Ϥ<EFBFBD> <CFA4> ޤ<EFBFBD> <DEA4> <EFBFBD>
# example
n = 1
pop.delete_all do |m|
File.open("inbox/#{n}") {|f| f.write m.pop }
n += 1
end
: auth_only( account, password )
POP <20> <> <EFBFBD> å<EFBFBD> <C3A5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ǧ<EFBFBD> ڤ<EFBFBD> <DAA4> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ԥä<D4A4> <C3A4> <EFBFBD> ³<EFBFBD> <C2B3> <EFBFBD> ڤ<EFBFBD> <DAA4> ޤ<EFBFBD> <DEA4> <EFBFBD>
POP before SMTP <20> <> <EFBFBD> ѤǤ<D1A4> <C7A4> <EFBFBD>
# example
pop = Net::POP3.new( 'your.pop3.server' )
pop.auth_only 'YourAccount', 'YourPassword'
: reset
<20> <> <EFBFBD> å<EFBFBD> <C3A5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ꥻ<EFBFBD> åȤ<C3A5> <C8A4> ޤ<EFBFBD> <DEA4> <EFBFBD>
<20> <> <EFBFBD> <EFBFBD> Ū<EFBFBD> ˤ<EFBFBD> POPMail#delete <20> Ǿä<C7BE> <C3A4> <EFBFBD> <EFBFBD> <EFBFBD> 뤬<EFBFBD> <EBA4AC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 褷<EFBFBD> ޤ<EFBFBD> <DEA4> <EFBFBD>
(POP3 <20> Ǥϥ<CFA5> <E1A1BC> <EFBFBD> <EFBFBD> <EFBFBD> Ĥ<EFBFBD> <C4A4> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 褹<EFBFBD> <E8A4B9> <EFBFBD> <EFBFBD> ˡ<EFBFBD> Ϥ<EFBFBD> <CFA4> <EFBFBD> <EFBFBD> ޤ<EFBFBD> <DEA4> <EFBFBD> )
== Net::APOP
<EFBFBD> <EFBFBD> <EFBFBD> Υ <EFBFBD> <EFBFBD> 饹<EFBFBD> ǤϿ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> åɤ<EFBFBD> Ƴ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ƥ<EFBFBD> <EFBFBD> ޤ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD>
ǧ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> APOP <20> <> <EFBFBD> Ѥ<EFBFBD> <D1A4> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> Ǥ<EFBFBD> <C7A4> <EFBFBD>
=== <20> <> <EFBFBD> <EFBFBD> <EFBFBD> ѡ <EFBFBD> <D1A1> <EFBFBD> <EFBFBD> 饹
Net::POP3
== Net::POPMail
POP <20> <> <EFBFBD> <EFBFBD> <EFBFBD> С <EFBFBD> <D0A1> <EFBFBD> <EFBFBD> Υ <CEA5> <E1A1BC> <EFBFBD> <EFBFBD> <EFBFBD> ̤<EFBFBD> <CCA4> <EFBFBD> <EFBFBD> <EFBFBD> Ū<EFBFBD> <C5AA> ɽ<EFBFBD> <C9BD> <EFBFBD> <EFBFBD> <EFBFBD> 륯<EFBFBD> 饹<EFBFBD> <E9A5B9>
<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> μ<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> õ<EFBFBD> <EFBFBD> Ȥ<EFBFBD> <EFBFBD> ä<EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ץ<EFBFBD> <EFBFBD> 벽<EFBFBD> <EFBFBD> <EFBFBD> ޤ<EFBFBD> <EFBFBD> <EFBFBD>
=== <20> <EFBFBD> å<EFBFBD>
: pop( dest = '' )
<20> <EFBFBD> <E1A1BC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> dest <20> <> << <20> <EFBFBD> åɤ<C3A5> <C9A4> Ȥäƽ <C6BD> <F1A4ADA4> ߤޤ<DFA4> <DEA4> <EFBFBD>
dest <20> <> <EFBFBD> ֤<EFBFBD> <D6A4> ޤ<EFBFBD> <DEA4> <EFBFBD>
# example
allmails = nil
POP3.start( 'your.pop3.server', 110,
2001-12-09 03:58:30 -05:00
'YourAccount, 'YourPassword' ) {|pop|
allmails = pop.mails.collect {|popmail| popmail.pop }
}
2001-07-18 16:45:55 -04:00
: pop {|str| .... }
<20> <EFBFBD> <E1A1BC> <EFBFBD> <EFBFBD> ʸ<EFBFBD> <CAB8> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <F2BEAFA4> Ť<EFBFBD> <C5A4> ɤߤ<C9A4> <DFA4> ߡ<EFBFBD> <DFA1> 缡<EFBFBD> ֥<EFBFBD> <D6A5> å<EFBFBD> <C3A5> <EFBFBD> Ϳ <EFBFBD> <CDBF> <EFBFBD> ޤ<EFBFBD> <DEA4> <EFBFBD>
# example
POP3.start( 'localhost', 110 ) {|pop3|
2001-12-09 03:58:30 -05:00
pop3.each_mail do |m|
m.pop do |str|
# do anything
end
end
2001-07-18 16:45:55 -04:00
}
: header
<20> إå<D8A5> <C3A5> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʸ<EFBFBD> <CAB8> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ֤<EFBFBD> <D6A4> ޤ<EFBFBD> <DEA4> <EFBFBD>
: top( lines )
<20> <EFBFBD> <E1A1BC> <EFBFBD> إå<D8A5> <C3A5> <EFBFBD> lines <20> Ԥ֤<D4A4> <D6A4> <EFBFBD> <EFBFBD> <EFBFBD> ʸ<EFBFBD> <CAB8> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ʸ<EFBFBD> <CAB8> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ֤<EFBFBD> <D6A4> ޤ<EFBFBD> <DEA4> <EFBFBD>
: delete
<20> <> <EFBFBD> <EFBFBD> <EFBFBD> о 夫<D0BE> <E5A4AB> <EFBFBD> <EFBFBD> <E1A1BC> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> ޤ<EFBFBD> <DEA4> <EFBFBD>
: size
<20> <EFBFBD> <E1A1BC> <EFBFBD> Υ <EFBFBD> <CEA5> <EFBFBD> <EFBFBD> <EFBFBD> (ñ<> ̤ϥХ <CFA5> <D0A5> <EFBFBD> ) <20> <EFBFBD> <F2A4ABA4> <EFBFBD> <EFBFBD> ޤ<EFBFBD> <DEA4> <EFBFBD>
: deleted?
<20> <EFBFBD> 뤬<EFBFBD> <EBA4AC> <EFBFBD> <EFBFBD> <EFBFBD> о <EFBFBD> <D0BE> Ǿõ<C3B5> <EEA4B5> <EFBFBD> Ƥ<EFBFBD> <C6A4> <EFBFBD> <EFBFBD> Ȥ<EFBFBD> <C8A4> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> õ<C3B5> Ƥ<EFBFBD> <C6A4> ޤä<DEA4> <C3A4> <EFBFBD>
POP3#reset <20> <> <EFBFBD> Ȥ<EFBFBD> <C8A4> ʳ<EFBFBD> <CAB3> <EFBFBD> <EFBFBD> <EFBFBD> <EFBFBD> 褹<EFBFBD> <E8A4B9> <EFBFBD> <EFBFBD> ˡ<EFBFBD> Ϥ<EFBFBD> <CFA4> <EFBFBD> <EFBFBD> ޤ<EFBFBD> <DEA4> <EFBFBD> <EFBFBD> <EFBFBD>
=end