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.

AnFi
  • 6,103
  • 1
  • 14
  • 27
infernox
  • 29
  • 1
  • 4

3 Answers3

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

AnFi
  • 6,103
  • 1
  • 14
  • 27
  • 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 09 '14 at 17:37
  • Add additional requirements to your query after "**EDIT:**" line. Aliases are not sender depended. – AnFi Mar 09 '14 at 18:22
  • :( I think that I don't understand how I should it do – infernox Mar 10 '14 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 '14 at 12:52
0

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

ALex_hha
  • 7,193
  • 1
  • 25
  • 40
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.

peterh
  • 4,953
  • 13
  • 30
  • 44