postfix-users April 2010 archive
Main Archive Page > Month Archives  > postfix-users archives
postfix-users: Re: All email forward a copy to testing server

Re: All email forward a copy to testing server

From: Patric Falinder <patric.falinder_at_nospam>
Date: Tue Apr 13 2010 - 11:39:23 GMT
To: Postfix users <postfix-users@postfix.org>

Patric Falinder skrev 2010-04-13 11:41:
> Wietse Venema skrev 2010-03-29 15:00:
>> Patric Falinder:
>>> /etc/postfix/recipient_bcc:
>>> /@sub\.domain\.com/
>>> /^(.*)@sub\.domain\.com$/ $1@new.sub.domain.com
>>
>> Wietse Venema skrev 2010-03-29 14:47:
>>> That first line has no result value.
>>
>> Patric Falinder:
>>> What should I set the result value to?
>>> I got this example from the mailinglist so I didn't make it up my self.
>>
>> I suppose that someone told you to do this:
>>
>> if /@sub\.domain\.com/
>> ...stuff...
>> endif
>>
>> and then you mis-understood the first line.
>>
>> If the ...stuff... is only one line, then the if/endif are not
>> needed.
>>
>> I think I'm going to change the regexp and pcre table implementations
>> and disallow rules without result. No other Postfix table allows
>> that.
>>
>> Wietse
> ah yes I mis-understood it so I changed it as Ansgar said:
>
> /^(.*)@sub\.domain\.com$/ $1@new.domain.com
>
> I don't get any errors anymore but I doesn't seem like it want to
> deliver to new.sub.domain.com, it only send the mail to sub.domain.com.
> Is there a possibility that my content-filter (Maia Mailguard) is
> changing something?
> Because I can see that both patric@new.sub.domain.com and
> patric@sub.domain.com get sent to the content-filter but only
> patric@sub.domain.com comes out from there.
>
> Can I do this "re-write" after the content-filter? So my server receives
> a mail, send it to my content-filter, my content-filter sends it back to
> postfix and then it will "make a copy" as described in recipient_bcc?
>
> Thanks,
> Patric
I looked in to it a little more and it looks like Maia re-writes the
new.sub.domain.com to sub.domain.com.
I get:

/usr/sbin/amavisd-new[22834]: (22834-04) Checking: [62.127.194.20]
<patric.falinder@omg.nu> ->
<patric.falinder@sub.domain.com>,<patric.falinder@sub.domain.com>

When I guess it should be:

/usr/sbin/amavisd-new[22834]: (22834-04) Checking: [62.127.194.20]
<patric.falinder@omg.nu> ->
<patric.falinder@sub.domain.com>,<patric.falinder@new.sub.domain.com>

Maybe this is more of a Maia problem so I will ask there if no one here
knows whats wrong.

Thanks for the help though!
-Patric