email forwarding to gmail from your mail server
I wrote this for myself. Since I have no memory, I write everything down. If it helps you -- great. if you run into problems GTS. I have no answers.
I have postfix mapped to a mysql database with three tables: domain, user, alias.
the complete postfix tutorial is here blogging dragon
What he doesn't address, the complexities of forwarding to Gmail, I will below. Gmail is merciless. If your server isn't getting a 8 or greater at mail-tester.com your email will never see an inbox.
we are assuming you have crossed that hurdle.
- step 1:
On the Server
create the local mail box.
INSERT INTO user (email, domain, password) VALUES ('me@myDomain.com', 'myDomain.com', ENCRYPT('mybigpw', CONCAT('\$6\$', SUBSTRING(SHA(RAND()), -16))));
login via roundcube me@... -p mybigpw
In your browser on your pc or device
go to gmail -> settings -> see all site settings -> accounts and import -> Send mail as: ->
Add another email address.
In the popup window:
-> name -- your name or the name to id the account
-> email address: the complete email
-> leave checked treat as an alias ->
-> smtp server : mail.yourMailServer.com ->
user name: your complete email address ->
password: your complete password
click add account.
another pop up will open
Confirm verification to add your email address.
check your local mailbox for the confirmation email from google.
I have roundcube installed. works.
copy the code in your local email to the field in the new gmail window.
step 4 .
go back to your postfix database and create an alias. in my case once an alias is in the table nothing arrives to the local mail box. everything goes to the forward.
from any email send a email to your me@mydomain mailbox.
it should now arrive in your gmail. I'm damn sure it will be in the spam directory.
check your spam box at gmail.