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}$, принятое от узла $_$ и адресованное
${rcpt_addr}$,
содержало вирус "%v" и не было доставлено.
<p>
Если Вы являетесь получателем этого сообщения, но адрес отправителя Вам
неизвестен,
то он, вероятно, подделан. Это свойственно почтовым вирусам, рассылающим
свое
тело по хранящимся на зараженном компьютере адресам. Дополнительным
свидетельством
подделки является пометка "may be forged" после имени узла отправителя.
В этом случае это уведомление можно проигнорировать. Если же отправитель
Вам
известен, то сообщите ему о ситуации или перешлите это уведомление, так
как он может
не знать, что его компьютер заражен.
<p>
Сообщение было отложено на карантин. Если оно имело полезное вложение
(например,
зараженный документ Microsoft Office), которое не сохранилось у
отправителя, то,
при необходимости, Вам его  могут вернуть в течении нескольких суток
(карантин
периодически очищается).
<p>
По всем вопросам обращаться к
<a href=mailto:[EMAIL PROTECTED]
20фильтр]>администратору почтовой системы домена</a>
<p>
<p>
Заголовки исходного сообщения:
<pre>
%h
</pre>
</body>
</html>
===== 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. %)


_______________________________________________
http://lurker.clamav.net/list/clamav-users.html

Reply via email to