LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-24-2019, 03:04 AM   #1
KamilKrK
LQ Newbie
 
Registered: Oct 2019
Posts: 7

Rep: Reputation: Disabled
SMTP Relay - virtual domain


Hello for the first time

He started with a difficult topic right away from me.

I need help configuring SMTP Relay to work like the SMTP_Relay.JPG schema.
I mean exactly that it would be possible to configure SMTP Relay in such a way that depending on what e-mail address will get the message redirected to the appropriate mail server and account. However, I take into account that if you can't do the rule on the email address only on the domain then you will have to do it.
Additionally, for one of the mechanisms it needs authorization.
This is a strange case because the program tells you to enter the login and password for the SMTP service so that you can save the settings, but unfortunately it does not work with the O365 service, therefore in this case it also needs SMTP Relay.
Mechanism description:
1. A message is sent to SMTP Relay from mail address @ domain1.com. SMTP Relay recognizes the email address @ domain1.com and knows that it should route this message to the GMAIL mail server at 123 @ gmail.com.
2. A message is sent to SMTP Relay from the address mail1 @ domain2.com. Authorization to SMTP Relay is done via login and password and is sent on port 587/465. SMTP Relay recognizes the address mail1 @ domain2.com and knows that it is to forward this message to the O365 mail server to the address mail1 @ ourdomain.com.
3. A message is sent to SMTP Relay from mail2 @ domain2.com. SMTP Relay recognizes the address mail2 @ domain2.com and knows that it is to forward this message to the GMAIL mail server to address 456 @ gmail.com.
4. A message is sent to SMTP Relay from mail address @ domain3.com. SMTP Relay recognizes the email address @ domain3.com and knows that it is to forward this message to the O365 mail server to the address mail2 @ outdomain.com.
5. A message is sent to SMTP Relay from the address @ domain4.com. SMTP Relay recognizes the mail address @ domain4.com and knows that it is to forward this message to the O365 mail server to mail2 @ outdomain.com.

https://ibb.co/Q7g1ZMK

In each of the above cases, SMTP Relay is authorized with accounts (O365, GMAIL) by login and password and the appropriate port.

I tried solving the virtual domain but unfortunately it didn't work for some reason.

Has anyone tried to extend SMTP Relay to the above requirements and is it even possible?

Please help.
 
Old 10-24-2019, 08:49 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,680

Rep: Reputation: 7971Reputation: 7971Reputation: 7971Reputation: 7971Reputation: 7971Reputation: 7971Reputation: 7971Reputation: 7971Reputation: 7971Reputation: 7971Reputation: 7971
Quote:
Originally Posted by KamilKrK View Post
Hello for the first time
He started with a difficult topic right away from me.

I need help configuring SMTP Relay to work like the SMTP_Relay.JPG schema.
I mean exactly that it would be possible to configure SMTP Relay in such a way that depending on what e-mail address will get the message redirected to the appropriate mail server and account. However, I take into account that if you can't do the rule on the email address only on the domain then you will have to do it.
Additionally, for one of the mechanisms it needs authorization.
This is a strange case because the program tells you to enter the login and password for the SMTP service so that you can save the settings, but unfortunately it does not work with the O365 service, therefore in this case it also needs SMTP Relay.
Mechanism description:
1. A message is sent to SMTP Relay from mail address @ domain1.com. SMTP Relay recognizes the email address @ domain1.com and knows that it should route this message to the GMAIL mail server at 123 @ gmail.com.
2. A message is sent to SMTP Relay from the address mail1 @ domain2.com. Authorization to SMTP Relay is done via login and password and is sent on port 587/465. SMTP Relay recognizes the address mail1 @ domain2.com and knows that it is to forward this message to the O365 mail server to the address mail1 @ ourdomain.com.
3. A message is sent to SMTP Relay from mail2 @ domain2.com. SMTP Relay recognizes the address mail2 @ domain2.com and knows that it is to forward this message to the GMAIL mail server to address 456 @ gmail.com.
4. A message is sent to SMTP Relay from mail address @ domain3.com. SMTP Relay recognizes the email address @ domain3.com and knows that it is to forward this message to the O365 mail server to the address mail2 @ outdomain.com.
5. A message is sent to SMTP Relay from the address @ domain4.com. SMTP Relay recognizes the mail address @ domain4.com and knows that it is to forward this message to the O365 mail server to mail2 @ outdomain.com.

