Quantcast

BBC mapping

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

BBC mapping

@lbutlr
if !/backup.*@/
/^([^+_]*).*@(.*)/   backup+${1}.${2}@domain.tld
endif

I currently have the above in recipient_bbc

/etc/postfix/main.cf:

recipient_bcc_maps = pcre:$config_directory/recipient_bcc.pcre

And this works perfectly and stores a copy of all email (sent and received) in a backup account that is set to delete messages after 7 days. This allows me to recover messages which people have deleted or accidentally marked as spam.

However, I would like to exclude a specific domain from this backup including all mail TO and FROM the domain.


--
Apple broke AppleScripting signatures in Mail.app, so no random signatures.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: BBC mapping

Wietse Venema
@lbutlr:

> if !/backup.*@/
> /^([^+_]*).*@(.*)/   backup+${1}.${2}@domain.tld
> endif
>
> I currently have the above in recipient_bbc
>
> /etc/postfix/main.cf:
>
> recipient_bcc_maps =3D pcre:$config_directory/recipient_bcc.pcre
>
> And this works perfectly and stores a copy of all email (sent and =
> received) in a backup account that is set to delete messages after 7 =
> days. This allows me to recover messages which people have deleted or =
> accidentally marked as spam.
>
> However, I would like to exclude a specific domain from this backup =
> including all mail TO and FROM the domain.

if !/backup.*@/
if !/@example\.com$/
/^([^+_]*).*@(.*)/   backup+${1}.${2}@domain.tld
endif
endif

However the first pattern doesn't seem robust to me. It excludes
something that has 'backup' in the middle of the localpart.

        Wietse
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: BBC mapping

@lbutlr

> On Feb 7, 2017, at 5:10 PM, Wietse Venema <[hidden email]> wrote:
>
> @lbutlr:
>> if !/backup.*@/
>> /^([^+_]*).*@(.*)/   backup+${1}.${2}@domain.tld
>> endif
>>
>> […]
>>
>> However, I would like to exclude a specific domain from this backup =
>> including all mail TO and FROM the domain.
>
> if !/backup.*@/
> if !/@example\.com$/
> /^([^+_]*).*@(.*)/   backup+${1}.${2}@domain.tld
> endif
> endif

And if a second domain wants the same exclusion? I can’t do multiple tests in the map, right?

> However the first pattern doesn't seem robust to me. It excludes
> something that has 'backup' in the middle of the localpart.

That’s a feature! Or a kuludge, more likely. (If someone is already sending to a ‘backup’ account then the message isn’t backed up again).


--
Apple broke AppleScripting signatures in Mail.app, so no random signatures.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: BBC mapping

Noel Jones-2
On 2/9/2017 11:47 AM, @lbutlr wrote:

>
>> On Feb 7, 2017, at 5:10 PM, Wietse Venema <[hidden email]> wrote:
>>
>> @lbutlr:
>>> if !/backup.*@/
>>> /^([^+_]*).*@(.*)/   backup+${1}.${2}@domain.tld
>>> endif
>>>
>>> […]
>>>
>>> However, I would like to exclude a specific domain from this backup =
>>> including all mail TO and FROM the domain.
>>
>> if !/backup.*@/
>> if !/@example\.com$/
>> /^([^+_]*).*@(.*)/   backup+${1}.${2}@domain.tld
>> endif
>> endif
>
> And if a second domain wants the same exclusion? I can’t do multiple tests in the map, right?

I think you'll have to nest more if..endif statements for the
negative matching to work.

if !/backup.*@/
if !/@example\.com$/
if !/@example\.org$/
/^([^+_]*).*@(.*)/   backup+${1}.${2}@domain.tld
endif
endif
endif



  -- Noel Jones
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: BBC mapping

@lbutlr
On Feb 9, 2017, at 11:35 AM, Noel Jones <[hidden email]> wrote:
> I think you'll have to nest more if..endif statements

Oh. right. Of course. Brain Cloud is strong today.

--
Apple broke AppleScripting signatures in Mail.app, so no random signatures.

Loading...