{ |
|
|
"SampleFilter", /* | filter name */ | |
SMFI_VERSION, | /* | version code |
SMFIF_ADDHDRS, | /* | flags */ |
NULL, | /* | connection info filter */ |
NULL, | /* | SMTP HELO command filter */ |
mlfi_envfrom, | /* | envelope sender filter */ |
NULL, | /* | envelope recipient filter */ |
mlfi_header, | /* | header filter */ |
mlfi_eoh, | /* | end of header */ |
mlfi_body, | /* | body block filter */ |
mlfi_eom, | /* | end of message */ |
mlfi_abort, | /* | message aborted */ |
mlfi_close | /* | connection cleanup */ |
}; |
|
|
int |
|
|
main(argc, argv) |
|
|
int argc; |
|
|
char *argv[]; |
|
|
{ |
|
|
bool setconn = false; int c;
const char *args = "p:";
/* Process command line options */
while ((c = getopt(argc, argv, args)) !=
{
switch (c)
{
case 'p':
if (optarg == NULL *optarg == '\0')
{
(void) fprintf(stderr,"Illegal conn: %s\n", optarg);
exit(EX_USAGE);
}
(void) smfi_setconn(optarg); setconn = true;
break;
}
}
if (!setconn)
{
fprintf(stderr, "%s: Missing required
}
if (smfi_register(smfilter)== MI_FAILURE)
{
fprintf(stderr, "smfi_register failed\n"); exit(EX_UNAVAILABLE);
}
return smfi_main();
}
/* eof */
*** example taken from the sendmail.org documentation*******