Hi there,
So, I've been spending some time setting up a Postfix-Dovecot mail server on my local network, solely for personal use. I have setup virtual users & domains in a Postgres database and everything seems to be running well; I can send and receive messages on an internal domain, and have fetchmail pulling messages from my existing email accounts hosted elsewhere (ISP, hosting provider, Gmail, etc). So far so good.
Now I want to be able to send messages for those 'elsewhere' accounts, THROUGH the existing smtp servers that I've been using up to this point in Thunderbird; I just want it to be relayed/routed through my postfix smtp to my hosting provider's smtp (in this instance; eventually I'll do the same thing for my ISP and Gmail. For now I just want to be able to send mail for mydomain.com through the smtp server of my hosting provider)
From what I've read, smtp relay is what does this, am I correct?
So I've added the following settings to my postfix main.cf:
Code:
smtp_sasl_auth_enable = yes
smtp_sasl_security_options = noanonymous
smtp_sasl_password_maps = hash:/etc/postfix/smtp_sasl_passwd
smtp_sender_dependent_authentication = yes
sender_dependent_relayhost_maps = hash:/etc/postfix/sender_relay
relayhost =
Note that 'relayhost' is left blank. I'm not sure what to put there.
I've added my external account username/password to smtp_sasl_passwd:
Code:
@mydomain.com me@mydomain.com:mypassword
and I've added my external smtp servers to sender_relay:
Code:
@mydomain.com smtp.myhostingprovider.com:587
I ran postmap on both smtp_sasl_passwd and sender_relay, and restarted my postfix service. Everything seemed to come up fine.
So I went to Thunderbird and sent an email to my Gmail account from my 'mydomain.com' account that I setup on my internal postfix server.
It appeared to send, but I never received it in my Gmail account.
So I took a look at 'postqueue' and noticed that it's stuck in there.
It says:
Code:
"delay_reason": "connect to alt4.gmail-smtp-in.l.google.com[142.250.XX.XX]:25: Connection timed out"
I'm a bit confused.
Why is postfix trying to connect to the google smtp if my intention was to relay the message from my postfix smtp to myhostingprovider.com?
I feel like I'm missing something, or perhaps I'm misunderstanding relay altogether.
Can someone help shed some light on how this should be configured to achieve what I'm trying to do?
Much appreciated!