On Wed, Jan 28, 2009 at 9:25 PM, Dave <d...@davestechshop.net> wrote:
>
>
> On Wed, Jan 28, 2009 at 9:18 PM, Victor Duchovni
> <victor.ducho...@morganstanley.com> wrote:
>>
>> On Wed, Jan 28, 2009 at 09:04:48PM -0500, Dave wrote:
>>
>> > > Google is full of noise. Try:
>> > >
>> > >    http://www.postfix.org/documentation.html
>> > >    http://www.postfix.org/ADDRESS_REWRITING_README.html
>> > >    http://www.postfix.org/ADDRESS_REWRITING_README.html#generic
>> > >    http://www.postfix.org/generic.5.html
>> > >    http://www.postfix.org/DATABASE_README.html#types
>> > >    http://www.postfix.org/pcre_table.5.html
>> > >    http://www.postfix.org/regexp_table.5.html
>> > >
>> > > > I still do not have an answer to this question. if you have it, how
>> > > > about
>> > > > being a gentleman and sharing it or pointing me to the right place.
>> > > Thanks.
>> > >
>> > > The specific answer is in generic(5). While you can construct a table
>> > > that rewrites all addresses to a fixed value, that would be a mistake.
>> > > Consider what will happen to recipient addresses.
>> >
>> > http://www.postfix.org/ADDRESS_REWRITING_README.html#generic
>> >
>> > The problem is that it only shows "@localdomain.local"
>> > as an example of a wildcard.
>>
>> The generic(5) document lists all the lookup keys used with a given
>> address.
>
> That was a fairly difficult document for me to understand, but it is
> starting to make sense.
> But if my answer is in there, I still don't see it.
>

>From http://www.postfix.org/ADDRESS_REWRITING_README.html

"Postfix typically uses lookup tables with fixed strings to map one
address to one or multiple addresses, and typically uses regular
expressions to map multiple addresses to one or multiple addresses."

So in other words, if you want to match multiple addresses, then
regular expressions might be handy...

The postfix docs for regex tables are here:
http://www.postfix.org/regexp_table.5.html

I'll quote the interesting parts:

"TABLE FORMAT
       The general form of a Postfix regular expression table is:

       /pattern/flags result
              When pattern matches the input string, use the cor-
              responding result value."

"TABLE SEARCH ORDER
       Patterns are applied in the order as specified in the  ta-
       ble,  until  a  pattern  is  found  that matches the input
       string.

       Each pattern  is  applied  to  the  entire  input  string.
       Depending  on  the  application,  that string is an entire
       client hostname, an entire client IP address, or an entire
       mail  address.   Thus,  no parent domain or parent network
       search is done, and u...@domain  mail  addresses  are  not
       broken  up  into  their user and domain constituent parts,
       nor is user+foo broken up into user and foo."

You won't find much about creating regex patterns in the postfix docs,
since that's not really a postfix thing.  Here's a guide that should
help you create a regex to match whatever you'd like:

http://ysomeya.hp.infoseek.co.jp/eng-quick_regex.html

>
>>
>> You need a table that returns the desired value given one
>> of those lookup keys. Postfix has lots of different table types
>> you can use.
>>
>> > would any of these work?
>> > @    my-new-addr...@example.com
>> > @    my-new-address
>>
>> The list of LHS lookup keys is documented in generic(5). "@" is not
>> among them.
>
> I noticed that, but I wasn't immediately able to figure out that the items
> shown were a comprehensive list rather than selected examples.
>
>
>>
>>
>> > BTW, I am not sure what you mean by "Consider what will happen to
>> > recipient
>> > addresses." What will happen? And which recipient addresses would be the
>> > problem? I don't expect to receive any mail at this postfix server. I
>> > just
>> > want to send system messages to my gmail account.
>>
>> All recipient addresses will also match any global wildcard, so you'll
>> never be able to address any email to someone other then the single
>> wildcard rewrite recipient. If that works for you, go for it.
>
> That is exactly the result I was hoping to achieve. But I'm still not sure
> HOW to do it. So, how do I do it?
>

Reply via email to