1 /*$Id: config.h,v 1.101 2001/08/27 08:43:57 guenther Exp $*/ 2 3 /*#define sMAILBOX_SEPARATOR "\1\1\1\1\n" /* sTART- and eNDing separ. */ 4 /*#define eMAILBOX_SEPARATOR "\1\1\1\1\n" /* uncomment (one or both) 5 if your mail system uses 6 nonstandard mail separators (non sendmail or smail compatible mailers 7 like MMDF), if yours is even different, uncomment and change the 8 value of course */ 9 10 /* KEEPENV and PRESTENV should be defined as a comma-separated null-terminated 11 list of strings */ 12 13 /* every environment variable appearing in KEEPENV will not be thrown away 14 * upon startup of procmail, e.g. you could define KEEPENV as follows: 15 * #define KEEPENV {"TZ","LANG",0} 16 * environment variables ending in an _ will designate the whole group starting 17 * with this prefix (e.g. "LC_"). Note that keeping LANG and or the LC_ 18 * variables is not recommended for most installations due to the security 19 * considerations/dependencies present in the use of locales other than 20 * the "C" locale. 21 */ 22 #define KEEPENV {"TZ",0} 23 24 /* procmail is compiled with two definitions of the PATH variable. The first 25 * definition is used while processing the /etc/procmailrc file and should 26 * only contain trustable (i.e., system) directories. Otherwise the second 27 * definition is used. Note that the /etc/procmailrc file cannot change the 28 * PATH seen by user's rcfiles: the second definition will be applied upon the 29 * completion of the /etc/procmailrc file (future versions of procmail are 30 * expected to provide better runtime configuration control). The autoconf 31 * process attempts to determine reasonable values for these versions of PATH 32 * and sets the defSPATH and defPATH variables accordingly. If you want to 33 * override those settings you should uncomment and possibly change the 34 * DEFSPATH and DEFPATH defines below 35 */ 36 /*#define DEFSPATH "PATH=/bin:/usr/bin" /* */ 37 /*#define DEFPATH "PATH=$HOME/bin:/bin:/usr/bin" /* */ 38 39 /* every environment variable appearing in PRESTENV will be set or wiped 40 * out of the environment (variables without an '=' sign will be thrown 41 * out), e.g. you could define PRESTENV as follows: 42 * #define PRESTENV {"IFS","ENV","PWD",0} 43 * any side effects (like setting the umask after an assignment to UMASK) will 44 * *not* take place. Do *not* define PATH here -- use the DEFSPATH and 45 * DEFPATH defines above instead 46 */ 47 #define PRESTENV {"IFS","ENV","PWD",0} 48 49 /*#define GROUP_PER_USER /* uncomment this if each 50 user has his or her own 51 group and procmail can therefore trust a $HOME/.procmailrc that 52 is group writable or contained in a group writable home directory 53 if the group involved is the user's default group. */ 54 55 #define LMTP /* uncomment this if you 56 want to use procmail 57 as an LMTP (rfc2033) server, presumably for invocation by an MTA. 58 The file examples/local_procmail_lmtp.m4 contains info on how to 59 set this up with sendmail. */ 60 61 /* This file previously allowed you to define SYSTEM_MBOX. This has 62 changed. If you want mail delivery to custom mail-spool-files, edit the 63 src/authenticate.c file and change the content of: auth_mailboxname() 64 (either directly, or through changing the definitions in the same file 65 of MAILSPOOLDIR, MAILSPOOLSUFFIX, MAILSPOOLHASH or MAILSPOOLHOME) */ 66 67 /************************************************************************ 68 * Only edit below this line if you have viewed/edited this file before * 69 ************************************************************************/ 70 71 /* every user & group appearing in TRUSTED_IDS is allowed to use the -f option 72 if the list is empty (just a terminating 0), everyone can use it 73 TRUSTED_IDS should be defined as a comma-separated null-terminated 74 list of strings; if unauthorised users use the -f option, an extra 75 >From_ field will be added in the header */ 76 77 #define TRUSTED_IDS {"root","daemon","uucp","mail","x400","network",\ 78 "list","slist","lists","news","mailnull","majordom","majordomo",0} 79 80 #define NO_fcntl_LOCK /* uncomment any of these three if you */ 81 /*#define NO_lockf_LOCK /* definitely do not want procmail to make */ 82 /*#define NO_flock_LOCK /* use of those kernel-locking methods */ 83 /* If you set LOCKINGTEST to a binary number 84 than there's no need to set these. These #defines are only useful 85 if you want to disable particular locking styles but are unsure which 86 of the others are safe. Otherwise, don't touch them. */ 87 88 /*#define RESTRICT_EXEC 100 /* uncomment to prevent users with uids equal 89 or higher than RESTRICT_EXEC from 90 executing programs from within their .procmailrc files (this 91 restriction does not apply to the /etc/procmailrc and 92 /etc/procmailrcs files) */ 93 94 /*#define NO_NFS_ATIME_HACK /* uncomment if you're definitely not using 95 NFS mounted filesystems and can't afford 96 procmail to sleep for 1 sec. before writing to an empty regular 97 mailbox. This lets programs correctly judge whether there is unread 98 mail present. procmail automatically suppresses this when it isn't 99 needed or under heavy load. */ 100 101 /*#define DEFsendmail "/usr/sbin/sendmail" /* uncomment and/or change if 102 the autoconfigured default 103 SENDMAIL is not suitable. This program should quack like a sendmail: 104 it should accept the -oi flag (to tell it to _not_ treat a line 105 containing just a period as EOF) and then a list of recipients. If the 106 -t flag is given, it should instead extract the recipients from the 107 To:, Cc:, and Bcc: header fields. If it can't do this, many standard 108 recipes will not work. One reasonable candidate is "/etc/mta/send" 109 on systems that support the MTA configuration switch. */ 110 111 #define DEFmaildir "$HOME" /* default value for the MAILDIR variable; 112 this must be an absolute path */ 113 114 #define PROCMAILRC "$HOME/.procmailrc" /* default rcfile for every 115 recipient; if this file 116 is not found, maildelivery will proceed as normal to the default 117 system mailbox. This also must be an absolute path */ 118 119 #define ETCRC "/usr/local/etc/procmailrc" /* optional global procmailrc startup 120 file (will only be read if procmail 121 is started with no rcfile on the command line). */ 122 123 #define ETCRCS "/usr/local/etc/procmailrcs/" /* optional trusted path prefix for 124 rcfiles which will be executed with 125 the uid of the owner of the rcfile (this only happens if procmail is 126 called with the -m option, without variable assignments on the command 127 line). */ 128 129 /*#define console "/dev/console" /* uncomment if you want procmail to 130 use the console (or any other 131 terminal or file) to print any error messages that could not be dumped 132 in the "logfile"; only recommended for debugging purposes, if you have 133 trouble creating a "logfile" or suspect that the trouble starts before 134 procmail can interpret any rcfile or arguments. */ 135 136 /************************************************************************ 137 * Only edit below this line if you *think* you know what you are doing * 138 ************************************************************************/ 139 140 #define ROOT_uid 0 141 #define LDENV {"LD_","_RLD","LIBPATH=","ELF_LD_","AOUT_LD_",0} 142 143 #define UPDATE_MASK S_IXOTH /* bit set on mailboxes when mail arrived */ 144 #define OVERRIDE_MASK (S_IXUSR|S_ISUID|S_ISGID|S_ISVTX) /* if found set */ 145 /* the permissions on the mailbox will be left untouched */ 146 #define INIT_UMASK (S_IRWXG|S_IRWXO) /* == 077 */ 147 #define GROUPW_UMASK (INIT_UMASK&~S_IRWXG) /* == 007 */ 148 #define NORMperm \ 149 (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH|UPDATE_MASK) 150 /* == 0667, normal mode bits used to create files, before umask */ 151 #define READperm (S_IRUSR|S_IRGRP|S_IROTH) /* == 0444 */ 152 #define NORMdirperm (S_IRWXU|S_IRWXG|S_IRWXO) /* == 0777 */ 153 #define LOCKperm READperm /* mode bits used while creating lockfiles */ 154 #define MAX_locksize 16 /* lockfiles are expected not to be longer */ 155 #ifndef SMALLHEAP 156 #define DEFlinebuf 2048 /* default max expanded line length */ 157 #define BLKSIZ 16384 /* blocksize while reading/writing */ 158 #define STDBUF 1024 /* blocksize for emulated stdio */ 159 #else /* and some lower defaults for the unfortunate amongst us */ 160 #define DEFlinebuf 512 161 #define BLKSIZ 1024 162 #define STDBUF 128 163 #undef USE_MMAP /* don't bother on these guys */ 164 #endif /* SMALLHEAP */ 165 #undef USE_MMAP /* UNTIL PROBLEMS ARE FIXED */ 166 #ifdef USE_MMAP 167 #ifndef INEFFICIENTrealloc 168 #define INEFFICIENTrealloc /* don't pussy-foot around */ 169 #endif 170 #define MAXinMEM (1024*1024) /* when to switch to mmap() */ 171 #define MMAP_DIR "/var/spool/procmail/" /* where to put */ 172 #endif /* the files */ 173 #define MINlogbuf 81 /* fit an entire line */ 174 #define MAXlogbuf 1000 /* in case someone abuses LOG */ 175 #define MAILERDAEMON "MAILER-DAEMON" /* From_ address to replace <> */ 176 #define FAKE_FIELD ">From " 177 #define RETRYunique 8 /* # of tries at making a unique filename */ 178 #define BOGUSprefix "BOGUS." /* prepended to bogus mailboxes */ 179 #define DEFsuspend 16 /* multi-purpose 'idle loop' period */ 180 #define DEFlocksleep 8 181 #define TO_key "^TO_" /* for addresses */ 182 #define TO_substitute "(^((Original-)?(Resent-)?(To|Cc|Bcc)|\ 183 (X-Envelope|Apparently(-Resent)?)-To):(.*[^-a-zA-Z0-9_.])?)" 184 #define TOkey "^TO" /* for words */ 185 #define TOsubstitute "(^((Original-)?(Resent-)?(To|Cc|Bcc)|\ 186 (X-Envelope|Apparently(-Resent)?)-To):(.*[^a-zA-Z])?)" 187 #define FROMDkey "^FROM_DAEMON" /* matches most daemons */ 188 #define FROMDsubstitute "(^(Mailing-List:|Precedence:.*(junk|bulk|list)|\ 189 To: Multiple recipients of |\ 190 (((Resent-)?(From|Sender)|X-Envelope-From):|>?From )([^>]*[^(.%@a-z0-9])?(\ 191 Post(ma?(st(e?r)?|n)|office)|(send)?Mail(er)?|daemon|m(mdf|ajordomo)|n?uucp|\ 192 LIST(SERV|proc)|NETSERV|o(wner|ps)|r(e(quest|sponse)|oot)|b(ounce|bs\\.smtp)|\ 193 echo|mirror|s(erv(ices?|er)|mtp(error)?|ystem)|\ 194 A(dmin(istrator)?|MMGR|utoanswer)\ 195 )(([^).!:a-z0-9][-_a-z0-9]*)?[%@> ][^<)]*(\\(.*\\).*)?)?$([^>]|$)))" 196 #define FROMMkey "^FROM_MAILER" /* matches most mailer-daemons */ 197 #define FROMMsubstitute "(^(((Resent-)?(From|Sender)|X-Envelope-From):|\ 198 >?From )([^>]*[^(.%@a-z0-9])?(\ 199 Post(ma(st(er)?|n)|office)|(send)?Mail(er)?|daemon|mmdf|n?uucp|ops|\ 200 r(esponse|oot)|(bbs\\.)?smtp(error)?|s(erv(ices?|er)|ystem)|A(dmin(istrator)?|\ 201 MMGR)\ 202 )(([^).!:a-z0-9][-_a-z0-9]*)?[%@> ][^<)]*(\\(.*\\).*)?)?$([^>]|$))" 203 #define DEFshellmetas "&|<>~;?*[" /* never put '$' in here */ 204 #define DEFdefault "$ORGMAIL" 205 #define DEFmsgprefix "msg." 206 #define DEFlockext ".lock" 207 #define DEFshellflags "-c" 208 #define DEFlocktimeout 1024 /* defaults to about 17 minutes */ 209 #define DEFtimeout (DEFlocktimeout-64) /* 64 seconds to clean up */ 210 #define DEFnoresretry 4 /* default nr of retries if no resources left */ 211 #define nfsTRY (7+1) /* nr of times+1 to ignore spurious NFS errors */ 212 #define MATCHVAR "MATCH" 213 #define AMATCHVAR "MATCH=" 214 #define DEFlogabstract -1 /* abstract by default, but don't mail it back */ 215 #define COMSAThost "localhost" /* where the biff/comsat daemon lives */ 216 #define COMSATservice "biff" /* the service name of the comsat daemon */ 217 #define COMSATprotocol "udp" /* if you change this, comsat() needs patching */ 218 #define COMSATxtrsep ":" /* mailbox-spec extension separator */ 219 #define SERV_ADDRsep '@' /* when overriding in COMSAT=serv@addr */ 220 #define DEFcomsat offvalue /* when an rcfile has been specified */ 221 /* set to either "offvalue" or "empty" */ 222 223 #define BinSh "/bin/sh" 224 #define ROOT_DIR "/" 225 #define DEAD_LETTER "/tmp/dead.letter" /* $ORGMAIL if no passwd entry */ 226 #define DevNull "/dev/null" 227 #define NICE_RANGE 39 /* maximal nice difference */ 228 #define chCURDIR '.' /* the current directory */ 229 #define chPARDIR ".." /* the parent directory */ 230 #define DIRSEP "/" /* directory separator symbols, the */ 231 /* last one should be the most common one */ 232 #define MAILDIRtmp "/tmp" /* maildir subdirectories */ 233 #define MAILDIRcur "/cur" 234 #define MAILDIRnew "/new" 235 #define MAILDIRLEN STRLEN(MAILDIRnew) 236 #define MAILDIRretries 5 /* retries on obtaining a unique filename */ 237 238 #define EOFName " \t\n#`'\");" 239 240 #define HELPOPT1 'h' /* options to get command line help */ 241 #define HELPOPT2 '?' 242 243 #define VERSIONOPT 'v' /* option to display version */ 244 #define PRESERVOPT 'p' /* preserve environment */ 245 #define TEMPFAILOPT 't' /* return EX_TEMPFAIL on error */ 246 #define MAILFILTOPT 'm' /* act as a general purpose mail filter */ 247 #define FROMWHOPT 'f' /* set name on From_ line */ 248 #define REFRESH_TIME '-' /* when given as argument to -f */ 249 #define ALTFROMWHOPT 'r' /* alternate and obsolete form of -f */ 250 #define OVERRIDEOPT 'o' /* do not generate >From_ lines */ 251 #define BERKELEYOPT 'Y' /* Berkeley format, disregard Content-Length: */ 252 #define ALTBERKELEYOPT 'y' /* same effect as -Y, kludge */ 253 #define ARGUMENTOPT 'a' /* set $1 */ 254 #define DELIVEROPT 'd' /* deliver mail to named recipient */ 255 #define LMTPOPT 'z' /* talk LTMP on stdin/stdout */ 256 #define PM_USAGE \ 257 "Usage: procmail [-vptoY] [-f fromwhom] [parameter=value | rcfile] ...\ 258 \n Or: procmail [-toY] [-f fromwhom] [-a argument] ... -d recipient ...\ 259 \n\ 260 Or: procmail [-ptY] [-f fromwhom] -m [parameter=value] ... rcfile [arg] ...\ 261 \n Or: procmail [-toY] [-a argument] ... -z\ 262 \n" 263 #define PM_HELP \ 264 "\t-v\t\tdisplay the version number and exit\ 265 \n\t-p\t\tpreserve (most of) the environment upon startup\ 266 \n\t-t\t\tfail softly if mail is undeliverable\ 267 \n\t-f fromwhom\t(re)generate the leading 'From ' line\ 268 \n\t-o\t\toverride the leading 'From ' line if necessary\ 269 \n\t-Y\t\tBerkeley format mailbox, disregard Content-Length:\ 270 \n\t-a argument\twill set $1, $2, etc\ 271 \n\t-d recipient\texplicit delivery mode\ 272 \n\t-z\t\tact as an LMTP server\ 273 \n\t-m\t\tact as a general purpose mail filter\n" 274 #define PM_QREFERENCE \ 275 "Recipe flag quick reference:\ 276 \n\tH egrep header (default)\tB egrep body\ 277 \n\tD distinguish case\ 278 \n\tA also execute this recipe if the common condition matched\ 279 \n\ta same as 'A', but only if the previous recipe was successful\ 280 \n\tE else execute this recipe, if the preceding condition didn't match\ 281 \n\te on error execute this recipe, if the previous recipe failed\ 282 \n\th deliver header (default)\tb deliver body (default)\ 283 \n\tf filter\t\t\ti ignore write errors\ 284 \n\tc carbon copy or clone message\ 285 \n\tw wait for a program\t\tr\ 286 raw mode, mail as is\ 287 \n\tW same as 'w', but suppress 'Program failure' messages\n" 288 289 #define MINlinebuf 128 /* minimal LINEBUF length (don't change this) */ 290 #define FROM_EXPR "\nFrom " 291 #define FROM "From " 292 #define SHFROM "From" 293 #define NSUBJECT "^Subject:.*$" 294 #define MAXSUBJECTSHOW 78 295 #define FOLDER " Folder: " 296 #define LENtSTOP 9 /* tab stop at which message length will be logged */ 297 298 #define TABCHAR "\t" 299 #define TABWIDTH 8 300 301 #define RECFLAGS "HBDAahbfcwWiEer" 302 #define HEAD_GREP 0 303 #define BODY_GREP 1 304 #define DISTINGUISH_CASE 2 305 #define ALSO_NEXT_RECIPE 3 306 #define ALSO_N_IF_SUCC 4 307 #define PASS_HEAD 5 308 #define PASS_BODY 6 309 #define FILTER 7 310 #define CONTINUE 8 /* carbon copy */ 311 #define WAIT_EXIT 9 312 #define WAIT_EXIT_QUIET 10 313 #define IGNORE_WRITERR 11 314 #define ELSE_DO 12 315 #define ERROR_DO 13 316 #define RAW_NONL 14 317 318 #define UNIQ_PREFIX '_' /* prepended to temporary unique filenames */ 319 #define ESCAP ">" 320 321 /* some formail-specific configuration options: */ 322 323 #define UNKNOWN "foo@bar" /* formail default originator name */ 324 #define OLD_PREFIX "Old-" /* formail field-Old-prefix */ 325 #define RESENT_ "Resent-" /* -a *this* to reply to Resent headers */ 326 #define BABYL_SEP1 '\037' /* BABYL format separator one */ 327 #define BABYL_SEP2 '\f' /* BABYL format separator two */ 328 #define DEFfileno "FILENO=000" /* split counter for formail */ 329 #define LEN_FILENO_VAR 7 /* =strlen("FILENO=") */ 330 #define CHILD_FACTOR 3/4 /* do not parenthesise; average running children */ 331 332 #define FM_SKIP '+' /* skip the first nnn messages */ 333 #define FM_TOTAL '-' /* only spit out a total of nnn messages */ 334 #define FM_BOGUS 'b' /* leave bogus Froms intact */ 335 #define FM_BERKELEY BERKELEYOPT /* Berkeley format, no Content-Length: */ 336 #define FM_QPREFIX 'p' /* define quotation prefix */ 337 #define FM_CONCATENATE 'c' /* concatenate continued header-fields */ 338 #define FM_ZAPWHITE 'z' /* zap whitespace and empty headers */ 339 #define FM_FORCE 'f' /* force formail to accept an arbitrary format */ 340 #define FM_REPLY 'r' /* generate an auto-reply header */ 341 #define FM_KEEPB 'k' /* keep the header, when replying */ 342 #define FM_TRUST 't' /* reply to the header sender */ 343 #define FM_LOGSUMMARY 'l' /* generate a procmail-compatible log summary */ 344 #define FM_SPLIT 's' /* split it up */ 345 #define FM_NOWAIT 'n' /* don't wait for the programs */ 346 #define FM_EVERY 'e' /* don't require empty lines leading headers */ 347 #define FM_MINFIELDS 'm' /* the number of fields that have to be found */ 348 #define DEFminfields 2 /* before a header is recognised as such */ 349 #define FM_DIGEST 'd' /* split up digests */ 350 #define FM_BABYL 'B' /* split up BABYL format rmail files */ 351 #define FM_QUIET 'q' /* be quiet */ 352 #define FM_DUPLICATE 'D' /* return success on duplicate mails */ 353 #define FM_EXTRACT 'x' /* extract field contents */ 354 #define FM_EXTRC_KEEP 'X' /* extract field */ 355 #define FM_ADD_IFNOT 'a' /* add a field if not already there */ 356 #define FM_ADD_ALWAYS 'A' /* add this field in any case */ 357 #define FM_REN_INSERT 'i' /* rename and insert a field */ 358 #define FM_DEL_INSERT 'I' /* delete and insert a field */ 359 #define FM_FIRST_UNIQ 'u' /* preserve the first occurrence */ 360 #define FM_LAST_UNIQ 'U' /* preserve the last occurrence */ 361 #define FM_ReNAME 'R' /* rename a field */ 362 #define FM_VERSION VERSIONOPT /* option to display version */ 363 #define FM_USAGE "\ 364 Usage: formail [-vbczfrktqY] [-D nnn idcache] [-p prefix] [-l folder]\n\ 365 \t[-xXaAiIuU field] [-R ofield nfield]\n\ 366 Or: formail [+nnn] [-nnn] [-bczfrktedqBY] [-D nnn idcache] [-p prefix]\n\ 367 \t[-n [nnn]] [-m nnn] [-l folder] [-xXaAiIuU field] [-R ofield nfield]\n\ 368 \t-s [prg [arg ...]]\n" /* split up FM_HELP, token too long for some ccs */ 369 #define FM_HELP \ 370 " -v\t\tdisplay the version number and exit\ 371 \n -b\t\tdon't escape bogus mailbox headers\ 372 \n -Y\t\tBerkeley format mailbox, disregard Content-Length:\ 373 \n -c\t\tconcatenate continued header-fields\ 374 \n -z\t\tzap whitespace and empty header-fields\ 375 \n -f\t\tforce formail to pass along any non-mailbox format\ 376 \n -r\t\tgenerate an auto-reply header, preserve fields with -i\ 377 \n -k\t\ton auto-reply keep the body, prevent escaping with -b\ 378 \n -t\t\treply to the header sender instead of the envelope sender\ 379 \n -l folder\tgenerate a procmail-compatible log summary\ 380 \n -D nnn idcache\tdetect duplicates with an idcache of length nnn\ 381 \n -s prg arg\tsplit the mail, startup prg for every message\n" 382 #define FM_HELP2 \ 383 " +nnn\t\tskip the first nnn\t-nnn\toutput at most nnn messages\ 384 \n -n [nnn]\tdon't serialise splits\t-e\tempty lines are optional\ 385 \n -d\t\taccept digest format\t-B\texpect BABYL rmail format\ 386 \n -q\t\tbe quiet\t\t-p prefix\tquotation prefix\ 387 \n -m nnn \tmin fields threshold (default 2) for start of message\ 388 \n -x field\textract contents\t-X field\textract fully\ 389 \n -a field\tadd if not present\t-A field\tadd in any case\ 390 \n -i field\trename and insert\t-I field\tdelete and insert\ 391 \n -u field\tfirst unique\t\t-U field\tlast unique\ 392 \n -R oldfield newfield\trename\n" 393