On Tue, 2005-09-13 at 15:04 +0600, Denis Eremenko wrote:
> Sometimes you _need_ HTM template. Ex.: you have non-english clients
> with different codepages or you want to write template in different
> codepage than clients have, HTML-supporting MUA (most do) will
> automatically convert from source encoding to client's one. So we need
> add "Content-Type: text/html; charset=your_template_charset_here" header
> to template. Unfortunately clamav closes header part of message by
> adding extra newline to last header line, so everything in template will
> be body. It seems that HTML template support will not be added because
> of strange paranoid hatred of authors to HTML: "Please don't damage
> ClamAV's reputation associating it with any HTML mail" (C) Tomasz
> Papszun. HTML in e-mail not evil itself. Viruses? Yes, but you have av
> on your MTA, isn't? Following patch instructions changes clamav-milter
> default behavior (tested on 0.86.2) or just use diff file attached:
>
> 1. Find in clamav-milter/clamav-milter.c string (enclosed in quotes)
> "fputs(_("Subject: Virus intercepted\n\n"), sendmail);". I have it on
> line 2961...
> 2. Change it to "fputs(_("Subject: Virus intercepted\n"), sendmail);".
> Note - one "\n" lost.
> 3. Add line "fputs(_("\n"), sendmail);". Between comment, saying "Use
> our own hardcoded template", and line, containing "if(bflag)" (i have it
> on line 2968). This is needed to save hardcoded notification.
>
> clamav-milter use sendmail program on unicies, it takes message as is
> (with any headers). Now template should have 2 parts, separated by empty
> line (double "\n\n" in C code): headers and body. Ex. (russian):
>
> ===== start-of-file =====
> Content-Type: text/html; charset=koi8-r
>
> <html>
> <body>
>
> <p>
> Сообщение от ${mail_addr}$, принятое от узла $_$ и адресованное
[snip]
> ===== end-of-file =====
>
> NB:
> 1. Headers ended by first empty line (in example it is between
> "Content-Type" header and <html> tag).
> 2. %h should be enclosed in <pre></pre> tag to save newlines (HTML
> strips newlines in code, it uses <br> for explicit newline, <pre>
> changes this default behavior)
>
> Sorry for bad english. %)
The CVS version now supports the --template-headers option, which should
allow you to do what you want.
-Nigel
--
Nigel Horne. Arranger, Adjudicator, Band Trainer, Composer, Tutor,
Typesetter.
NJH Music, Barnsley, UK. ICQ#20252325
[EMAIL PROTECTED] http://www.bandsman.co.uk
_______________________________________________
http://lurker.clamav.net/list/clamav-users.html