https://ibb.co/Q7g1ZMK

In each of the above cases, SMTP Relay is authorized with accounts (O365, GMAIL) by login and password and the appropriate port. I tried solving the virtual domain but unfortunately it didn't work for some reason. Has anyone tried to extend SMTP Relay to the above requirements and is it even possible?
Who is the "He" in this question??? And please read the LQ Rules about posting verbatim homework questions...we're happy to help you, but you need to show your efforts and provide details. You say it didn't work for "some reason"...what reason? Did you look at any log files? Have any errors or messages to show us? We cannot guess. You also don't tell us what version/distro of Linux you're using, or what mail engine (postfix? sendmail?).

For postfix, it's called transport mapping, and you can find many how-to guides on using it and defining rules.
 
Old 11-13-2019, 03:35 AM   #3
KamilKrK
LQ Newbie
 
Registered: Oct 2019
Posts: 7

Original Poster
Rep: Reputation: Disabled
Ubuntu 18 version and postfix program.

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.comassword
icinga@mydomain.local account1@gmail.comassword
upc@mydomain.local account2@gmail.comassword
apc@mydomain.local account3@gmail.comassword

# default relayhost
[smtp.gmail.com]:587 account1@gmail.comassword

/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.comassword

/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.
 
Old 11-13-2019, 07:12 AM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,680

Rep: Reputation: 7971Reputation: 7971Reputation: 7971Reputation: 7971Reputation: 7971Reputation: 7971Reputation: 7971Reputation: 7971Reputation: 7971Reputation: 7971Reputation: 7971
Quote:
Originally Posted by KamilKrK View Post
Ubuntu 18 version and postfix program.
Unfortunately, I couldn't do it that way.
Again, you are not being clear. Which way? And you still haven't answered the questions asked previously, such as who "he" is.
Quote:
Below is all the configuration I've done.
Code:
/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:
Code:
/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
Code:
# 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.
You need to go back and re-read the first reply. You asked how to do it, and were told to use transport mapping.
 
Old 11-15-2019, 02:10 AM   #5
KamilKrK
LQ Newbie
 
Registered: Oct 2019
Posts: 7

Original Poster
Rep: Reputation: Disabled
I did something like this using transport_maps and it still doesn't work .

/etc/postfix/Main . cf
mynetworks = 127 . 0 . 0 . 0/8, [ : : ffff : 127 . 0 . 0 . 0]/104, [ : : 1]/128, 192 . 168 . 1 . 0/24,
mydestination = $myhostname, smtprelay, localhost . localdomain, , localhost, localhost . o365 . local, localhost . gmail . local
# 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
transport_maps = hash : /etc/postfix/transport
--------------------------------------------------------------------------------------------------------------------------
/etc/postfix/sasl_passwd
gmail@gmail . local account1@gmail . com : Start321!
o365@o365 . local account1@mydomain . com : Start321!
------------------------------------------------------------------------------------------------------------------------
/etc/postfix/sender_relay
account1@gmail . com [smtp . gmail . com] : 587
account1@mydomain . com [smtp . office365 . com] : 587
----------------------------------------------------------------------------------------------------------------------
/etc/postfix/transport
gmail . local smtp : [smtp . gmail . com] : 587
o365 . local smtp : [smtp . office365 . com] : 587

At this time, only sending from gmail@gmail . local works and for O365 there is such an error :

