Setting up Postfix on Nginx/Ubuntu

December 6, 2015 1.2k views
Nginx Networking Ubuntu

I'd like for my single Droplet to host multiple separate FQWDs. I would also like any e-mail sent to any username at any of those domains to be forwarded to my personal GMail address.

To be more specific: My domains include putsomethinghere.com and robertakarobin.com. Whether someone addresses an e-mail to robertthomas@robertakrobin.com, robertthomas@putsomethinghere.com, mail@putsomethinghere.com, or thisuserdoesntexistabc123@putsomethinghere.com, I would like it to be forwarded without incident to the same GMail address.

I've followed 37 different tutorials at this point with no success. It should be stated at this point that I'm a mostly-front-end developer who's totally new to playing around with servers and dev ops.

When I ran sendmail -bv mail@putsomethinghere.com the following was logged in /var/log/mail.log:

Dec  6 15:04:24 robertakarobin postfix/pickup[1722]: 6A84182E78: uid=1000 from=<robertthomas>
Dec  6 15:04:24 robertakarobin postfix/cleanup[1727]: 6A84182E78: message-id=<20151206200424.6A84182E78@robertakarobin.com>
Dec  6 15:04:24 robertakarobin postfix/qmgr[1723]: 6A84182E78: from=<robertthomas@robertakarobin.com>, size=305, nrcpt=1 (queue active)
Dec  6 15:04:24 robertakarobin postfix/error[1729]: 6A84182E78: to=<robertthomas@robertakarobin.com>, orig_to=<mail@robertakarobin.com>, relay=none, delay=0.04, delays=0.02/0.01/0/0.01, dsn=5.1.1, status=undeliverable (User unknown in virtual alias table)
Dec  6 15:04:24 robertakarobin postfix/cleanup[1727]: 72B8682E79: message-id=<20151206200424.72B8682E79@robertakarobin.com>
Dec  6 15:04:24 robertakarobin postfix/qmgr[1723]: 72B8682E79: from=<>, size=1992, nrcpt=1 (queue active)
Dec  6 15:04:24 robertakarobin postfix/bounce[1730]: 6A84182E78: sender delivery status notification: 72B8682E79
Dec  6 15:04:24 robertakarobin postfix/qmgr[1723]: 6A84182E78: removed
Dec  6 15:04:24 robertakarobin postfix/error[1729]: 72B8682E79: to=<robertthomas@robertakarobin.com>, relay=none, delay=0.02, delays=0/0/0/0.02, dsn=5.1.1, status=bounced (User unknown in virtual alias table)
Dec  6 15:04:24 robertakarobin postfix/qmgr[1723]: 72B8682E79: removed

Here are the contents of files that may be relevant:

# /etc/aliases
postmaster:    root
# /etc/hostname
robertakarobin.com
# /etc/hosts
127.0.0.1 localhost
127.0.1.1 robertakarobin.com robertakarobin
192.241.177.50 robertakarobin.com
# /etc/postfix/main.cf
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no
append_dot_mydomain = no
readme_directory = no
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_relay_restrictions = smtpd_recipient_restrictions permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = robertakarobin.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
virtual_alias_domains = robertakarobin.com
virtual_alias_maps = hash:/etc/postfix/virtual
mydestination = robertakarobin, localhost.localdomain, localhost
luser_relay = robertgfthomas@gmail.com
relayhost = 
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = ipv4
# /etc/postfix/virtual
@robertakarobin.com     robertthomas

The zone records for my domain:
zone records

I'd really appreciate any assistance.

Be the first one to answer this question.