1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
|
#!/bin/bash
balsa_setup() {
if [ -d ~/.config/balsa ]; then
printf >&2 '~/.config/balsa already exists, will not run test.\n'
exit 1
fi
if [ -n "$AUTOPKGTEST_ARTIFACTS" ]; then
export workdir=$AUTOPKGTEST_ARTIFACTS
else
export workdir=$(mktemp -d)
fi
mkdir -p ~/.config/balsa
mkdir -p "$workdir/mail/"{mailbox/,outbox/,sent/,drafts/,trash/}{cur,new,tmp}
cat > ~/.config/balsa/config <<EOF
[Globals]
MailDir=$workdir/mail
[Notifications]
GtkUIManager=true
[mailbox-Inbox]
Path=$workdir/mail/mailbox
Type=LibBalsaMailboxMaildir
Name=Inbox
[mailbox-Outbox]
Path=$workdir/mail/outbox
Type=LibBalsaMailboxMaildir
Name=Outbox
[mailbox-Sentbox]
Path=$workdir/mail/sent
Type=LibBalsaMailboxMaildir
Name=Sent
[mailbox-Draftbox]
Path=$workdir/mail/drafts
Type=LibBalsaMailboxMaildir
Name=Drafts
[mailbox-Trash]
Path=$workdir/mail/trash
Type=LibBalsaMailboxMaildir
Name=Trash
[identity]
CurrentIdentity=user
[identity-user]
FullName=Example User
Address=user@example.com
[smtp-server-Default]
Server=localhost:25
Anonymous=true
EOF
cat > ~/.config/balsa/config-private <<EOF
EOF
}
balsa_teardown() {
rm -rf ~/.config/balsa
}
|