As of 6.1.18, Sympa became able to invoke newaliases(1), postmap(1) and so on by configuration. The virtualwrapper and aliaswrapper were deprecated. Description in this section may be applicable to earlier releases.

ikeda AT conversion.co.jp

Consider this problem: When using the method described in the Sympa documentation to add robots for virtual domains, you add a generic regexp on the form:

/^(.*)@my.domain.org$/ my.domain.org-$1

in the virtual_regexp of Postfix. Incoming mail to “listname@my.domain.org” will match this regexp and be delivered to the local address “my.domain.org-listname”. Problem with this approach is that all mail to “my.domain.org” will match the regexp and be delivered, and not until later will Postfix find out that this is a nonexistent address and send “Undelivered Mail Returned to Sender”. Instead we would like Postfix to instantly give SMTP 550 error message when trying to send to bogus addresses.

My solution to this problem: If you change alias_manager.pl to also generate entries in the sympa_virtual on the form:

Normally, sympa requires several aliases for each list in order to pipe different addresses to different commands. In postfix, this can only be done in a non-virtual alias file, so if you are using sympa on a virtual domain, a little trickiery is needed to map the virtual aliases to non-virtual aliases.
We take this one step further by using regular expression based virtual aliases so that all we need is one set of entries per domain. This makes it so that you don't need to ever change the alias files once they are set up, regardless of how many lists you add and remove.
First add this to postfix's main.cf:

This sets the file virtual.regexp to be a virtual map using regular expressions. The recipient_delimiter of '+' is the default, but it is required for the trick to work so we set it explicitly.
Next, we modify postfix's main non-virtual aliases file, typically called aliases:

What does this do? Lets look at the first line: It takes the address 'mydomain' and pipes it to the command “|/queue $EXTENSION@my.domain.org”. But what does $EXTENSION equal? This variable will hold our list name. In order to set the $EXTENSION variable to the list name, we use a + to add an additional recipient in the virtual aliases file. Suppose we had the virtual alias:

mylist@my.domain.org mydomain+mylist

This would forward mail sent to mylist@my.domain.org to the local address mydomain with the additional recipient of 'mylist'. When we resolve the address 'mydomain' in the aliases file, the variable $EXTENSION will then be set to 'mylist'. This would in turn get piped to ”/home/sympa/bin/queue mylist@my.domain.org” which is what sympa requires.
Again, this is required because we cannot pipe addresses to commands in a virtual aliases file, so we need some way to convert the entries in our virtual aliases file to corresponding entries in the non-virtual aliases file.
The next step is to create the virtual.regexp file. We could create a ton of entries, several for each list, like the virtual alias above. Instead, we use regular expressions to cover all lists.
Here is a sample entry in virtual.regexp for the domain my.domain.org:

The first line just tells postfix we are handling mail for the virtual domain my.domain.org. The xxx is just a placeholder, but it is required. The second line catches important addresses which we do not want processed as lists. You can forward these non-list addresses to another domain or use the same domain. They should eventually resolve to some mailbox somewhere. The third line is where it gets interesting. Here is an example of how this expression will resolve:

Which is what we need for the alias file we have set up.
Note the difference between my.domain.org and mydomain. The first is the actual domain. The second is an arbitrary tag which we have chosen to associate with the domain.
To make sure that postfix can handle the regular expression map type:

prompt> postconf -m

this will give you a list of supported map types. Check for “regexp”.
This alias setup is adapted from the mailman+postfix setup described at http://listes.rezo.net/how.php.