Created
December 5, 2016 04:47
-
-
Save mjradwin/8d6300c35ee69379e70666896f6dcb2a to your computer and use it in GitHub Desktop.
calibre-news-email.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
RECIPE="$1" | |
OUTFILE=`mktemp /tmp/news.XXXXXXXXXX.mobi` | |
ADDRESS="example_1234567@kindle.com" | |
# uses heirloom-mailx on Ubuntu which supports -a for attachments | |
/opt/calibre/ebook-convert \ | |
"$RECIPE.recipe" $OUTFILE --output-profile kindle && \ | |
echo "Attached is the $RECIPE periodical downloaded by calibre" \ | |
| mail -s "News: $RECIPE" -a $OUTFILE $ADDRESS | |
rm -f $OUTFILE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
First, we need to install the base libs for Calibre:
sudo apt install xfce4
Then, follow the binary install instructions at https://calibre-ebook.com/download_linux
Then, set up your
postfix
andheirloom-mailx
so you can actually deliver mail