Hallo zusammen,
bin mir nicht sicher, ob dies das richtige Forum ist für eine Frage, die Fhem nur am Rande betrifft.
In Bezug auf Exim ist es auf jeden Fall eine Anfängerfrage :-)
Ich habe auf einem Raspi und Cubietruck jeweils einen Exim4 nach dem Wiki von Betateilchen und div. Forumseinträgen aufgesetzt.
Mein Provider ist Outlook.com / hotmail.com
1. apt-get install exim4 mailutils
2. dpkg-reconfigure exim4-config
3. → mail sent by smarthost; received via SMTP or fetchmail
4. → System Mail Name: localhost
5. → IP-addresses to listen on for incoming SMTP connections: 127.0.0.1: ::1
6. → Other destinations for which mail is accepted: localhost
7. → Machines to relay mail for: <leer>
8. → IP adress or host name of the outgoing smarthost: smtp.glbdns2.microsoft.com::587
9. → Hide local mail name in outgoing mail? No
10. → Keep number of DNS-queries minimal (Dial-on-Demand)? No
11. → Delivery method for local mail: mbox format in /var/mail
12. → Split configuration info small files? No
Anmeldedaten Hinterlegt in /etc/exim4/passwd.client
smtp.glbdns2.microsoft.com:meine.mail@outlook.de:passwort
Damit TLS richtig funktioniert /etc/exim4/exim4.conf.localmacros wie folgt angepasst:
gnutls_compat_mode=true
gnutls_require_protocols=NORMAL:%COMPAT:-VERS-TLS1.1:-VERS-TLS1.2
/etc/aliases wie folgt angepasst:
root: meine.mail@outlook.de
email-addresses wie folgt angepasst:
# This is /etc/email-addresses. It is part of the exim package
#
# This file contains email addresses to use for outgoing mail. Any local
# part not in here will be qualified by the system domain as normal.
#
# It should contain lines of the form:
#
#user: someone@isp.com
#otheruser: someoneelse@anotherisp.com
root: meine.mail@outlook.de
ct: root
fhem: root
mail: root
mailer-daemon: root
postmaster: root
nobody: root
hostmaster: root
usenet: root
news: root
webmaster: root
Zum Schluss noch ein
dpkg-reconfigure exim4-config
leer durchgeklickt
Mailversand mit folgenden Befehl funktioniert:
echo 'Test Mailinhalt' | mail -s 'test Betreff' meine.mail@outlook.de
Allerdings wird als Absender immer "root <meine.mail@outlook.de>" angegeben.
Versende ich wie das System auch nur an root
echo 'Test Mailinhalt' | mail -s 'test Betreff' root
bekomme ich die Mail trotzdem mit dem Absender "root <meine.mail@outlook.de>"
Allerdings mit dem Empfänger root@localhost
Das liegt denke ich am "System Mail Name" wo ich localhost angegeben habe.
Wie bekomme ich es nun hin, dass alle Mails, die von dem System rausgehen von meine.mail@outlook.de kommen ohne root etc. davor?
Versende ich mit folgendem Befehl, funktioniert es:
echo 'Test Mailinhalt' | mail -r meine.mail@outlook.de -s 'test Betreff' meine.mail@outlook.de
Allerdings macht das system das ja nicht von selbst.
Quellen:
https://wiki.betateilchen.de/doku.php?id=server:exim4:install
https://wiki.debian.org/GmailAndExim4
http://blog.xig.ch/Exim-Smarthost-mit-Authentifizierung-%FCber-STARTTLS_127.html
http://www.fhemwiki.de/w/images/f/f6/Anleitung_Exim4_Debian_GMX.pdf
Hab noch ein wenig geforscht.
Es scheint über rewriting des Headers zu gehen. Allerdings habe ich noch nicht die richtige Stelle in der Konfig gefunden, bzw. es zieht nicht.
Oder habe ich den komplett falschen Ansatz?
Hallo slor,
ungeteilte, aber vielleicht hilft das hier:
http://serverfault.com/questions/548826/exim-change-sender-address-when-sending-mails-out-of-local-network (http://serverfault.com/questions/548826/exim-change-sender-address-when-sending-mails-out-of-local-network)
Gruß, Carsten