Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I'm running Ubuntu 12 Precise Pangolin and am trying to configure my server to catchall mail sent to it and forward it to my gmail address. I've been trying lots of examples online like editing my main.cf file which looks like this:

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

readme_directory = no

# TLS parameters
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

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.

myhostname = destiny
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = destiny, localhost.localdomain, localhost
relayhost = smtp.sendgrid.net
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 51200000
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all

In my /etc/postfix/virtual I have:

@mydomain.com mypersonal.email@gmail.com
@myotherdomain.com mypersonal.email@gmail.com

Which isn't working when I email test@mydomain.com or test@myotherdomain.com.

So I got the recommendation to add the following to my /etc/alias:

postmaster:root
root:mypersonal.email@gmail.com

restarted postfix, and tried emailing foo@mydomain.com or bar@myotherdomain.com but it still won't send.

Does anyone have any idea what I'm doing wrong here? I'd appreciate any help.

share|improve this question
    
You will not do this. Therefore Google invented Gmail to use with your own domain. That's what you want. –  mailq Sep 19 '12 at 20:59

1 Answer 1

up vote 0 down vote accepted

Your main.cf doesn't seem to have virtual_alias_maps. Please replace your listing of main.cf with the output of postconf -n to make sure. For further investigation provide a log excerpt of one mail transaction for a mail sent to foo@mydomain.com starting with the point where it's submitted into Postfix up to the point where Postfix decides what to do with it. Easiest way to do this is by greping the log for the queue ID of one such transaction, e.g.:

# grep A19BEB5071E /var/log/mail.log
Sep 14 08:34:16 server postfix/qmgr[20790]: A19BEB5071E: from=<sender@example.com>, size=1922, nrcpt=1 (queue active)
Sep 14 08:34:16 server postfix/smtpd[32758]: proxy-accept: END-OF-MESSAGE: 250 2.0.0 Ok: queued as A19BEB5071E; from=<sender@example.com> to=<recipient@example.net> proto=ESMTP helo=<host.example.com>
Sep 14 08:34:16 server postfix/pipe[32764]: A19BEB5071E: to=<recipient@example.net>, relay=cyrus, delay=0.62, delays=0.58/0.01/0/0.04, dsn=2.0.0, status=sent (delivered via cyrus service)
Sep 14 08:34:16 server postfix/qmgr[20790]: A19BEB5071E: removed

And FTR, using a catch-all is not a good idea in this day and age. I strongly recommend against doing that.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.