From 3e96aaa793e6bccc89006d55b0b6f49ac56907ec Mon Sep 17 00:00:00 2001 From: Hiltjo Posthuma Date: Thu, 30 Jul 2015 16:15:20 +0200 Subject: sfeed_maildir: initial version, needs more work --- sfeed_maildir | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 sfeed_maildir (limited to 'sfeed_maildir') diff --git a/sfeed_maildir b/sfeed_maildir new file mode 100755 index 0000000..099bc13 --- /dev/null +++ b/sfeed_maildir @@ -0,0 +1,21 @@ +#!/bin/sh +# Uses procmail to format mbox to maildir, see procmailrc.example. +# Copy procmailrc.example to $procmailconfig (see below). +# Depends on: procmail, formail, sfeed_mbox. + +maildir="$HOME/feeds" +feedsdir="$HOME/.sfeed/feeds" +procmailconfig="$HOME/.sfeed/procmailrc" + +# message-id cache to prevent duplicates. +mkdir -p "${maildir}/.cache" + +find "${feedsdir}" -type f -exec printf '%s\n' {} \; | while read -r d; do + (name=$(basename "${d}") + mkdir -p "${maildir}/${name}/cur" + mkdir -p "${maildir}/${name}/new" + mkdir -p "${maildir}/${name}/tmp" + printf 'Mailbox %s\n' "${name}" + sfeed_mbox "${d}" | formail -s procmail "${procmailconfig}") & +done +wait -- cgit v1.2.3