321D0100A34 : from=<o365@o365 . local>, size=422, nrcpt=1 (queue active)
Nov 14 10 : 30 : 51 smtprelay postfix/smtp[6261] : 321D0100A34 : SASL authentication failed; server smtp . gmail . com[173 . 194 . 73 . 108] said : 535-5 . 7 . 8 Username and Password not accepted . Learn more at?535 5 . 7 . 8 https : //support . google . com/mail/?p=BadCredentials i22sm2015187ljg . 94 - gsmtp
Nov 14 10 : 30 : 51 smtprelay postfix/smtp[6261] : connect to smtp . gmail . com[2a00 : 1450 : 4010 : c0d : : 6d] : 587 : Network is unreachable
Nov 14 10 : 30 : 51 smtprelay postfix/smtp[6261] : 321D0100A34 : to=<myemail@mydomain . com>, relay=none, delay=0 . 43, delays=0 . 07/0/0 . 36/0, dsn=4 . 4 . 1, status=deferred (connect to smtp . gmail . com[2a00 : 1450 : 4010 : c0d : : 6d] : 587 : Network is unreachable)

After hashing the entry #relayhost = [smtp . gmail . com] : 587 in main . cf, nothing works and every message wants to come out via O365 but he fails .

Nov 14 10 : 16 : 08 smtprelay postfix/qmgr[5995] : 31D7F100A34 : from=<o365@o365 . local>, size=422, nrcpt=1 (queue active)
Nov 14 10 : 16 : 38 smtprelay postfix/smtp[6013] : connect to xxx . mail . protection . outlook . com[104 . 47 . 1 . 36] : 25 : Connection timed out

Nov 14 10 : 15 : 00 smtprelay postfix/qmgr[5995] : 560EF100A34 : from=<gmail@gmail . local>, size=437, nrcpt=1 (queue active)
Nov 14 10 : 15 : 30 smtprelay postfix/smtp[6013] : connect to xxx . mail . protection . outlook . com[104 . 47 . 0 . 36] : 25 : Connection timed out


In the first case ipostfix trying to authorize gmail via o365 account. But you will notice the message is sent from o365@o365.local and should be redirected to the server smtp.office365.com and not to smtp.gmail.com. So it doesn't look at the settings in the transport file at all.

In the second case, it is strange because it does not matter if I send from the address gmail.com or o365.local it is always redirected to the address smtp.office365.com, which means that it does not pay attention to the settings in the trasport file and tries to connect on port 25 which is blocked for this service we get a time out message. As you can see in the configuration files, port 587 is everywhere.
 
Old 11-15-2019, 07:47 AM   #6
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,680

