Nikita Kipriyanov wrote:
Hello.

For a local aliasing, it is possible to specify the command as a destination for mail, using 'pipe' character. We're using this possibility to bind spam-learning facility, like this:

(main.cf)
alias_maps = /etc/aliases

(/etc/aliases)
spam: "|/usr/local/bin/spamlearn_from_mail.tcl SPAM"
nospam: "|/usr/local/bin/spamlearn_from_mail.tcl HAM"

(spamlearn_from_main.tcl performs some checks and invokes sa_learn)

Is it ever possible to do same thing with virtual aliases? The following configuration doesn't work:

(main.cf)
virtual_alias_maps = /etc/postfix/virtual_aliases

(/etc/postfix/virtual_aliases)
[EMAIL PROTECTED] "|/usr/local/bin/spamlearn_from_mail.tcl SPAM"
[EMAIL PROTECTED] "|/usr/local/bin/spamlearn_from_mail.tcl HAM"

I found one solution, to alias virtuals to locals, and then to alias locals to commands:

(main.cf)
virtual_alias_maps = /etc/postfix/virtual_aliases
alias_maps = /etc/aliases

(/etc/postfix/virtual_aliases)
[EMAIL PROTECTED] spam
[EMAIL PROTECTED] nospam

(/etc/aliases)
spam: "|/usr/local/bin/spamlearn_from_mail.tcl SPAM"
nospam: "|/usr/local/bin/spamlearn_from_mail.tcl HAM"

Are there any other solutions? Is it possible to alias virtuals to commands directly?

no. virtual aliases do not execute commands. but you can use transport_maps

== master.cf
train .... pipe
  ...
  argv=/path/to/learn ${nexthop}


== transport_maps
spam    train:SPAM
nospam  train:NOSPAM

Reply via email to