This provides an object-oriented interface to a maildir structure in your file system. The package provides the library (MailDir-Core) as well as a basic UI for browsing emails (MailDir-UI).
It is an evolved version of CCMail originally created by Conrad Calmez.
- Get a Squeak trunk from anytime after 2017
- Load Metacello
- Finally, load SMailDir with the following command:
Metacello new
baseline: 'MailDir';
repository: 'github://codezeilen/SMailDir/repository';
load: 'default'.
As maildir implementations use different flag separators in file names you can configure this for your mail archive object through the message MDMailArchive>>#flagSeparator:
.
You can also use a small helper tool for creating a maildir profile which includes an archive as well as SMTP credentials for answer emails. You can either find the tool in the Apps menu from the world docking bar or open it with:
MDMailProfileBrowser open
To create a MDMailArchive use:
MDMailArchive archiveIn: FileDirectory default / 'GMail' flagSeparator: $;.
This will initially create an object structure representing the maildir structure and create a basic index. This might take several minutes depending on the size of your maildir.
In general, you can find any messages related to data of an email in the mails
and the meta information
protocol of the class MDMail
.
SMailDir integrates with the MailSender infrastructure of Squeak. If you have set up a complete MDMailProfile you can answer mails from within the image.
For moving mails you can use the messages in the mails
protocol.
To synchronize your maildir structure you can call MDMailArchive class>>#synchronizeAllArchives
. The class also allows you to start a background process regularly synchronizing your archive through MDMailArchive class>>#startSynchronizationProcess
.
The synchronization preserves the object structure of MDMails. So if an email file was moved, the corresponding MDMail object is also moved to another MDMailBox object.
The default configuration also installs the (Rack)[https://github.com/hpi-swa/Rack] which integrates the single tools in MailDir-UI.
- Deleting messages in a GMail maildir might not delete them properly as GMail interprets deletion differently
- Be aware of synchronization issues. The process is not 100% robust yet. Although it happens very seldomly, single mail can get lost. We are working on it (see issue #3 and #4)
- On the same note: If you try to modify a mail (set to read or move) which has changed on the file system since the last synchronization, you might also get errors (see issue #5).