Authenticate user on mail server and then relay to Gmail

New to Debian (Or Linux in general)? Ask your questions here!

Authenticate user on mail server and then relay to Gmail

Postby aliweb » 2019-11-19 17:53

Hi,

Trying to learn how to setup different mail service configurations. So far I have setup postfix server that relays mail to Gmail which actually delivers the email. Then I did another setup where I used postfix + dovecot to send/receive email on my own i.e. not relaying to 3rd party SMTP but using my own VPS to send/receive email. This was also working fine.
I was thinking is it possible to combine the two scenarios i.e. user sends email using my own SMTP using authentication and then I actually relay that mail via Gmail, Mailchannels, mailgun etc.?

For e.g. if my mail server is mail.mydomain.com and users are john@domain1.com, mike@domain2.com then my server will authenticate those users and rather than sending email, it will relay to 3rd party. Is this possible?

Thanks
aliweb
 
Posts: 29
Joined: 2017-08-04 05:54


Re: Authenticate user on mail server and then relay to Gmail

Postby aliweb » 2019-11-21 17:31

This is the same scenario where I am passing mail to another SMTP which actually delivers email.
aliweb
 
Posts: 29
Joined: 2017-08-04 05:54

Re: Authenticate user on mail server and then relay to Gmail

Postby reinob » 2019-11-23 18:29

aliweb wrote:This is the same scenario where I am passing mail to another SMTP which actually delivers email.


Then I don't understand your question.
I thought you want to set up a relay server, which relays e-mails from authenticated users.
This is basically what any normal mail server does, the only difference or choice being whether the server should do the delivery itself (directly contact the MX) or relay to a third-party (google or whatever).

The former is the default. For the latter you define "relayhost" (cf. the man page I linked or do, or man 5 postconf).
reinob
 
Posts: 754
Joined: 2014-06-30 11:42

Re: Authenticate user on mail server and then relay to Gmail

Postby aliweb » 2019-11-24 15:37

You are right. I was confused about this process and thought that when using relay then you cannot authenticate users. I read up some tutorials on postfix and dovecot and it seems this is possible.
aliweb
 
Posts: 29
Joined: 2017-08-04 05:54


Return to Beginners Questions

Who is online

Users browsing this forum: No registered users and 5 guests

fashionable