I do something similar but check for the existence of the file first with

IF EXIST <Path_to_TopDir of domain> rules.ima goto:Append
goto copy
:Append
copy <topDir of primary domain> rules.ima <path to temp storage>isprules.ima
copy <topDir of virtual> rules.ima <path to temp storage>original.ima
CD\<path to temp storage>
copy /y isprules.ima original.ima <TopDir of virtual> rules.ima
IF ERRORLEVE==1 goto Error
DEL original.ima
GOTO END
:Copy
copy /y <TopDir of Primary> rules.ima <TopDir of virtual> rules.ima
IF ERRORLEVEL==1 goto Error
GOTO END
:Error
CALL print error.bat
:END
exit

----- Original Message ----- 
From: "R. Scott Perry" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, September 08, 2003 8:29 AM
Subject: Re: [IMail Forum] standard rules.ima


>
> >we have a standard rules.ima file for our customers with filtering rules
> >for viruses and attachements, worms, etc.
> >
> >we copy them to all domain subdirectories (dos batchfile)
> >problem: if somebody has its own domain rules defined, they will be
> >overwritten.
>
> Since you are using a batch file, what you could do is instead of:
>
>          copy rules.ima [whatever]\rules.ima
>
> you could use:
>
>          type rules.ima >> [whatever]\rules.ima
>
> The ">>" will append to the existing file (just do not use ">", as that
> will overwrite it).
>
> Of course, this can only be done once, or else you will end up with
> duplicate information in the rules.ima file.
>
>                                                     -Scott
> ---
> Declude JunkMail: The advanced anti-spam solution for IMail mailservers.
> Declude Virus: Catches known viruses and is the leader in mailserver
> vulnerability detection.
> Find out what you have been missing: Ask for a free 30-day evaluation.
>
> ---
> [This E-mail was scanned for viruses by Declude Virus
(http://www.declude.com)]
>
>
> To Unsubscribe: http://www.ipswitch.com/support/mailing-lists.html
> List Archive: http://www.mail-archive.com/imail_forum%40list.ipswitch.com/
> Knowledge Base/FAQ: http://www.ipswitch.com/support/IMail/
>


To Unsubscribe: http://www.ipswitch.com/support/mailing-lists.html
List Archive: http://www.mail-archive.com/imail_forum%40list.ipswitch.com/
Knowledge Base/FAQ: http://www.ipswitch.com/support/IMail/

Reply via email to