How to setup Postfix to accept all email and send to a specific address

email-serverpostfix

I want to setup a catch-all email address for my domain. ie ( anything sent to support@mydomain.com or foobar11123@mydomain.com will go to a specific mailbox ). I've got Postfix working with local mail but it rejects the emails from outside the machines' hostname.

I followed this config to get it to send all incoming mail to a specific account : http://www.cyberciti.biz/faq/howto-setup-postfix-catch-all-email-accounts/ . And when I send an email on the same machine it works as expected:

paul@server1:~/Maildir/new$ ls -l ~/Maildir/new/
total 0
paul@server1:~/Maildir/new$ echo "test email" | mail -s "test subject" u123456@helpmeco.de
paul@server1:~/Maildir/new$ ls -l ~/Maildir/new/
total 4
-rw------- 1 paul paul 2112 Jun 15 19:39 1339774754.V90ceIf21c25M531738.server1
paul@server1:~/Maildir/new$ 

but when I try to send from another domain ( i'll use gmail as an example ) I get a non-delivery notice.

enter image description here

here is mail.log for the gmail and local call:

Jun 15 19:38:40 server1 postfix/pickup[489]: 88ADDF21C35: uid=1000 from=<paul>
Jun 15 19:38:40 server1 postfix/cleanup[1909]: 88ADDF21C35: message-id=<20120615153840.88ADDF21C35@server1.helpmeco.de>
Jun 15 19:38:40 server1 postfix/qmgr[490]: 88ADDF21C35: from=<paul@helpmeco.de>, size=349, nrcpt=1 (queue active)
Jun 15 19:38:40 server1 postfix/local[1911]: 88ADDF21C35: to=<u123456@helpmeco.de>, relay=local, delay=0.08, delays=0.05/0.01/0/0.02, dsn=5.1.1, status=bounced (unknown user: "u123456")
Jun 15 19:38:40 server1 postfix/cleanup[1909]: 93FDAF21C39: message-id=<20120615153840.93FDAF21C39@server1.helpmeco.de>
Jun 15 19:38:40 server1 postfix/bounce[1912]: 88ADDF21C35: sender non-delivery notification: 93FDAF21C39
Jun 15 19:38:40 server1 postfix/qmgr[490]: 93FDAF21C39: from=<>, size=2096, nrcpt=1 (queue active)
Jun 15 19:38:40 server1 postfix/qmgr[490]: 88ADDF21C35: removed
Jun 15 19:38:40 server1 postfix/local[1911]: 93FDAF21C39: to=<paul@helpmeco.de>, relay=local, delay=0.02, delays=0.01/0/0/0, dsn=2.0.0, status=sent (delivered to maildir)
Jun 15 19:38:40 server1 postfix/qmgr[490]: 93FDAF21C39: removed
Jun 15 19:39:14 server1 postfix/pickup[489]: 7B866F21C35: uid=1000 from=<paul>
Jun 15 19:39:14 server1 postfix/cleanup[1909]: 7B866F21C35: message-id=<20120615153914.7B866F21C35@server1.helpmeco.de>
Jun 15 19:39:14 server1 postfix/qmgr[490]: 7B866F21C35: from=<paul@helpmeco.de>, size=349, nrcpt=1 (queue active)
Jun 15 19:39:14 server1 postfix/local[1911]: 7B866F21C35: to=<u123456@helpmeco.de>, relay=local, delay=0.02, delays=0.01/0/0/0, dsn=5.1.1, status=bounced (unknown user: "u123456")
Jun 15 19:39:14 server1 postfix/cleanup[1909]: 7EFA0F21C39: message-id=<20120615153914.7EFA0F21C39@server1.helpmeco.de>
Jun 15 19:39:14 server1 postfix/qmgr[490]: 7EFA0F21C39: from=<>, size=2096, nrcpt=1 (queue active)
Jun 15 19:39:14 server1 postfix/bounce[1912]: 7B866F21C35: sender non-delivery notification: 7EFA0F21C39
Jun 15 19:39:14 server1 postfix/qmgr[490]: 7B866F21C35: removed
Jun 15 19:39:14 server1 postfix/local[1911]: 7EFA0F21C39: to=<paul@helpmeco.de>, relay=local, delay=0.02, delays=0.01/0/0/0, dsn=2.0.0, status=sent (delivered to maildir)
Jun 15 19:39:14 server1 postfix/qmgr[490]: 7EFA0F21C39: removed
Jun 15 19:40:02 server1 postfix/pickup[489]: 6EC93F21C39: uid=107 from=<smmsp>
Jun 15 19:40:02 server1 postfix/cleanup[1909]: 6EC93F21C39: message-id=<20120615154002.6EC93F21C39@server1.helpmeco.de>
Jun 15 19:40:02 server1 postfix/qmgr[490]: 6EC93F21C39: from=<smmsp@helpmeco.de>, size=665, nrcpt=1 (queue active)
Jun 15 19:40:02 server1 postfix/local[1911]: 6EC93F21C39: to=<root@helpmeco.de>, orig_to=<root>, relay=local, delay=0.11, delays=0.1/0/0/0, dsn=2.0.0, status=sent (delivered to maildir)
Jun 15 19:40:02 server1 postfix/qmgr[490]: 6EC93F21C39: removed
Jun 15 19:40:53 server1 postfix/smtpd[1975]: connect from mail-wg0-f42.google.com[74.125.82.42]
Jun 15 19:40:53 server1 postfix/smtpd[1975]: NOQUEUE: reject: RCPT from mail-wg0-f42.google.com[74.125.82.42]: 550 5.1.1 <test@helpmeco.de>: Recipient address rejected: User unknown in local recipient table; from=<brower.paul@gmail.com> to=<test@helpmeco.de> proto=ESMTP helo=<mail-wg0-f42.google.com>
Jun 15 19:40:54 server1 postfix/smtpd[1975]: disconnect from mail-wg0-f42.google.com[74.125.82.42]

and unlike the local send there is no new email in the directory.

paul@server1:~/Maildir/new$ ls -l
total 4
-rw------- 1 paul paul 2112 Jun 15 19:39 1339774754.V90ceIf21c25M531738.server1
paul@server1:~/Maildir/new$ 

is there something about non local mail that is doing this? How do I get postfix to accept all mail to all users and put it into a specific user inbox?

EDIT: adding main.cf

paul@server1:~/Maildir/new$ cat /etc/postfix/main.cf 
# See /usr/share/postfix/main.cf.dist for a commented, more complete version


# Debian specific:  Specifying a file name will cause the first
# line of that file to be used as the name.  The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname

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 = server1.helpmeco.de
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = helpmeco.de, server1.helpmeco.de, localhost.helpmeco.de, localhost
relayhost = 
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_command = 
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
home_mailbox = Maildir/

Best Answer

figured it out. I was missing some entries in my main.cf file:

smtpd_recipient_restrictions = permit_mynetworks, permit_auth_destination, reject

virtual_alias_maps = hash:/etc/postfix/virtual

local_recipient_maps =

making the full main.cf:

# See /usr/share/postfix/main.cf.dist for a commented, more complete version


# Debian specific:  Specifying a file name will cause the first
# line of that file to be used as the name.  The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname

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
smtpd_reject_unlisted_recipient = no
smtpd_recipient_restrictions = permit_mynetworks, permit_auth_destination, reject

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

myhostname = server1.helpmeco.de
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = helpmeco.de, server1.helpmeco.de, localhost.helpmeco.de, localhost
relayhost = 
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_command = 
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
home_mailbox = Maildir/

virtual_alias_maps = hash:/etc/postfix/virtual

local_recipient_maps =