Postfix: processing incoming mail for virtual user

This discussion on Dovecot ML suggests to use for filtering mail for foo user foo: | /path/to/the/external/program in /etc/aliases. But aliases work only for local user. How to filter with script mail for virtual user (virtual_alias_maps)?

Do I have to use Sieve scripts or is there anything else for Dovecot? I guess creating real user just to solve this isn't recommended, but maybe I'm wrong (what are

UPDATE:

  1. Can you list pros and cons for both solutions (Sieve vs. real user)? I guess security concernt (virtual users are safer).
  2. Can you suggest how to implement this with sieve scripts?

Solution 1:

The one sensible answer is "procmail"

https://unix.stackexchange.com/questions/79046/extracting-attachments-from-mail-that-is-coming-to-my-postfix-inbox

Have fun.