Wietse Venema wrote:
Paul Cockings:
This isn't strictly a postfix topic, but this is the best place I know
to find clever people :-)
I'm trying to find a script (sh,bash, perl) that will create a vast
number (100K?) of test emails and store in maildir format.
I'm trying to test my postfix/dovecot installation to find some of its
limits - ie what happens with a 100K of emails and a POP3 client.
I guess I need to randomize the size of the mails, the subject, body to
help create a more realistic test, but something very crude and simple
would be a interesting point to start with (might be interesting to run
this vs.Mbox)
Does any have anything I could use, or any pointers? (i'm not much of a
coder but willing to give it a go)
You could use an existing mbox-to-maildir tool to split a bunch of
mbox files. For example, files with mailing list traffic.
Weekly mailing list archives in mbox format are made available at
http://docs.freebsd.org/mail/archive/2009/freebsd-questions/ (find
the links called "Archive", then write a script that automatically
sucks in a bunch of those files). I am sure there are other sites
as well.
Wietse
With the help of steeeeeveee (thankyou!!!!) this script generates just
what I was looking for.
Works like a charm on FreeBSD7.2/bash, hope this helps someone else -
thanks for the other comments
for foo in {1..100000} ; do echo -ne "Return-Path:
<nob...@localhost.localdomain>\nX-Original-To:
nob...@localhost.localdomain\ndelivered-to:
nob...@localhost.localdomain\nreceived: from localhost (localhost
[127.0.0.1])\n\tby localhost.localdomain (Postfix) with SMTP id
"$RANDOM$RANDOM"\n\tfor <nob...@localhost.localdomain>; "$(date "+%a, %d
%b %Y %H:%M:%S %z (%Z)")"\nDate: "$(date "+%a, %d %b %Y %H:%M:%S %z
(%Z)")"\nTo: nob...@localhost.localdomain\nfrom: Nobody
<nob...@localhost.localdomain>\nSubject: Test "${foo}"\nMessage-ID:
<"$RANDOM$RANDOM$$$RANDOM$RANDOM$RANDOM$RANDOM"@localhost>\nMIME-Version:
1.0\nContent-Transfer-Encoding: 8bit\nContent-Type: text/plain;
charset=\"utf-8\"\n\n"$(head -c 2000 /dev/urandom | hexdump -x)"\n" >
/vmail/mydomain/myuser/cur/$(date "+%s.$RANDOM.localhost:2,") ; done