Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CRON: Error: could not open a new TTY: open /dev/tty: no such device or address #92

Open
korpa opened this issue Aug 19, 2024 · 3 comments

Comments

@korpa
Copy link

korpa commented Aug 19, 2024

Describe the bug
When using pop within a script which runs via cron, the error message occures:

Error: could not open a new TTY: open /dev/tty: no such device or address

To Reproduce
Steps to reproduce the behavior:

vi /home/user/run.sh

#/bin/bash

pop --to ybc@xyz.com -s "Hello" -b "Hello" >> /home/user/email.log 2>> /home/user/email.err

crontab -e

* *    * * *    /home/user/run.sh

Expected behavior
pop runs without a tty

Desktop (please complete the following information):

  • OS: Linux
@aymanbagabas
Copy link
Member

@korpa I think you're missing the --from flag, otherwise, Pop will want to open a tui to get that info

@korpa
Copy link
Author

korpa commented Aug 19, 2024

I think, this is not necessary as I'm using SMTP for sending and have set following env variables:

POP_SMTP_HOST
POP_SMTP_PORT
POP_SMTP_USERNAME
POP_SMTP_PASSWORD

In this case POP uses POP_SMTP_USERNAME as From: address.

If I run the same script manually from bash, it works.

@korpa
Copy link
Author

korpa commented Aug 19, 2024

I just added the --from flag to double check if it really is the issue. Sadly nothing changes. I still get the "TTY error".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants