Hello,
I'm trying to set up mailx (heirloom mailx) to be able to send mails from command line through gmail.
As of the manpage there are local configuration files (~/.mailrc) and a global configuration file (/etc/mail.rc)
Since I want the same settings for every user I thought it would be a good idea to put the Settings in /etc/mail.rc
the Content:
Code:
set ask askcc append dot save crt
ignore Received Message-Id Resent-Message-Id Status Mail-From Return-Path Via D$
account gmail {
set smtp-use-starttls
set ssl-verify=ignore
set smtp-auth=login
set smtp=smtp://smtp.gmail.com:587
set from="Jon Doe"
set smtp-auth-user=jon.doe@gmail.com
set smtp-auth-password=somePasword
}
now to send an email I use
Code:
echo -e "Mail body text" | mailx -A gmail -s "Mail subject" some_recipient@email.com
Error message:
Code:
Account gmail does not exist.
When I put the configuration inside ~/.mailrc it works.
But why not with /etc/mail.rc?
Can someone help me out please?
Thanks in advance.