Skip to content

Instantly share code, notes, and snippets.

@scateu
Last active August 6, 2020 11:10
Show Gist options
  • Save scateu/a42292721767f68da98790a93c0391c4 to your computer and use it in GitHub Desktop.
Save scateu/a42292721767f68da98790a93c0391c4 to your computer and use it in GitHub Desktop.
A sendmail wrapper for rss2email to write mail directly into mbox
#!/bin/bash
# A wrapper for rss2email
# Usage: in ~/.config/rss2email.cfg
# email-protocol = sendmail
# sendmail = ~/bin/sendmail_localhost_mbox
while [ -e ~/Mails/RSS.mbox.lock ]; do sleep 0.01; done
touch ~/Mails/RSS.mbox.lock
echo From RSS2EMAIL_SENDMAIL_WRAPPER `date +"%a %b %d %T %Y"` >> ~/Mails/RSS.mbox
#tee -a ~/Mails/RSS.mbox > /dev/null
cat >> ~/Mails/RSS.mbox
echo >> ~/Mails/RSS.mbox
rm ~/Mails/RSS.mbox.lock
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment