Ruby Mail Library Reference Manual


Mail::POPSession

Super Class

Mail::Session

Class Methods

new( address = 'localhost', port = 110 )

This method create a new POPSession object but this will not open connection.

Methods

start( account, password )
This method start POP session.
each{|popmail| ...}
This method is equals to "popsession.mails.each"
mails

This method returns an array of POPSession::POPMail. This array is renewed when login.


Mail::POPSession::POPMail

A class of mail which exists on POP server.

Super Class

Object

Method

all
pop
mail

This method fetches a mail and return it.

header

This method fetches only mail header.

top( lines )

This method fetches mail header and 'lines' lines body.

delete
delete!

This method deletes mail.

size

size of mail(bytes)

deleted?

true if mail was deleted


Mail::APOPSession

This class has no new methods. Only way of authetication is changed.

Super Class

Mail::POPSession

Mail::POP3

POP3 protocol class.

Super Class

Mail::Protocol

Class Methods

new( socket )

This method creates new POP3 object. 'socket' must be ProtocolSocket.

Methods

auth( account: String, password: String )

This method do POP authorization (no RPOP) In case of failed authorization, raises Protocol::ProtocolError exception.

list

a list of mails which existing on server. The list is an array like "array[ number ] = size".

ex:

The list from server is

1 2452
2 3355
4 9842
   :

then, an array is

[ nil, 2452, 3355, nil, 9842, ... ]
quit

This method finishes POP3 session.

rset

This method reset all changes done in current session, by sending 'RSET' command.

top( num : Integer, lines = 0 : Integer )

This method gets all mail header and 'lines' lines body by sending 'TOP' command. 'num' is mail number.

warning: the TOP command is 'Optional' in RFC1939 (POP3)

retr( num : Integer )

This method gets a mail by 'RETR' command. 'num' is mail number.

dele( num : Integer )

This method deletes a mail on server by 'DELE'.

APOP

Super Class

POP3

Methods

auth( account: String, password: String )

This method do authorization by sending 'APOP' command. If server is not APOP server, this raises INETprotocol::ProtoAuthError exception. On other errors, raises INETprotocol::ProtocolError.


author: Minero Aoki (aamine@dp.u-netsusurf.ne.jp)