summaryrefslogtreecommitdiff
path: root/README
diff options
context:
space:
mode:
authorHiltjo Posthuma <hiltjo@codemadness.org>2019-09-06 16:53:46 +0200
committerHiltjo Posthuma <hiltjo@codemadness.org>2019-09-06 16:53:46 +0200
commit8ed7bdd7be495924d9300b0f7d749e8ccc3ef8dd (patch)
tree68300e3383a055cf0a25a6261631a60add998650 /README
parent1210d6804f6a7ed8e9b1e263d98cc5b17f935206 (diff)
README: improve mail example and add an example similar to rss2email
Diffstat (limited to 'README')
-rw-r--r--README66
1 files changed, 58 insertions, 8 deletions
diff --git a/README b/README
index 73124be..f4d2118 100644
--- a/README
+++ b/README
@@ -448,34 +448,84 @@ small.
- - -
-Convert mbox to separate maildirs per feed and filter duplicate messages using
-fdm(1): https://github.com/nicm/fdm .
+Convert mbox to separate maildirs per feed and filter duplicate messages using the
+fdm program.
+fdm is available at: https://github.com/nicm/fdm
+
+fdm config file (~/.sfeed/fdm.conf):
+
+ set unmatched-mail keep
+
+ account "sfeed" mbox "%[home]/.sfeed/mbox"
+ $cachepath = "%[home]/.sfeed/fdm.cache"
+ cache "${cachepath}"
+ $maildir = "%[home]/feeds/"
+
+ # Check if message is in in cache by Message-ID.
+ match case "^Message-ID: (.*)" in headers
+ action {
+ tag "msgid" value "%1"
+ }
+ continue
+
+ # If it is in the 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 {
+ # Store to local maildir.
+ maildir "${maildir}%1"
+
+ add-to-cache "${cachepath}" key "%[msgid]"
+ keep
+ }
+
+Now run:
+
+ $ sfeed_mbox ~/.sfeed/feeds/* > ~/.sfeed/mbox
+ $ fdm -f ~/.sfeed/fdm.conf fetch
+
+Now you can view feeds in mutt(1) for example.
+
+- - -
+
+Read from mbox and filter duplicate messages using the fdm program and deliver
+it to a SMTP server. This works similar to the rss2email program.
+fdm is available at: https://github.com/nicm/fdm
fdm config file (~/.sfeed/fdm.conf):
set unmatched-mail keep
account "sfeed" mbox "%[home]/.sfeed/mbox"
- $cachepath = "%[home]/.sfeed/mbox.cache"
+ $cachepath = "%[home]/.sfeed/fdm.cache"
cache "${cachepath}"
- $feedsdir = "%[home]/feeds/"
- # check if in cache by message-id.
+ # Check if message is in in cache by Message-ID.
match case "^Message-ID: (.*)" in headers
action {
tag "msgid" value "%1"
}
continue
- # if in cache, stop.
+
+ # If it is in the in cache, stop.
match matched and in-cache "${cachepath}" key "%[msgid]"
action {
keep
}
- # not in cache, process it and add to cache.
+ # Not in cache, process it and add to cache.
match case "^X-Feedname: (.*)" in headers
action {
- maildir "${feedsdir}%1"
+ # Connect to a SMTP server and attempt to deliver the
+ # mail to it.
+ # Of course change the server and e-mail below.
+ smtp server "codemadness.org" to "hiltjo@codemadness.org"
+
add-to-cache "${cachepath}" key "%[msgid]"
keep
}