Hey everyone
Im on manjaro and recently installed timeshift for keeping a system backup. Sendmail is used as a default by cron to send output of scripts (timeshift). I installed and configured msmtp and msmtp-mta basically as described here:
https://wiki.archlinux.org/index.php/Msmtp
After this, I recieve email if I test sendmail:
Code:
echo test | sendmail myuser@mymail.com
So far so good. Now I created a new cronjob by
and appending
Code:
* * * * * echo something
My systemlog from journalctl gives me:
Code:
Okt 04 23:49:01 myhostname CROND[5677]: (myusername) CMD (echo something)
Okt 04 23:49:01 myhostname crond[5676]: pam_unix(crond:session): session opened for user myusername by (uid=0)
Okt 04 23:49:01 myhostname kernel: audit: type=1006 audit(1570225741.109:138): pid=5676 uid=0 old-auid=4294967295 auid=1000 tty=(none) old-ses=4294967295 ses=83 res=1
Okt 04 23:48:29 myhostname crontab[5670]: (myusername) BEGIN EDIT (myusername)
Okt 04 23:48:03 myhostname CROND[5667]: pam_unix(crond:session): session closed for user myusername
Okt 04 23:48:03 myhostname CROND[5667]: (myusername) MAIL (mailed 4 bytes of output but got status 0x0041
)
Okt 04 23:48:03 myhostname crond[510]: sendmail: could not send mail (account default from /etc/msmtprc)
Okt 04 23:48:03 myhostname crond[510]: sendmail: server message: 501 Syntax error in parameters or arguments
Okt 04 23:48:03 myhostname crond[510]: sendmail: envelope from address myusername not accepted by the server
I could not find anything useful so far. As in the logs i get server message: "501 Syntax error in parameters or arguments" is there a way to find out the exact sendmail command cron uses?
My /etc/msmtprc is:
Code:
# Set default values for all following accounts.
defaults
# Use the mail submission port 587 instead of the SMTP port 25.
port 587
# Always use TLS.
tls on
# Set a list of trusted CAs for TLS. The default is to use system settings, but
# you can select your own file.
tls_trust_file /etc/ssl/certs/ca-certificates.crt
# If you select your own file, you should also use the tls_crl_file command to
# check for revoked certificates, but unfortunately getting revocation lists and
# keeping them up to date is not straightforward.
#tls_crl_file ~/.tls-crls
# Mail account
# TODO: Use your own mail address
account myuser@mydomain.com
# Host name of the SMTP server
# TODO: Use the host of your own mail account
host my.smtp.server
# As an alternative to tls_trust_file/tls_crl_file, you can use tls_fingerprint
# to pin a single certificate. You have to update the fingerprint when the
# server certificate changes, but an attacker cannot trick you into accepting
# a fraudulent certificate. Get the fingerprint with
# $ msmtp --serverinfo --tls --tls-certcheck=off --host=smtp.freemail.example
#tls_fingerprint 00:11:22:33:44:55:66:77:88:99:AA:BB:CC:DD:EE:FF:00:11:22:33
# Envelope-from address
# TODO: Use your own mail address
from myuser@mydomain.com
# Authentication. The password is given using one of five methods, see below.
auth on
# TODO: Use your own user name fpr the mail account
user myuser@mydomain.com
# Password method 1: Add the password to the system keyring, and let msmtp get
# it automatically. To set the keyring password using Gnome's libsecret:
# $ secret-tool store --label=msmtp \
# host smtp.freemail.example \
# service smtp \
# user joe.smith
# Password method 2: Store the password in an encrypted file, and tell msmtp
# which command to use to decrypt it. This is usually used with GnuPG, as in
# this example. Usually gpg-agent will ask once for the decryption password.
#passwordeval gpg2 --no-tty -q -d ~/.msmtp-password.gpg
# Password method 3: Store the password directly in this file. Usually it is not
# a good idea to store passwords in plain text files. If you do it anyway, at
# least make sure that this file can only be read by yourself.
# TODO: Use the password of your own mail account
password mypassword
# Password method 4: Store the password in ~/.netrc. This method is probably not
# relevant anymore.
# Password method 5: Do not specify a password. Msmtp will then prompt you for
# it. This means you need to be able to type into a terminal when msmtp runs.
# Set a default account
# TODO: Use your own mail address
account default: myuser@mydomain.com
# Map local users to mail addresses (for crontab)
aliases /etc/aliases
My /etc/aliases is
Code:
myusername: myuser@mydomain.com
root: myuser@mydomain.com
default: myuser@mydomain.com
Obviously in all the above sensible information is replaced with mywhatever.
I would be grateful for some help as I have no idea for what to look or what to test anymore. Thanks!