procmail_maildirs.sh - sfeed_tests - sfeed tests and RSS and Atom files
HTML git clone git://git.codemadness.org/sfeed_tests
DIR Log
DIR Files
DIR Refs
DIR README
DIR LICENSE
---
procmail_maildirs.sh (686B)
---
1 #!/bin/sh
2
3 maildir="$(pwd)/maildir"
4 feedsdir="$HOME/.sfeed/feeds"
5 procmailconfig="$(pwd)/procmailrc"
6
7 # message-id cache to prevent duplicates.
8 mkdir -p "${maildir}/.cache"
9
10 if ! test -r "${procmailconfig}"; then
11 printf "Procmail configuration file \"%s\" does not exist or is not readable.\n" "${procmailconfig}" >&2
12 echo "See procmailrc.example for an example." >&2
13 exit 1
14 fi
15
16 find "${feedsdir}" -type f -exec printf '%s\n' {} \; | while read -r d; do
17 name=$(basename "${d}")
18 mkdir -p "${maildir}/${name}/cur"
19 mkdir -p "${maildir}/${name}/new"
20 mkdir -p "${maildir}/${name}/tmp"
21 printf 'Mailbox %s\n' "${name}"
22 sfeed_mbox "${d}" | formail -s procmail "${procmailconfig}"
23 done