Re: [exim] copy mail to yourself

Startseite
Nachricht löschen
Nachricht beantworten
Autor: Konstantin V. Gavrilenko
Datum:  
To: Brian Blood
CC: Exim-users List
Betreff: Re: [exim] copy mail to yourself
Hi Brian,

thanks for the elegant solution, it does work with an addition of returning
{$sender_addresses} instead of just {true} ;)



copy_to_local_sender:
        driver = redirect
        check_ancestor
        qualify_preserve_domain
        data = ${if
match_domain{$sender_address}{+my_local_domainlist}{$sender_address}}
        unseen


The sender and recipient check are performed in ACLs, so I believe I should be fine.

For others who are looking to a solution of how to self copy sent messages (ala
setting self bcc on a client) it might be good to use this router.
Now my setup is as following.

###EXIM part###
ACL for verification
#verify recipient
accept domains      = +my_domainlist
       endpass
       message      = ${if match{$acl_verify_message}\
                      {\N(?m)^\d{3} (\d\.\d\.\d .{0,120})\Z\N} \
                      {IMAP said: $1}{Recipient unknown/invalid}}
       verify       = recipient/callout=random,5s,defer_ok,no_cache


#verify sender
require verify        = sender/callout=defer_ok,random,5s



#Router
copy_to_local_sender:
driver = redirect
check_ancestor
qualify_preserve_domain
data = ${if match_domain{$sender_address}{+my_domainlist}{$sender_address}}
unseen

##Cyrus/Sieve part for moving the message from Inbox to Sent
if anyof ( header :contains "From" "user@???",
           header :contains "From" "alias@???"
        )
         { fileinto "INBOX/Sent@???"; stop; }



The only downside, is that the messages would appear as New in your Sent folder.
but I guess there should be a workaround for that too.


yours,
kos


-------- Original Message --------
Subject: Re: [exim] copy mail to yourself
From: Brian Blood <brian@???>
To: Exim-users List <exim-users@???>
Date: 13/10/08 19:03

> You want to add a router like this:
>
> copy_to_local_sender:
>     driver = redirect
>     check_ancestor
>     qualify_preserve_domain
>     data = ${if match_domain{$sender_address}{+my_local_domainlist}}
>     unseen

>
> You will want to add some extra security on this as the test in "data"
> is very rudimentary.
>
> Use that along with some flag that will tell your transport and/or
> your system_filter to put the message into their Sent mailbox.
>
> That should work, but will need some fleshing out/testing.
>
>
>
> On Oct 13, 2008, at 8:59 AM, Konstantin V. Gavrilenko wrote:
>
>> I was wondering if somebody can guide me in a right direction.
>>
>> I need to configure exim so that every message a user sends is
>> copied into his
>> Sent folder. So that a MUA doesn't have to first deliver a message
>> through SMTP
>> and then save the message in the user's IMAP Sent folder.
>>
>> I think the best way of doing this is by adding a BSSself recipient
>> to every
>> sent message, something like "get $sender_address and add BBC:
>> $sender_address
>>
>> then have the sieve rules to actually place self addressed messages
>> into the
>> Sent folder.
>>
>> Any suggestions? comments?
>
>
>
> Brian
>
>


--
Respectfully,
Konstantin V. Gavrilenko

Managing Director
Arhont Ltd - Information Security

web:    http://www.arhont.com
        http://www.wi-foo.com
e-mail: k.gavrilenko@???


tel: +44 (0) 870 44 31337
fax: +44 (0) 208 429 3111

PGP: Key ID - 0xE81824F4
PGP: Server - keyserver.pgp.com