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

I want to direct all mails received via smtp from the local server to a given local address stock@domain.com.

In main.cf

virtual_alias_maps = regexp:/etc/postfix/virtual

I tried first to use virtualmap

/.*/   stock@domain.com

followed with postmap virtual and /etc/init.d/postfix restart

But it doesn't work - the mail is still routed as normally, and no special message in /var/log/maillog.

The Postfix configuration is scattered over many files, not always updated, sometimes ambiguous (try to find out the command to simply get the version of postfix), and I don't see what can be the problem. Any idea of what could be wrong?

share|improve this question
    
Seems like that would create a loop if stock@domain.com is a local address as well. –  topdog Sep 2 '10 at 6:31
    
Ah, virtual is recursive? Is there a way to prevent that? –  ring0 Sep 2 '10 at 15:25
add comment

1 Answer

up vote 0 down vote accepted

So it seems the correct working syntax is

/.+@.+/   stock@domain.com

that fixed it, and virtual is not recursive...

share|improve this answer
add comment

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.