Skip to content

MailProcessing

jochenwierum edited this page Jul 28, 2012 · 1 revision

Processing e-mails

FitGoodies is capable to receive E-Mails via JavaMail. That means, if JavaMail is installed, FitGoodies can be used to test mail content. Warning: it is recommended to use dedicated mail accounts for testing, because FitGoodies deletes mails.

To setup mail processing, the account must be configured:

fitgoodies.mail.SetupFixture
host localhost
protocol pop3
username popuser
password popuser

FitGoodies uses these settings to download the latest mail and provides functions to check their content. Let's begin with an example:

fitgoodies.mail.MailFixture
subject contains Status Report
body contains Everything is okay
Received contains secureserver

There is an optional parameter delete, which prevents FitGoodies from deleting a mail. But note: this way, you cannot check if a mail was sent, because there is the chance, that FitGoodies processes an old (perhaps even valid) mail.

The first column contains the field to analyze. Allowed values are body, which means both, an HTML and a plain text body, plainbody and htmlbody. Every other value is interpreted as the name of a header. FitGoodies works case-insensitive here.

The second column contains one of the keywords "contains" or "regex". The third column contains the actual value which is compared with the selected field. The third row allows the use of CrossReferences.

MailFixture output

Clone this wiki locally