Between the <start> and <end> lines is a sample configuration file for selecting emails from an email client's mailboxes.

The <start> and <end> lines are not part of the sample file.

The operamailstore, operaaccountdefs, and account, lines are relevant to the email client in the obsolete Opera 12 browser.  Code relevant to this browser remains in EmailStore so the description remains too.

<start>
mailboxstyle opera
mailboxstyle mbox
#operamailstore ~/.opera/mail/store
#operaaccountdefs ~/.opera/mail/accounts.ini
mboxmailstore ~/a_mailbox_file.mbs
mboxmailstore ~/another_mailbox_file.mbs
earliestfromdate 15 April 2011
mostrecentfromdate 2013-06-25
account anybody@beeteeinternut.com
account someoneelse@minus.com
emailsfrom a.sender@verdant.net
emailsfrom b.sender@verdant.net
collected selected_emails

exclude 20171008021048a.sender@verdant.net+0000.mbs
<end>

The lines can be in any order.

From the top:


Python supports the Maildir, mbox, MH, Babyl, and MMDF formats.  All use a directory structure with each email held in it's own file in the appropriate mailbox directory, except mbox which holds all emails for a mailbox in a mailbox file.

Opera uses a directory structure which is closest to MH.  Each file holds one email, and is held as a leaf in a directory tree '<account>/yyyy/mm/dd' where the date is derived from the date in the 'From' line.  Well, MH does not seem to ban the naming scheme adopted by Opera.

The final mailboxstyle line determines the format.

mailboxstyle opera
mailboxstyle mbox


The default root directory of an Opera email store is in the operamailstore line.

#operamailstore ~/.opera/mail/store


The default account file of an Opera email store is in the operaaccountdefs line.

#operaaccountdefs ~/.opera/mail/accounts.ini


The paths to mailbox-style email files which will be searched for emails are in mboxmailstore lines.

mboxmailstore ~/a_mailbox_file.mbs
mboxmailstore ~/another_mailbox_file.mbs


The most recent year's worth of emails is selected from each mailbox by default.  Thus it is allowed that the selected emails from mailbox A are dated 2009 while emails dated 2013 are selected from mailbox B.

When only one of the dates is given, the other is assumed to be one year away.

If the earliest from date is after the most recent from date no emails are selected.

Several date formats are accepted but the two preferred formats occur in the examples.

earliestfromdate 15 April 2011
mostrecentfromdate 2013-06-25


Emails can be selected by recipient address.  This can mean looking at 'To' and 'CC' and 'BCC' addressees, but for Opera mail stores it can be done by including the relevant <account> directories and ignoring emails sent by the account holder.  Note that Opera stores both sent and received emails in the '<account>/yyyy/mm/dd' directories.

account anybody@beeteeinternut.com
account someoneelse@minus.com


Emails can be selected by sender address.  When any emailsfrom lines are present only emails from the named addresses are selected.

emailsfrom a.sender@verdant.net
emailsfrom b.sender@verdant.net


The selected email files are copied to the directory named in the collected line provided there are no conflicts.  These are: a file already exists with different content, a file does not exist but it lies between the earliest and most recent files already copied.  Data on the 'From' line decides.  Opera names the email files with a unique increasing number (which is appended to the 'From' line it seems).

Relative directory names are based at the directory of the configuration file.

Multi-email mailbox files have to be taken apart to make the selection have any practical effect.  The directory named in the collected line contains a set of files each holding one email.

collected selected_emails


Emails may be excluded from the set copied to the directory named in the collected line.  The file name can be typed, but is usually generated by right-click over the display of the full content of the email which appends the exclude line to the configuration file.

exclude 20171008021048a.sender@verdant.net+0000.mbs


Inclusion by subject line content and exclusion by specific email identity is not yet implemented.
