Am 26.09.2014 um 11:50 schrieb Mike Cardwell:
> I have some Exim configuration which allows me to have automatically
> expiring email addresses. It accepts mail for any addresses matching
> the format:
> 
> yyyy-mm...@tmp.grepular.com
> 
> But only if the YYYY-MM-DD matches a date which is today or in the
> future. For example, "2014-09...@tmp.grepular.com" will accept mail
> up until the end of this month and will reject mail from that point
> onwards.
> 
> What would be the best way of replicating this functionality in
> Postfix? If it would involve calling out to an external script, I am ok
> with writing such a thing, but if it can be done "natively" inside
> Postfix, that would be preferable.
> 
> If anyone cares, here is how I did it in Exim:
> https://grepular.com/Automatically_Expiring_Email_Addresses

this maybe best suited with mysql tables because you
could have a catch-all on the MDA/LMTP and "show" postfix
the needed RCPT table based on query

see example below and keep in mind that you are very flexible
with such queries (combined with mysql-views and so on) and
the "dbma_recipients" table below is indeed a complex view
over 5 tables postfix don't need to know about

http://www.postfix.org/MYSQL_README.html
_____________________________________________________

main.cf:
local_recipient_maps = mysql:/etc/postfix/mysql-recipients.cf

[root@srv-rhsoft:~]$ cat /etc/postfix/mysql-recipients.cf
user     = mail
password = ***********
dbname   = mail
hosts    = unix:/var/lib/mysql/mysql.sock inet:127.0.0.1:3307
query    = select alias from dbma_recipients where alias='%s'
_____________________________________________________

you can even play such games in a shared infrastructure
the example below is to bypass the MX (spamfilter) from internal webservers

select REPLACE(transport,'dbmail-lmtp:127.0.0.1:24','smtp:[192.168.196.20]:25') 
as transport from dbma_transports
where mydestination='%s' or mydestination='%d' order by transport desc limit 1;

Reply via email to