Rep: Reputation: 7971Reputation: 7971Reputation: 7971Reputation: 7971Reputation: 7971Reputation: 7971Reputation: 7971Reputation: 7971Reputation: 7971Reputation: 7971Reputation: 7971
Quote:
Originally Posted by KamilKrK View Post
I did something like this using transport_maps and it still doesn't work .
Yes, your duplicate thread addressed that. And you need to post things in CODE tags, so it's not a huge block of nearly unreadable text.
Quote:
Code:
/etc/postfix/Main . cf
mynetworks = 127 . 0 . 0 . 0/8, [ : : ffff : 127 . 0 . 0 . 0]/104, [ : : 1]/128, 192 . 168 . 1 . 0/24,
mydestination = $myhostname, smtprelay, localhost . localdomain, , localhost, localhost . o365 . local, localhost . gmail . local
# 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
transport_maps = hash : /etc/postfix/transport
--------------------------------------------------------------------------------------------------------------------------
/etc/postfix/sasl_passwd
gmail@gmail . local account1@gmail . com : Start321!
o365@o365 . local account1@mydomain . com : Start321!
------------------------------------------------------------------------------------------------------------------------
/etc/postfix/sender_relay
account1@gmail . com [smtp . gmail . com] : 587
account1@mydomain . com [smtp . office365 . com] : 587
----------------------------------------------------------------------------------------------------------------------
/etc/postfix/transport
gmail . local smtp : [smtp . gmail . com] : 587
o365 . local smtp : [smtp . office365 . com] : 587
At this time, only sending from gmail@gmail . local works and for O365 there is such an error :
Code:
321D0100A34 : from=<o365@o365 . local>, size=422, nrcpt=1 (queue active)
Nov 14 10 : 30 : 51 smtprelay postfix/smtp[6261] : 321D0100A34 : SASL authentication failed; server smtp . gmail . com[173 . 194 . 73 . 108] said : 535-5 . 7 . 8 Username and Password not accepted . Learn more at?535 5 . 7 . 8 https : //support . google . com/mail/?p=BadCredentials i22sm2015187ljg . 94 - gsmtp
Nov 14 10 : 30 : 51 smtprelay postfix/smtp[6261] : connect to smtp . gmail . com[2a00 : 1450 : 4010 : c0d : : 6d] : 587 : Network is unreachable
Nov 14 10 : 30 : 51 smtprelay postfix/smtp[6261] : 321D0100A34 : to=<myemail@mydomain . com>, relay=none, delay=0 . 43, delays=0 . 07/0/0 . 36/0, dsn=4 . 4 . 1, status=deferred (connect to smtp . gmail . com[2a00 : 1450 : 4010 : c0d : : 6d] : 587 : Network is unreachable)
After hashing the entry #relayhost = [smtp . gmail . com] : 587 in main . cf, nothing works and every message wants to come out via O365 but he fails .
Code:
Nov 14 10 : 16 : 08 smtprelay postfix/qmgr[5995] : 31D7F100A34 : from=<o365@o365 . local>, size=422, nrcpt=1 (queue active)
Nov 14 10 : 16 : 38 smtprelay postfix/smtp[6013] : connect to xxx . mail . protection . outlook . com[104 . 47 . 1 . 36] : 25 : Connection timed out
Nov 14 10 : 15 : 00 smtprelay postfix/qmgr[5995] : 560EF100A34 : from=<gmail@gmail . local>, size=437, nrcpt=1 (queue active)
Nov 14 10 : 15 : 30 smtprelay postfix/smtp[6013] : connect to xxx . mail . protection . outlook . com[104 . 47 . 0 . 36] : 25 : Connection timed out
In the first case ipostfix trying to authorize gmail via o365 account. But you will notice the message is sent from o365@o365.local and should be redirected to the server smtp.office365.com and not to smtp.gmail.com. So it doesn't look at the settings in the transport file at all.

In the second case, it is strange because it does not matter if I send from the address gmail.com or o365.local it is always redirected to the address smtp.office365.com, which means that it does not pay attention to the settings in the trasport file and tries to connect on port 25 which is blocked for this service we get a time out message. As you can see in the configuration files, port 587 is everywhere.
See your OTHER thread; reporting this as a duplicate, since you now have two identical threads, and you're not reading either one. Again, read the error messages, because one is telling you that you have bad user info (correct it), and the other is AGAIN, covered in the Microsoft knowledgebase.
 
Old 11-15-2019, 07:55 AM   #7
KamilKrK
LQ Newbie
 
Registered: Oct 2019
Posts: 7

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by TB0ne View Post
Yes, your duplicate thread addressed that. And you need to post things in CODE tags, so it's not a huge block of nearly unreadable text.

See your OTHER thread; reporting this as a duplicate, since you now have two identical threads, and you're not reading either one. Again, read the error messages, because one is telling you that you have bad user info (correct it), and the other is AGAIN, covered in the Microsoft knowledgebase.

Hello,

As you can see, you don't read what I wrote in this topic.
1. He knows exactly that there are incorrect data but if you saw the configuration you would see that in this case you should authorize on the O365 server and not gmail which is logical that the login details for O365 will not work in gmail.
2. Copied description in the above post.
In the second case, it is strange because it does not matter if I send from the address gmail.com or o365.local it is always redirected to the address smtp.office365.com, which means that it does not pay attention to the settings in the trasport file and tries to connect on port 25 which is blocked for this service we get a time out message. As you can see in the configuration files, port 587 is everywhere.
 
