0

I have a question. Is it possible to configure postfix aliases to retrieve them from an external script?

alias_maps = /path/to/pythons_script.py

or

alias_maps = /path/to/script.sh

EDIT (based on autor's comments):

Aliases should be sender dependent.

2
  • Do you want service queries about aliases by postfix in real time?
    – AnFi
    Mar 9, 2014 at 11:55
  • exactly, this postfix server won't send many emails. I need to do some extra thing when Postfix forward emails.
    – infernox
    Mar 9, 2014 at 13:34

3 Answers 3

1

You may configure postfix to query your python daemon about aliases using socketmap protocol.

http://www.postfix.org/postconf.5.html#alias_database
http://www.postfix.org/DATABASE_README.html#types

There are a few implementation of socketmap daemons in python e.g. pysrs.

Socket map protocol has beeb introduced by sendmail. It is very simple:
http://www.postfix.org/socketmap_table.5.html


Postfix also supports another protocol but it is postix specific:
http://www.postfix.org/tcp_table.5.html

4
  • tcp lookup method is great for me, but it doesn't matter because postfix gives only recipient email, I need also sender email. :(
    – infernox
    Mar 9, 2014 at 17:37
  • Add additional requirements to your query after "EDIT:" line. Aliases are not sender depended.
    – AnFi
    Mar 9, 2014 at 18:22
  • :( I think that I don't understand how I should it do
    – infernox
    Mar 10, 2014 at 12:00
  • I have added it - it should be visible after review/moderation (You reputation score may be to low to do it yourself).
    – AnFi
    Mar 10, 2014 at 12:52
0

AFAIK it is not possible. You can use mysql table instead and insert data into mysql with your own script

0

Postfix knows a lot of lookup tables: http://www.postfix.org/DATABASE_README.html

But a lookup tables like exec:/path/scriptname isn't between them, although it weren't too hard to develop one. In your place I generated a text table with the script and called then 'postmap' for it.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .