Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Authenticate user on mail server and then relay to Gmail

New to Debian (Or Linux in general)? Ask your questions here!
Post Reply
Message
Author
aliweb
Posts: 35
Joined: 2017-08-04 05:54
Has thanked: 1 time

Authenticate user on mail server and then relay to Gmail

#1 Post by aliweb »

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: 35
Joined: 2017-08-04 05:54
Has thanked: 1 time

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

#3 Post by aliweb »

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

reinob
Posts: 1189
Joined: 2014-06-30 11:42
Has thanked: 97 times
Been thanked: 47 times

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

#4 Post by reinob »

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).

aliweb
Posts: 35
Joined: 2017-08-04 05:54
Has thanked: 1 time

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

#5 Post by aliweb »

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.

Post Reply