On Monday 09 August 2004 21:11, Sergey wrote:

> I'm understand. Well. But it's limit of template functionality. I think what
> is time for change syntax (may be it's not good because it's only for milter)
> or create third class of variables - clamav-milter specific. So, you  select
> %X  - for ClamAV general variables;
> @X@ - for sendmail's variables.
> You can use &X& for clamav-milter specific for cancel general limit.

That do you say about add section (sorry for non patch) ?

                } else if(*ptr == '&') {
                        /* clamav-milter variable */
                        char *end = strchr(++ptr, '&');

                        if(end == NULL) {
                                syslog(LOG_ERR,
                                        "%s: Unterminated clamav-milter variable 
\"%s\"\n",
                                                filename, ptr);
                                continue;
                        }
                        *end = '\0';

                        /* begin variables definitions */
                        if ( strcmp(ptr, "v") == 0 ) { // replacement for %v, may be 
not need
                            fputs(virusname, sendmail);
                        } // v
                        else if ( strcmp(ptr, "header") == 0) {
                            struct privdata *privdata = (struct privdata 
*)smfi_getpriv(ctx);
                            header_list_print(privdata->headers, sendmail);
                        } // header
                        else if ( strcmp(ptr, "full_version") == 0) {
                            fputs(clamav_version, sendmail);
                        } // clamav_version
                        else if ( strcmp(ptr, "localreceived") == 0) {
                            char *s_relay, *helo;
                            char timestring[128];
                            time_t systime;

                            s_relay = smfi_getsymval(ctx, "{_}");
                            if (!s_relay) s_relay = "";
                            helo = smfi_getsymval(ctx, "s");
                            if (!helo) {
                                helo = "NOHELO";
                                if(use_syslog)
                                        syslog(LOG_WARNING, "Variable \"s\" isn't 
defined in Milter.macros.eom\n");
                            }

                            systime = time(NULL);
                            strftime(timestring, sizeof(timestring) -1, "%a, %d %b %Y 
%T %z (%Z)",
                                            localtime(&systime));

                            fprintf(sendmail, "Received: from %s (%s)", helo, s_relay);
                            fprintf(sendmail, "\n\tby %s (clamav-milter %s) with id 
%s;",
                                    smfi_getsymval(ctx, "j"), CM_VERSION, 
smfi_getsymval(ctx, "i"));
                            fprintf(sendmail, "\n\t%s", timestring);

                        } // localreceived
                        else {
                            fprintf(sendmail, "[unknown clamav-milter's variable:  
%s]", ptr);
                            if(use_syslog)
                                syslog(LOG_ERR, "%s: Unknown clamav-milter's variable 
\"%s\"\n",
                                         filename, ptr);
                        } // end variables definitions
                        ptr = end;


It's not make the syntax of clamav-milter incompatible with clamd and add some new 
variables which expand template using.

-- 
Regards,
Sergey


-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
_______________________________________________
Clamav-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/clamav-devel

Reply via email to