l2md: add support to pipe new mails to stdout for procmail et al

Add very initial/rough support for piping new mails to external MDAs.

Konstantin says:

  Thanks for working on this -- I've started on a similar tool in the
  past, but got distracted and never completed it. In my implementation,
  it was piping messages to procmail, which allowed writing complex rules
  for folders/pre-processing, etc. May I suggest that your tool also
  offers a stdout that can be piped to procmail?

Used test config:

$ cat ~/.l2mdconfig
[general]
	base = /tmp/test/
	pipe = /usr/bin/procmail
	period = 30

[repo bpf]
	url = https://lore.kernel.org/bpf/0
	initial_import = 10

Tested l2md -> procmail -> mutt locally which seems to work fine.

Suggested-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/workflows/20190930212410.GE14403@pure.paranoia.local/
10 files changed