hmmm It worked for me
Ok, lets do a step by step once again.
If we fill "Send copy to" field in ISPCOnfig panel, when ISPC generate file: /var/vmail/mailfilters/DOMAIN/USER/.mailfilter with line:
I modify this to that code:
#------ get a mailto parts USER@HOST from maildrop enviroment ($3 and $4)
#------ I need this to have separate .duplicate.cache file for every users
#------ reformail save ID from mail and return 0 if that mail was in this file already
`reformail -D 8000 /var/vmail/mailfilters/$HOST/$USER/.duplicate.cache`
#------ in other case (file wasn't in .dupicate.cache)
if ( $RETURNCODE != 0 )
#------ do a "Send copy to"
#IN OTHER CASE DO NOT CC but only try to put mail to original mailbox (without cc)
of course you must modify "cc "!FORWARDTO@DOMAIN.COM"" to your case.
If you have generated ".duplicate.cache" file you have reformail command, and it works.
Maybe we misunderstand.
I do that a protects from sending CC for every TRY to put SAME mail in mailbox that is overquota.
But FIRST try of try will DO a CC. And for every (different) new mail that will (try) arrive to mailbox will be a CC too.
Only RESEND SAME mail from postfix queue to original (overquota) mailbox will not generate NEW CC to "Send copy to" user.
ps. if it will works however for you too, you need patch ISPC "plugins-available/maildrop_plugin.inc.php" file, in order to ISPC generate improvement ".mailfilter" each time user fill "Send copy to" in panel (how do this, I wrote in first reply).