Sending mail works but bot from cron (changed from bullseye to buster)
EDIT: NOT from cron
EDIT2: for reasons (moved password to seahorse) I removed the password from the .msmtprc file, msmtp (even if told to use TLS) does not found a password and thinks we want to use PLAIN. However, from cli, seahorse is consulted and returns the requested password.
----
Have a problem with sending mail from cron. The logs look like:
Aug 30 19:21:02 cron[249155]: sendmail: authentication method PLAIN needs a password
Aug 30 19:21:02 cron[249155]: sendmail: could not send mail (account default from /home/USER/.msmtprc)
Thing is that this was working pre bullseye, and still work on a both a NAS server and rpi running buster.
Mail sent from cli works, either by using sendmail (ln to mstmp) or msmtp or mailx.
Questions
- Where can i find how cron set the sendmail parameters? has it changed somehow?
- Can i force cron to use something else instead of sendmail (really msmtp), like mutt?
Posted Aug 30, 2021, 11:47 PM UTC · edited
See my earlier comment on related matter.
Thanks, but that not the issue. As per logs, cron tries to send mail, but with method PLAIN, instead of TLS
Hmmm ... finding your post/comments confusing. You say it works from CLI, and complain it doesn't work from cron, yet say it's "not cron".
Are you talking about some implicit mailing that cron does, or some explicit mail command in some crontab jobs?
You say it works from CLI but not cron - is command in crontab job same as what works from CLI? If so, then it's some environmental difference or the like, between how command is done on CLI, vs. how it's being launched from cron.
If you're talking about cron's default behavior of mailing stdout/stderr - that would come down to how cron is configured - and perhaps even which cron you're using.
Thanks for your help, finally found the problem (EDIT: on my first post to make it easier to find in anybody is as stupid as me)
important to note, he never said it's not cron. He typod the title to say "but bot from cron" and later clarified that it's supposed to be "but not from cron"