On 2011-08-12 01:37, Troy Piggins wrote:
On Thu, Aug 11, 2011 at 10:02:21AM +1000, Troy Piggins wrote:
On Wed, Aug 10, 2011 at 09:47:37AM +0200, Jeroen Geilman wrote:
<snip />
It is not a variable expansion. Use this instead:

        /(user1)@mydomain.com/  $1_s...@mydomain.com

Read http://www.postfix.org/pcre_table.5.html, section Text Substitution for
details.

Note that this offers zero advantage over an exact match.
Thankyou!  That works.  I now have this and it seems to be working fine:

if !/^(excludeduser1|root|.+_sent)@mydomain\.com$/
/^(.+)@mydomain\.com$/ ${1}_s...@mydomain.com
endif
Perhaps I spoke too soon.  This is creating duplicates.  Any pointers on why?
I could see a loop problem if the "if/endif" condition wasn't there, but
shouldn't that prevent "_sent" messages going through again?

For completeness, the procmail rule I use is:

:0:
* ^X-Original-To:.*_sent@mydomain\.com
| gzip -fc9>>  ${HOME}/Sent_${DATE}.gz

The duplicates do not show up in the sender's normal Sent folder, but do show
up in the gzipped archive.  Using my "old" method of manually adding/deleting
each user as they join/leave the company, and using a hash table instead of
pcre, this worked and didn't create duplicates:

us...@mydomain.com      user1_s...@mydomain.com
us...@mydomain.com      user2_s...@mydomain.com
us...@mydomain.com      user3_s...@mydomain.com
and so on...

I can't see my error, please help.

Really, use an archive DOMAIN. This precludes any looping.

--
J.

Reply via email to