module grabber.mailbox_mock
¶
Short summary¶
module pymmails.grabber.mailbox_mock
Defines a mailbox using IMAP
Classes¶
class |
truncated documentation |
---|---|
Define a mail box reading from file (kind of mock). |
Methods¶
method |
truncated documentation |
---|---|
enumerate all mails in a folder |
|
enumerates all mails in folder folder from a user or sent to a user |
|
enumerates all mails in folder folder with a subject verifying a regular expression |
|
returns the list of folder of the mail box |
|
login (nothing to do here) |
|
logout (nothing to do here) |
|
extract a mail from a file |
Documentation¶
Defines a mailbox using IMAP
- class pymmails.grabber.mailbox_mock.MailBoxMock(folder, pwd, fLOG=<function noLOG>)¶
Bases:
MailBoxImap
Define a mail box reading from file (kind of mock).
- Parameters:
folder – folder to look into
pwd – password, in case mails are encrypted
fLOG – logging function
For gmail, it is
imap.gmail.com
and ssl must be true- __init__(folder, pwd, fLOG=<function noLOG>)¶
- Parameters:
folder – folder to look into
pwd – password, in case mails are encrypted
fLOG – logging function
For gmail, it is
imap.gmail.com
and ssl must be true
- enumerate_mails_in_folder(folder, skip_function=None, pattern='ALL')¶
enumerate all mails in a folder
- Parameters:
folder – folder
skip_function – to skip mail or None to keep them all
pattern –
'ALL'
by default, unused otherwise
- Returns:
enumerator on mails
- enumerate_search_person(person, folder, skip_function=None, date=None, max_dest=5, body=True)¶
enumerates all mails in folder folder from a user or sent to a user
- Parameters:
person – person to look for
folder – folder name
skip_function – if not None, use this function on the header/body to avoid loading the entire message (and skip it)
pattern – search pattern (see below)
max_dest – maximum number of receivers
body – also extract the body
- Returns:
iterator on (message)
- enumerate_search_subject(subject, folder, skip_function=None, date=None, max_dest=5)¶
enumerates all mails in folder folder with a subject verifying a regular expression
- Parameters:
subject – subject to look for
folder – folder name
skip_function – if not None, use this function on the header/body to avoid loading the entire message (and skip it)
pattern – search pattern (see below)
max_dest – maximum number of receivers
- Returns:
iterator on (message)
- folders()¶
returns the list of folder of the mail box
- login(nothing to do here)¶
- logout(nothing to do here)¶
- read_mail_from_file(filename)¶
extract a mail from a file
- Parameters:
filename – filename
- Returns:
MailMessage