Sources:
http://www.mehr4u.de/mailservice-unter-debian-installieren.html
https://www.lars-schenk.com/exim4debian-sending-out-emails-over-the-isp-smtp-server-as-a-smarthost/21
- exim4 install
- exim4 config
- set emails /etc/email-addresses
- smtp login config
- restart exim4 service
- send email via mail
1) install exim4
apt-get install exim4
2) configure exim4
dpkg-reconfigure exim4-config
Select:
- smarthost, no local mail (send mail via SMTP but do not receive mail)
- System mail name: beaglebone
- Other destinations: beaglebone
- Visible domain name: beaglebone
- IP-address or hostname outgoing smarthost: smtp.1und1.de::25
- mail recipient: mail(at)myemailaddress.de
3) set valid email for user/root (FQDN)
nano /etc/email-addresses
Add to file:
root: mail(at)myemailaddress.de
debian: mail(at)myemailaddress.de
4) configure smtp-login
nano /etc/exim4/passwd.client
Add to file:
smtp.1und1.de:mail(at)myemailaddress.de:mypassword
5) restart exim4
service exim4 stop
service exim4 start
6) send email
mail -v -s "Text" mail(at)myemailaddress.de
Enter some text and press
(ctrl-D) at the beginning of a new line
the email is now sent and will be received by the recipient !