Old 11-15-2019, 08:07 AM   #8
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,680

Rep: Reputation: 7971Reputation: 7971Reputation: 7971Reputation: 7971Reputation: 7971Reputation: 7971Reputation: 7971Reputation: 7971Reputation: 7971Reputation: 7971Reputation: 7971
Quote:
Originally Posted by KamilKrK View Post
Hello,
As you can see, you don't read what I wrote in this topic.
1. He knows exactly that there are incorrect data but if you saw the configuration you would see that in this case you should authorize on the O365 server and not gmail which is logical that the login details for O365 will not work in gmail.
Right: because you haven't configured things to work correctly. And again, who is "He"???
Quote:
2. Copied description in the above post.
In the second case, it is strange because it does not matter if I send from the address gmail.com or o365.local it is always redirected to the address smtp.office365.com, which means that it does not pay attention to the settings in the trasport file and tries to connect on port 25 which is blocked for this service we get a time out message. As you can see in the configuration files, port 587 is everywhere.[/QUOTE]
I read exactly what you wrote, but it doesn't appear as if you're understanding what you're being told. You had to be told twice to use transport mapping, and were pointed to the Postfix documentation, which you still need to read.

I'd suggest getting ONE service working correctly at a time. A quick how-to for getting O365 working:
https://secopsmonkey.com/mail-relayi...ffice-365.html

...and one for Gmail:
https://www.howtoforge.com/tutorial/...-a-mail-relay/

Once you have them working independently, enable transport mapping and get it configured. Again, you need to think about what you're doing; both O365 and Gmail require things to be configured **ON THEIR SIDE** to allow you to use it as a relay host. Have you done the OAuth2 steps for Gmail??
 
Old 11-15-2019, 08:24 AM   #9
KamilKrK
LQ Newbie
 
Registered: Oct 2019
Posts: 7

Original Poster
Rep: Reputation: Disabled
1. He is from Google translator. Sorry.
2. As for gmail as I leave the relayhost = [smtp. gmail. com]: 587 everything works fine but only for the address gmail@gmail.local.
How do I change the entry to relayhost = [smtp. office365. com]: 587 it works for o365@o365.local but it doesn't work for gmail.
And if I delete the relayhost entry, then something even collapses.
 
Old 11-25-2019, 03:32 AM   #10
KamilKrK
LQ Newbie
 
Registered: Oct 2019
Posts: 7

Original Poster
Rep: Reputation: Disabled
The final configuration where accounts for gmail and O365 work on one posftix.

/etc/posftix/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_generic_maps = hash:/etc/postfix/generic
transport_maps = hash:/etc/postfix/transport

/etc/postfix/sasl_passwd
# default relayhost
[smtp.gmail.com]:587 accountgmail@gmail.com:Password
#Gmail per-sender authentication
notification@gmail.local accountgmail@gmail.com:Password
# O365 per-sender authentication
AccountO365@o365.com AccountO365@o365.com:Password

/etc/posftix/transport
notification@gmail.local smtp:[smtp.gmail.com]:587
AccountO365@o365.com smtp:[smtp.office365.com]:587

/etc/postfix/sender relay
notification@gmail.local [smtp.gmail.com]:587
AccountO365@o365.com [smtp.office365.com]:587
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
SMTP newbie queries: #< #5.3.5 SMTP; 553 5.3.5 system config error> #SMTP# LYC Linux - Newbie 0 12-04-2014 12:45 AM
Postfix - single virtual domain and relay, need to add second non-virtual domain Tech33 Linux - Server 7 07-30-2013 10:09 PM
How i use my local smtp server and smtp server of my domain registrar simultaniosly Sanjeesh Linux - Networking 5 11-29-2008 05:07 AM
SMTP "open relay" and SMTP AUTH aikempshall Linux - Security 3 10-11-2006 08:19 AM
smtp authentication for virtual domain user Roswellevent Linux - Networking 2 12-28-2004 01:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:55 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration