This patch adds a VERSION variable to procmail. It works the same as HOST -- if you try setting it a value that is not the specified version, processing of the current rcfile will stop. This isn't terribly useful as it doesn't allow a range of version numbers, so using it in recipes may be preferred since it is allows a regex: LOG="Running procmail $VERSION on $HOST " :0: * VERSION ?? 3.11pre /dev/null I don't recommend using the recipe above. :) Chris ---------------------------------------------------------------------- *** ./patchlevel.h Sun Apr 27 19:27:41 1997 *************** *** 10,12 **** --- 10,15 ---- /* If the formatting or number of newlines of VERSION substantially changes, src/manconf.c needs to be changed as well */ + + /* change to whatever the procmail version is */ + #define VERSIONNUMBER "v3.11pre7" *** ./src/misc.c Sun Apr 27 19:27:46 1997 *************** *** 21,26 **** --- 21,27 ---- #include "mcommon.h" #include "goodies.h" #include "locking.h" + #include "../patchlevel.h" #ifndef NO_COMSAT #include "network.h" #endif *************** *** 35,41 **** struct varstr strenstr[]={{"SHELLMETAS",DEFshellmetas},{"LOCKEXT",DEFlockext}, {"MSGPREFIX",DEFmsgprefix},{"COMSAT",""},{"TRAP",""}, {"SHELLFLAGS",DEFshellflags},{"DEFAULT",DEFdefault},{"SENDMAIL",DEFsendmail}, ! {"SENDMAILFLAGS",DEFflagsendmail}}; #define MAXvarvals maxindex(strenvvar) #define MAXvarstrs maxindex(strenstr) --- 36,42 ---- struct varstr strenstr[]={{"SHELLMETAS",DEFshellmetas},{"LOCKEXT",DEFlockext}, {"MSGPREFIX",DEFmsgprefix},{"COMSAT",""},{"TRAP",""}, {"SHELLFLAGS",DEFshellflags},{"DEFAULT",DEFdefault},{"SENDMAIL",DEFsendmail}, ! {"SENDMAILFLAGS",DEFflagsendmail},{"VERSION",VERSIONNUMBER}}; #define MAXvarvals maxindex(strenvvar) #define MAXvarstrs maxindex(strenstr) *************** *** 483,488 **** --- 484,498 ---- closerc(); } } + else if (!strcmp (buf, "VERSION")) + { const char*version; + if(strcmp(chp,VERSIONNUMBER)) + { yell("VERSION mismatched", VERSIONNUMBER); + if(rc<0||!nextrcfile()) /* if no rcfile opened yet */ + retval=EXIT_SUCCESS,Terminate(); /* exit gracefully as well */ + closerc(); + } + } else { int i=MAXvarvals; do /* several numeric assignments */