rstudio / blastula

Easily send great-looking HTML email messages from R
https://pkgs.rstudio.com/blastula
Other
547 stars 85 forks source link

cron jobs #132

Open sbalci opened 4 years ago

sbalci commented 4 years ago

I have tried blastula on Mac Catalina using RStudio, R interface and R script command line. All works as expected. I have made a daily report cron job. But the blastula::smtp_send with gmail gives following error: curl::curl_fetch_memory(url, handle = h) : RCPT failed: 553

Thank you for this package and your help for the cron jobs is appreciated.

rich-iannone commented 4 years ago

Just curious, have you tried this with a different email server (i.e., not Gmail)? Also, does the log from the cron job show anything suspect w.r.t. Gmail?

sbalci commented 4 years ago

From RStudio with gmail I get the memory error on first trial but I can run it on next try. Apart from these curl_fetch_memory errors I did not get any relevant error.

> source("~/AutoJournalWatch/R/email_new_articles.R")
Error in curl::curl_fetch_memory(url, handle = h) : 
  LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 60
> source("~/AutoJournalWatch/R/email_new_articles.R")
The email message was sent successfully.

I also tried hotmail. But the new id in chain list is also gmail and it did not work.

Ekran Resmi 2019-12-10 12 08 09

I have added cron as a privileged access in keychain access app. I will try to see if it works and let you know.

Ekran Resmi 2019-12-10 12 03 57
sbalci commented 4 years ago
Fehler in stop("There is no blastula key that corresponds to the `key_name` of \"",  : 
  'key_name' nesnesi bulunamadi
Ruft auf: <Anonymous> -> <Anonymous> -> get_smtp_keyring_creds
Calistirma durduruldu
Error in curl::curl_fetch_memory(url, handle = h) : RCPT failed: 553

Best wishes.

harrismcgehee commented 4 years ago

The error I am getting in cron jobs is below:

blastula::smtp_send(blastula::compose_email(body = blastula::md("Knitted ")),
                    from = from,
                    to = to,
                    subject = "Knitted report",
                    credentials = blastula::creds_anonymous(...))
Error in file(open = "w+b", encoding = "UTF-8") : 
  cannot open the connection
Calls: <Anonymous> ... freduce -> withVisible -> <Anonymous> -> gfsub -> file
In addition: Warning message:
In file(open = "w+b", encoding = "UTF-8") :
  cannot open file '/home/<user>/tmp/Rtmpx5cmBZ/Rfffd818a70775': No such file or directory
Backtrace:
[90m  1. [39mblastula::compose_email(...)
[90m 10. [39mblastula:::gfsub(...)
[90m 11. [39mbase::file(open = "w+b", encoding = "UTF-8")

the tmp drive is a subdir of ~ due to security policy and is made possible with this ~/.bash-profile entry, but fails without the entry as well.

TMPDIR=~/tmp

export TMPDIR
ASBecker commented 4 years ago

I am getting a RCPT failed: 501 curl-error both on my Mac and on RSConnect when SSL/TLS is disabled (can't enable due to custom certificate). I think this is probably the same issue (also found this on stackoverflow).