mail2rm allows you to send PDF documents to your reMarkable device by email. The script is intended for people who run an own mail transport agent (MTA) instance e.g. postfix. mail2rm is supposed to be used as a postfix filter. This allows you to run the script during mail delivery. If the upload fails you will get an undeliverable notice including the error message.
-
Download rmapi from https://github.com/juruen/rmapi/releases and copy the executable binary to your server e.g. to
/usr/local/bin/rmapi
-
Add a separate user to your server (here Debian/Ubuntu):
adduser --system remarkable
-
Copy the mail2rm script to your server e.g. to
/usr/local/bin/mail2rm
and make it executable. -
Register rmapi as the mail2rm user
sudo -u remarkable rmapi
-
Integrate mail2rm into postfix.
Add the filter to master.cf:
mail2rm unix - n n - 50 pipe flags=F user=remarkable argv=/usr/local/bin/mail2rm -a [email protected] -a [email protected] -r /usr/local/bin/rmapi ${sender}
The -a/--allowed sender option allows to limit the addresses which can send documents. The option can be used multiple times. Replace the above -a statemens with your email addresses. The -r/--rmapi option specifies the path to the rmapi executable.
Add a check_recipient_access rule in master.cf:
smtpd_recipient_restrictions = [...] check_recipient_access hash:/etc/postfix/recipient_access
Add the destination address to recipient_access file:
[email protected] FILTER mail2rm:dummy
Update and reload configuration:
postmap /etc/postfix/recipient_access systemctl reload postfix