NAME

imapfoo - attach random, generated or prepared messages to an imap folder


SYNOPSIS

imapfoo <lots of options>

use --help for short and --man for detailed documentation.


DESCRIPTION

imapfoo enables you to quickly attach message to an imap folder. It was mostly used to test different imap implementations.


OPTIONS

--attach-checksum, --ac

Attach MD5 checksum files of all attached files.

--attach-file, --af <file>

Attach file to all emails. See --attach-mime for additional options.

--attach-mime, --am <type>

Specify mime type for --attach-file. Defaults to binary.

--attach-random, --ar <m|l-h>

Attach a file generated with either up to m or from l to h digits.

--config-file, --cf <file>

Load config from file. Please note, options specified in the file override options passwd on the commandline.

You can find an example config file in the examples folder

--create-if-missing, --cim

Create imap folder if missing. Without this option, imapfoo will exit with an error message if the specified folder does not exist.

--debug, -d

Enable debug output.

--encryption, -e <ssl|tls>

Specify type of encryption to use. Can either be ssl or tls. Defaults to ssl.

--help, -h, -?

Print a brief help message and exits.

--host host

Connect to host.

--html

Outputs detailed documentation formatted as HTML, see --man.

--imap-folder, --if <folder>

Append messages to imap folder, defaults to INBOX.

--login login

Use login as username when logging in.

--lorem-columns, --lc <columns>

When generating lorem ipsum mails, do not generate lines longer than columns. Defaults to 72.

--lore-file, --lf <file>

Use file to generate Markov Chains used for lorem ipsum creation. Defaults to lorem.txt.

--lorem-prefix, --lp <len>

Set Marlkov Chain prefix to len. Defaults to 3.

--lorem-words. --lw <count>

Generate lorem ipsums containing count words. Defaults to 100.

--mail-checksum, --mc

Calculate MD5 checksum for every mail, and include it as X-Imapfoo-Md5 header.

--mail-from, --mf <from>

Use from for From: mail header. Defaults to root@localhost.

--mail-subject, --ms <subject>

Use subject for Subject: mail header. Defaults to A test mail.

--mail-date, --md

Generate Subject: mail header from current timestamp.

--mail-to, --mt <to>

Use to for To: mail header. Defaults to somebody@localhost.

--man

Prints the manual page and exits.

--mbox-file, --mf <file>

Use file as mbox input.

--mode, -m <check|lorem|mbox|random|simple>

Specify mode to operate in. Defaults to random.

--netrc

Read password from .netrc. Needs --host to identify machine. You can optionally pass --login to specify a certain login (defaults to first login found),

--num, -n <amount>

Generate amount emails. Defaults to 2.

If used in mbox mode, passing 0 will attach all mails contained in the file.

--password, -p <file>

Read password from file. If file is -. read from STDIN.

--port port

Connect to port.

--random-lines, --rl <number>

When generating random emails, generate number lines of random text per mail. Defaults to 10.

--simple-body, --sb <text>

Use text as the body for simple mails.

--simulate, -s

Do not connect to imap server and do not send mails. Instead mails will be logged with level debug, see --debug.


EXAMPLES

imapfoo can be operated in 4 different modes: lorem, mbox, random and simple. Below are examples for those modes.

Please note, examples may be broken in multiple lines, to run them, you will need to enter them on one single line.

check

When running in check mode, imapfoo will look for the header X-Imapfoo-Md5 in all the folder's messages. It will then strip the message of that header, recalculate the md5 sum and compare it to the stored one. This allows you to check that the message was not damaged after attaching.

Generate one random message with an md5 header

imapfoo --login foo --host localhost -n 1 --mc

Now check all messages

imapfoo --login foo --host localhost -m check

lorem

In lorem mode, imapfoo will generate mails with a lorem ipsum body. For that it does need an input file, to generate random text from. You can use any textfile you like.

Generate 10 lorem ipsum mails with default To, From, Subject and wordcount:

imapfoo --login foo --host localhost -m lorem -n 10

Same as above, but specify an input file to base the lorem ipsum on:

imapfoo --login foo --host localhost -m lorem -n 10 --lf foo.txt

Generate 2 lorem ipsum mails, with 1000 words in each body, a maximum line length of 50 and Subject foo!:

imapfoo --login foo --host localhost -m lorem -n 2 --lw 1000 --lc 50 --ms foo!

mbox

In mbox mode, imapfoo will read mails from an mbox file and attach them to the folder. You can create mbox files with for example mutt.

Attach the first 5 messages from file mbox:

imapfoo --login foo --host localhost -m mbox -n 5 --mf mbox

random

Random mails contain a number of lines of generated hexadecimal content.

Generate 2 mails with the default To:, From: and Subject: headers and 2 lines of random content:

imapfoo --login foo --host localhost -m random -n 2 --rl 2

As above, but specify From: and timestamp Subject:

imapfoo --login foo --host localhost -m random -n 2 --rl 2 --mf foo@here --md

simple

When using mode simple, imapfoo will create mails from passed parameters.

Generate 1 simple mail. with From: me@here, To: you@there and Body "boring mail body". The Subject will contain a timestamp like 'Mon Feb 8 15:41:18 2010'

imapfoo --login foo --host localhost -m simple -n 1 --mf me@here --mt you@there --md --sb "boring mail body"

As above, but also attach a .gz file:

imapfoo --login foo --host localhost -m simple -n 1 --mf me@here --mt you@there --md --sb "boring mail body" --af bar.gz --am application/gzip

As above, but attach a randomly generated file consisting of 100 to 200 digits instead of the .gz:

imapfoo --login foo --host localhost -m simple -n 1 --mf me@here --mt you@there --md --sb "boring mail body" --ar 100-200


BUGS / KNOWN LIMITATIONS

Authentication

Only plain auth is currently supported.

Encryption

imapfoo currently only supports encrypted imap connections.

mail-checksum

This option currently does NOT work with mbox mode.


LICENSE

GPL v2


COPYRIGHT

(c) 2010 bd@bc-bd.org