Witam po raz pierwszy,
Zaczyman od razu od moim wględem trudnego tematu.
Potrzebuje pomocy w skonfigurowaniu SMTP Relay aby działał jak na schemacie SMTP_Relay.JPG.
Chodzi mi dokłądnie o to aby była możliwość skonfigurowania SMTP Relay w taki sposób aby w zależności z jakiego adresu e-mail dostanie wiadomość przekierował ja do odpowiedniego serwera pocztowego oraz na odpowiednie konto. Biorę jednak pod uwagę że jeśli nie da się zrobić reguły na adresie e-mail tylko na domenie to trzeba bedzie to tak zrobić.
Dodatkowo dla jednego z mechanizmów potrzebuje aby była autoryzacja .
Jest to o tyle dziwny przypadek że program każe wpisać login i hasło dla usługi SMTP aby było możliwe zapisanie ustawień ale niestety nie działa on z usługą O365 dlatego w tym przypadku potrzebuje też SMTP Relay.
Opis mechanizmu :
1. Zostaje wysłana wiadomośc do SMTP Relay z adresu mail @ domain1.com . SMTP Relay rozpoznaje adres mail @ domain1.com i wie że ma przekierować tą wiadomość do serwera pocztowego GMAIL na adres 123 @ gmail.com .
2. Zostaje wysłana wiadomośc do SMTP Relay z adresu mail1 @ domain2.com . Autoryzacja do SMTP Relay odbywa się poprzez login i hasło i jest wysyłana na porcie 587/465. SMTP Relay rozpoznaje adres mail1 @ domain2.com i wie że ma przekierować tą wiadomość do serwera pocztowego O365 na adres mail1 @ ourdomain.com.
3. Zostaje wysłana wiadomośc do SMTP Relay z adresu mail2 @ domain2.com . SMTP Relay rozpoznaje adres mail2 @ domain2.com i wie że ma przekierować tą wiadomość do serwera pocztowego GMAIL na adres 456 @ gmail.com .
4. Zostaje wysłana wiadomośc do SMTP Relay z adresu mail @ domain3.com . SMTP Relay rozpoznaje adres mail @ domain3.com i wie że ma przekierować tą wiadomość do serwera pocztowego O365 na adres mail2 @ outdomain.com .
5. Zostaje wysłana wiadomośc do SMTP Relay z adresu mail @ domain4.com . SMTP Relay rozpoznaje adres mail @ domain4.com i wie że ma przekierować tą wiadomość do serwera pocztowego O365 na adres mail2 @ outdomain.com .
https://ibb.co/Q7g1ZMK
W każdym z powyższych przypadków SMTP Relay autoryzuje się z kontami (O365, GMAIL) poprzez login i hasło i odpowiedni port.
Próbowałem rozwiąząc virtual domain ale niestety nie chciały działać z jakiegoś względu.
Czy ktokolwiek próbował tak rozbudować SMTP Relay do powyższych wymagań i czy jest to w ogóle możliwe ?
Proszę o pomoc.
SMTP Relay - virtual domain
-
- Piegowaty Guziec
- Posty: 2
- Rejestracja: 22 paź 2019, 11:35
- Płeć: Mężczyzna
- Wersja Ubuntu: 16.04
Re: SMTP Relay - virtual domain
Moja poniższa konfiguracja oraz opis
Unfortunately, I couldn't do it that way.
Below is all the configuration I've done.
/etc/postfix/main.cf
# default relayhost setting
relayhost = [smtp.gmail.com]:587
# sender-dependent sasl authentication
smtp_sender_dependent_authentication = yes
sender_dependent_relayhost_maps = hash:/etc/postfix/sender_relay
# smtp authentication settings
smtp_use_tls = yes
#smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_tls_security_level = encrypt
smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt
smtp_sasl_mechanism_filter = plain
/etc/postfix/sasl_passwd
# per-sender authentication
vcenter@mydomain.local account2@gmail.com:password
icinga@mydomain.local account1@gmail.com:password
upc@mydomain.local account2@gmail.com:password
apc@mydomain.local account3@gmail.com:password
# default relayhost
[smtp.gmail.com]:587 account1@gmail.com:password
/etc/postfix/sender_relay
#GMAIL
account1@gmail.com [smtp.gmail.com]:587
account2@gmail.com [smtp.gmail.com]:587
account3@gmail.com [smtp.gmail.com]:587
Until then, everything is working properly and I can send messages from different addresses to different gmail addresses.
Now I want to add an additional configuration under O365 and here the problem begins.
I added such lines:
/etc/postfix/main.cf
# Configure for O365
smtp_generic_maps = hash:/etc/postfix/generic
smtp_sasl_tls_security_options = noanonymous
smtp_always_send_ehlo = yes
/etc/postfix/sasl_passwd
O365@mydomain.local accountO365@mydomain.com:password
/etc/postfix/sender_relay
accountO365@mydomain.com [smtp.office365.com]:587
/etc/postfix/generic
O365@mydomain.local accountO365@mydomain.com
What combinations would I not try, I am not able to run two relayhost to gmail and O365 simultaneously.
How do I add an entry to
# default relayhost setting
relayhost = [smtp.gmail.com]: 587
relayhost = [smtp.office365.com]: 587
This gets the message:
postfix: warning: /etc/postfix/main.cf, line 55: overriding earlier entry: relayhost = [smtp.gmail.com]: 587
However, if I leave only relayhost = [smtp.gmail.com]: 587 then messages that were to go to O365 ida on gmail.
So the question is whether it can be done at all and if so what I am doing wrong.
Unfortunately, I couldn't do it that way.
Below is all the configuration I've done.
/etc/postfix/main.cf
# default relayhost setting
relayhost = [smtp.gmail.com]:587
# sender-dependent sasl authentication
smtp_sender_dependent_authentication = yes
sender_dependent_relayhost_maps = hash:/etc/postfix/sender_relay
# smtp authentication settings
smtp_use_tls = yes
#smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_tls_security_level = encrypt
smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt
smtp_sasl_mechanism_filter = plain
/etc/postfix/sasl_passwd
# per-sender authentication
vcenter@mydomain.local account2@gmail.com:password
icinga@mydomain.local account1@gmail.com:password
upc@mydomain.local account2@gmail.com:password
apc@mydomain.local account3@gmail.com:password
# default relayhost
[smtp.gmail.com]:587 account1@gmail.com:password
/etc/postfix/sender_relay
#GMAIL
account1@gmail.com [smtp.gmail.com]:587
account2@gmail.com [smtp.gmail.com]:587
account3@gmail.com [smtp.gmail.com]:587
Until then, everything is working properly and I can send messages from different addresses to different gmail addresses.
Now I want to add an additional configuration under O365 and here the problem begins.
I added such lines:
/etc/postfix/main.cf
# Configure for O365
smtp_generic_maps = hash:/etc/postfix/generic
smtp_sasl_tls_security_options = noanonymous
smtp_always_send_ehlo = yes
/etc/postfix/sasl_passwd
O365@mydomain.local accountO365@mydomain.com:password
/etc/postfix/sender_relay
accountO365@mydomain.com [smtp.office365.com]:587
/etc/postfix/generic
O365@mydomain.local accountO365@mydomain.com
What combinations would I not try, I am not able to run two relayhost to gmail and O365 simultaneously.
How do I add an entry to
# default relayhost setting
relayhost = [smtp.gmail.com]: 587
relayhost = [smtp.office365.com]: 587
This gets the message:
postfix: warning: /etc/postfix/main.cf, line 55: overriding earlier entry: relayhost = [smtp.gmail.com]: 587
However, if I leave only relayhost = [smtp.gmail.com]: 587 then messages that were to go to O365 ida on gmail.
So the question is whether it can be done at all and if so what I am doing wrong.
Kto jest online
Użytkownicy przeglądający to forum: Obecnie na forum nie ma żadnego zarejestrowanego użytkownika i 11 gości