README (73188) | README (77349) |
---|---|
1This directory contains the source files for libmilter. 2 3The sendmail Mail Filter API (Milter) is designed to allow third-party 4programs access to mail messages as they are being processed in order to 5filter meta-information and content. 6 7This README file describes the steps needed to compile and run a filter, 8through reference to a sample filter which is attached at the end of this 9file. It is necessary to first build libmilter.a, which can be done by 10issuing the './Build' command in SRCDIR/libmilter . 11 12NOTE: Both libmilter and the callouts in sendmail are marked as an FFR (For | 1This directory contains the source files for libmilter. 2 3The sendmail Mail Filter API (Milter) is designed to allow third-party 4programs access to mail messages as they are being processed in order to 5filter meta-information and content. 6 7This README file describes the steps needed to compile and run a filter, 8through reference to a sample filter which is attached at the end of this 9file. It is necessary to first build libmilter.a, which can be done by 10issuing the './Build' command in SRCDIR/libmilter . 11 12NOTE: Both libmilter and the callouts in sendmail are marked as an FFR (For |
13Future Release). If you intend to use them in 8.10.X, you must compiled | 13Future Release). If you intend to use them in 8.11.X, you must compiled |
14both libmilter and sendmail with -D_FFR_MILTER defined. You can do this by 15adding the following to your devtools/Site/site.config.m4 file: 16 17 dnl Milter 18 APPENDDEF(`conf_sendmail_ENVDEF', `-D_FFR_MILTER=1') 19 APPENDDEF(`conf_libmilter_ENVDEF', `-D_FFR_MILTER=1') 20 21You will also need to define _FFR_MILTER when building your .cf file using --- 70 unchanged lines hidden (view full) --- 92Note the separator between each is a ';' as a ',' already separates equates 93and therefore can't separate timeouts. The default values (if not set in the config) are: 94 95T=S:10s;R:10s;E:5m 96 97where 's' is seconds and 'm' is minutes. 98 99Which filters are invoked and their sequencing is handled by the | 14both libmilter and sendmail with -D_FFR_MILTER defined. You can do this by 15adding the following to your devtools/Site/site.config.m4 file: 16 17 dnl Milter 18 APPENDDEF(`conf_sendmail_ENVDEF', `-D_FFR_MILTER=1') 19 APPENDDEF(`conf_libmilter_ENVDEF', `-D_FFR_MILTER=1') 20 21You will also need to define _FFR_MILTER when building your .cf file using --- 70 unchanged lines hidden (view full) --- 92Note the separator between each is a ';' as a ',' already separates equates 93and therefore can't separate timeouts. The default values (if not set in the config) are: 94 95T=S:10s;R:10s;E:5m 96 97where 's' is seconds and 'm' is minutes. 98 99Which filters are invoked and their sequencing is handled by the |
100InputMailFilters option. | 100InputMailFilters option. Note: if InputMailFilters is not defined no filters 101will be used. |
101 102 O InputMailFilters=filter1, filter2, filter3 103 104This is is set automatically according to the order of the 105INPUT_MAIL_FILTER commands in your .mc file. Alternatively, you can 106reset its value by setting confINPUT_MAIL_FILTERS in your .mc file. 107This options causes the three filters to be called in the same order 108they were specified. It allows for possible future filtering on output --- 109 unchanged lines hidden (view full) --- 218extern sfsistat mlfi_cleanup(SMFICTX *, bool); 219 220sfsistat 221mlfi_envfrom(ctx, envfrom) 222 SMFICTX *ctx; 223 char **envfrom; 224{ 225 struct mlfiPriv *priv; | 102 103 O InputMailFilters=filter1, filter2, filter3 104 105This is is set automatically according to the order of the 106INPUT_MAIL_FILTER commands in your .mc file. Alternatively, you can 107reset its value by setting confINPUT_MAIL_FILTERS in your .mc file. 108This options causes the three filters to be called in the same order 109they were specified. It allows for possible future filtering on output --- 109 unchanged lines hidden (view full) --- 219extern sfsistat mlfi_cleanup(SMFICTX *, bool); 220 221sfsistat 222mlfi_envfrom(ctx, envfrom) 223 SMFICTX *ctx; 224 char **envfrom; 225{ 226 struct mlfiPriv *priv; |
226 int fd; | 227 int fd = -1; |
227 228 /* allocate some private memory */ 229 priv = malloc(sizeof *priv); 230 if (priv == NULL) 231 { 232 /* can't accept this message right now */ 233 return SMFIS_TEMPFAIL; 234 } --- 4 unchanged lines hidden (view full) --- 239 if (priv->mlfi_fname == NULL) 240 { 241 free(priv); 242 return SMFIS_TEMPFAIL; 243 } 244 if ((fd = mkstemp(priv->mlfi_fname)) < 0 || 245 (priv->mlfi_fp = fdopen(fd, "w+")) == NULL) 246 { | 228 229 /* allocate some private memory */ 230 priv = malloc(sizeof *priv); 231 if (priv == NULL) 232 { 233 /* can't accept this message right now */ 234 return SMFIS_TEMPFAIL; 235 } --- 4 unchanged lines hidden (view full) --- 240 if (priv->mlfi_fname == NULL) 241 { 242 free(priv); 243 return SMFIS_TEMPFAIL; 244 } 245 if ((fd = mkstemp(priv->mlfi_fname)) < 0 || 246 (priv->mlfi_fp = fdopen(fd, "w+")) == NULL) 247 { |
248 if (fd >= 0) 249 (void) close(fd); |
|
247 free(priv->mlfi_fname); 248 free(priv); 249 return SMFIS_TEMPFAIL; 250 } 251 252 /* save the private data */ 253 smfi_setpriv(ctx, priv); 254 --- 161 unchanged lines hidden (view full) --- 416 fprintf(stderr, "smfi_register failed\n"); 417 exit(EX_UNAVAILABLE); 418 } 419 return smfi_main(); 420} 421 422/* eof */ 423 | 250 free(priv->mlfi_fname); 251 free(priv); 252 return SMFIS_TEMPFAIL; 253 } 254 255 /* save the private data */ 256 smfi_setpriv(ctx, priv); 257 --- 161 unchanged lines hidden (view full) --- 419 fprintf(stderr, "smfi_register failed\n"); 420 exit(EX_UNAVAILABLE); 421 } 422 return smfi_main(); 423} 424 425/* eof */ 426 |
424$Revision: 8.9.2.1.2.14 $, Last updated $Date: 2001/02/21 23:08:19 $ | 427$Revision: 8.9.2.1.2.17 $, Last updated $Date: 2001/04/11 18:32:58 $ |