How to catchall email to a single user mailbox in postfix

I am new to postfix, i need to configure it so that any incoming email to my server will be delivered to a local user account(/etc/passwd). My server will not have any virtual domains($mydestination) listed anywhere, i just need to catchall unknown mails to local user account.

i have seen some topic related to this configuration using luser_relay and local_receipients_maps. but i don't now how to use them, if you have time, can you please tell me how to use that? I am using postfix on centos 5.5 server

Thanks in advance.


If everything is setup ok.. you can add the following in your main.cf

luser_relay = username
local_recipient_maps =

More Info

Replace username with the recipient's user name or complete address, e.g. john or [email protected]


Here's how I did it:

virtual_transport = regex:/etc/postfix/virtual
root@testmailm01:/etc/postfix# cat virtual
/system/        [email protected] ###this allows you to send outbound logs to another server
/*/     webtest ###catch everything and drop it in the webtest mailbox 

Our alpha test servers point to this box directly as their mail servers so that the developers can experiment with email addresses. In addition, our main SMTP servers have a transport directive:

[adminuser@smtpserver01 adminuser]$ cat /etc/postfix/transport
example.com :[exchange.server.addy]
testing.example.com :[testmailm01.example.cfx]

This allows the developers to test certain things in beta & prod environments by changing the @ to @testing.example.com, which redirects anything with that suffix to the above "test" mail server.

Hope that helps.

edit: did you configure the transport_maps setting? standard "help me" information for postfix problems is the output from "postconf -n" and "cat /etc/postfix/transport". Additionally, if you can locate the full conversation with the error, that would help a lot.

if you can find one of the lines ("grep 'web58007.mail.re3.yahoo.com' /var/log/maillog" or possibly /var/log/mail.log)

Jul 26 21:30:01 fjdx421.example.cfx postfix/qmgr[13444]: 2FBBF17B433: to=<[email protected]>, relay=none, delay=0, status=deferred (delivery temporarily suspended: connect to oram101.example.cfx[172.18.52.101]: Connection refused) 

the odd looking alphanumeric is the pseudo-unique identifier for that conversation, do a "grep 2FBBF17B433 /your/mail/logfile" and post that output as well

edit: first off, I apologize...I was referencing transport maps previously and what you need to define is "virtual_alias_maps". It was correct in my first response but then, for some reason, my brain attached itself to transport_maps...getting old I guess.

Looking at your postconf output, you need to define:

postconf -e virtual_alias_maps = hash:/etc/postfix/virtual
postconf -e recipient_canonical = hash:/etc/postfix/recipient_canonical

then, edit /etc/postfix/virtual:

/*/  <your.test.account>

and /etc/postfix/recipient_canonical:

/./     webtest

and then reload postfix with postfix reload Once that is done, you need to make sure you're correctly attaching to this mail server as it is likely not listed as an MX record anywhere. The easiest method of testing is to:

telnet <mail.server.addy> 25

A sample conversation with mostly bogus info:

Connected to testmailm01.example.cfx.
Escape character is '^]'.
220 testmailm01 ESMTP Postfix
HELO nowhere.com
250 testmailm01
mail from: [email protected]
250 2.1.0 Ok
rcpt to: [email protected]
250 2.1.5 Ok
DATA
354 End data with <CR><LF>.<CR><LF>
bla bla blah
.
250 2.0.0 Ok: queued as 9B4E820E249

The log entries from this conversation:

root@testmailm01:/etc/postfix# grep 9B4E820E249 /var/log/mail.log
Jul 27 08:37:17 testmailm01 postfix/smtpd[16125]: 9B4E820E249: client=someuser.example.cfx[172.18.47.102]
Jul 27 08:37:25 testmailm01 postfix/cleanup[18529]: 9B4E820E249: message-id=<20100727133717.9B4E820E249@testmailm01>
Jul 27 08:37:25 testmailm01 postfix/qmgr[1556]: 9B4E820E249: from=<[email protected]>, size=359, nrcpt=1 (queue active)
Jul 27 08:37:25 testmailm01 postfix/local[18554]: 9B4E820E249: to=<[email protected]>, orig_to=<[email protected]>, relay=local, delay=17, delays=17/0.01/0/0, dsn=2.0.0, status=sent (delivered to mailbox)
Jul 27 08:37:25 testmailm01 postfix/qmgr[1556]: 9B4E820E249: removed

I also have virtual_transport configured, although I'm not sure, after re-reading the description, why. Just in case it's required (try the above first, then add this if it's still not working). This box is semi-production, so I can't just go mucking about with the config to test stuff:

postconf -e virtual_transport = regex:/etc/postfix/virtual

The virtual file remains unchanged, although you always need to make sure you've postmap'd any files that are using the hash: statement with:

postmap <file>

edit: according to this:

Jul 28 20:17:18 rabbits postfix/smtpd[1369]: NOQUEUE: reject: RCPT from mail-wy0-f182.google.com[74.125.82.182]: 554 5.7.1 <[email protected]>: Relay access denied; from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<mail-wy0-f182.google.com>

you're sending email to amamun.info, but your mydestination contains:

mydestination = $myhostname, localhost.$mydomain, localhost
mydomain = test.com
myhostname = rabbits.test.com

without a virtual, there's nothing in there that I can see that would allow your server to pickup email destined for @amamun.info. Depending on what you're wanting to do with the email, you need to either add that domain to your mydestination list, relay_domains, or as a virtual.