OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
Re: relay_recipients_maps / generic clash

From: mouss (usebsdfree.fr)
Date: Sun Oct 01 2006 - 17:32:33 CDT


John Knappers wrote:
> Hello everyone,
>
> I consolidate a dozen of old domains in 2 domains with the generic
> table function of Postfix at our gateway relay / Mail hub.
> This works fine, but now. at last I finally wanted to implement the
> relay_recipient_maps function. After a night studying the awk syntax
> to convert the virtual table of our internal mailserver to a
> relay_recipients_map table I created a nice script just doing that.
>
> But now the problems starts. Only the mail of the 2 consolidated
> domains is accepted, and the mail to addresses ending with domains in
> the generic table is rejected. Does anyone a way to overcome this? My
> scripting knowledge is not sufficient to take the generic table in
> account when creating a relay_recipient_table.
>
> With other words: Is it possible to accept mail / do the generic
> domain consolidation, and apply the releay_recipients_maps feature
> after that?

post concrete examples and you'll get concrete answers...

if your a map contains things like
foodomain1.example bardomain2.example

and you want to add "bardomain2.example" then

    grep -v "^#" $map| grep | awk '{print $2 " something"}'

will do. if you want to add both key and value, then

    grep -v "^#" $map| grep | awk '{print $1 " got1"; print $2 " got2"}'

This assumes that you do not use addresses with spaces (such as "foo
bar"example.com).