summaryrefslogtreecommitdiff
path: root/fdm.conf.example
blob: 94a6c10bd639cf12a5bb9630eeaa8720026fca9e (plain)
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
# Convert mbox to separate maildirs per feed and filter duplicate messages.
# Usage:
# 	$ sfeed_mbox ~/.sfeed/feeds/* > ~/.sfeed/mbox
# 	$ fdm -f thisconfig fetch

set unmatched-mail keep

account "sfeed" mbox "%[home]/.sfeed/mbox"
	$cachepath = "%[home]/.sfeed/mbox.cache"
	cache "${cachepath}"
	$feedsdir = "%[home]/feeds/"

	# check if in cache by message-id.
	match case "^Message-ID: (.*)" in headers
		action {
			tag "msgid" value "%1"
		}
		continue
		# if in cache, stop.
		match matched and in-cache "${cachepath}" key "%[msgid]"
		action {
			keep
		}

	# not in cache, process it and add to cache.
	match case "^X-Feedname: (.*)" in headers
	action {
		maildir "${feedsdir}%1"
		add-to-cache "${cachepath}" key "%[msgid]"
		keep
	}