System mail: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
| Line 42: | Line 42: | ||
</pre> | </pre> | ||
:* <code>chmod +x /usr/sbin/sendmail</code> | :* <code>chmod +x /usr/sbin/sendmail</code> | ||
:* ln -s /usr/sbin/sendmail /usr/lib/sendmail | :* <code>ln -s /usr/sbin/sendmail /usr/lib/sendmail</code> | ||
[[Category: Linux]] | [[Category: Linux]] | ||
Revision as of 23:03, 12 December 2022
/etc/msmtprc
account default from <ya-user>@yandex.ru set_from_header on host smtp.yandex.ru port 465 auth on tls on tls_starttls off tls_trust_file /etc/ssl/certs/ca-certificates.crt user <ya-user> password <password> aliases /etc/msmtp.aliases
/etc/msmtp.aliases
default: <user@example.org>
- If using
mdadm, add to /etc/mdadm.conf:
MAILADDR root
# /etc/rc.d/rc.postfix stop# removepkg postfix# rm -r /etc/postfix# rm /etc/rc.d/rc.postfix/usr/sbin/sendmail
#!/bin/bash
arg=("$@")
for ((i=0;i<$#;i++)); do
if [[ ${arg[$i],,} == -f* ]]; then
if [[ ${arg[$i],,} == -f && ${arg[$i+1]} != -* ]]; then
unset arg[$i+1]
fi
unset arg[$i]
fi
done
/usr/bin/msmtp -F $(/bin/hostname -s) "${arg[@]}"
chmod +x /usr/sbin/sendmailln -s /usr/sbin/sendmail /usr/lib/sendmail