Mercurial > dnsbl
comparison src/dnsbl.cpp @ 5:793ac9cc114d stable-1-0
updates to use dcc conf files
author | carl |
---|---|
date | Wed, 21 Apr 2004 16:09:07 -0700 |
parents | 15a7e942adec |
children | dbe18921f741 |
comparison
equal
deleted
inserted
replaced
4:15a7e942adec | 5:793ac9cc114d |
---|---|
493 } | 493 } |
494 | 494 |
495 | 495 |
496 static void dumpit(CONFIG &dc); | 496 static void dumpit(CONFIG &dc); |
497 static void dumpit(CONFIG &dc) { | 497 static void dumpit(CONFIG &dc) { |
498 dumpit(dc.env_from); | |
499 dumpit("envelope to (dnsbl list)", dc.env_to_dnsbll); | |
500 dumpit("envelope to (from map)", dc.env_to_chkfrom); | |
498 fprintf(stderr, "\ndnsbls\n"); | 501 fprintf(stderr, "\ndnsbls\n"); |
499 for (dnsblp_map::iterator i=dc.dnsbls.begin(); i!=dc.dnsbls.end(); i++) { | 502 for (dnsblp_map::iterator i=dc.dnsbls.begin(); i!=dc.dnsbls.end(); i++) { |
500 fprintf(stderr, "%s %s %s\n", (*i).first, (*i).second->suffix, (*i).second->message); | 503 fprintf(stderr, "%s %s %s\n", (*i).first, (*i).second->suffix, (*i).second->message); |
501 } | 504 } |
502 fprintf(stderr, "\ndnsbl_lists\n"); | 505 fprintf(stderr, "\ndnsbl_lists\n"); |
856 default: | 859 default: |
857 usage(argv[0]); | 860 usage(argv[0]); |
858 exit(EX_USAGE); | 861 exit(EX_USAGE); |
859 } | 862 } |
860 } | 863 } |
864 | |
865 if (check) { | |
866 CONFIG &dc = *new_conf(); | |
867 dumpit(dc); | |
868 return 0; | |
869 } | |
870 | |
861 if (!setconn) { | 871 if (!setconn) { |
862 fprintf(stderr, "%s: Missing required -p argument\n", argv[0]); | 872 fprintf(stderr, "%s: Missing required -p argument\n", argv[0]); |
863 usage(argv[0]); | 873 usage(argv[0]); |
864 exit(EX_USAGE); | 874 exit(EX_USAGE); |
865 } | 875 } |
876 | |
866 if (smfi_register(smfilter) == MI_FAILURE) { | 877 if (smfi_register(smfilter) == MI_FAILURE) { |
867 fprintf(stderr, "smfi_register failed\n"); | 878 fprintf(stderr, "smfi_register failed\n"); |
868 exit(EX_UNAVAILABLE); | 879 exit(EX_UNAVAILABLE); |
869 } | |
870 | |
871 if (check) { | |
872 CONFIG &dc = *new_conf(); | |
873 dumpit(dc.env_from); | |
874 dumpit("envelope to (dnsbl list)", dc.env_to_dnsbll); | |
875 dumpit("envelope to (from map)", dc.env_to_chkfrom); | |
876 dumpit(dc); | |
877 return 0; | |
878 } | 880 } |
879 | 881 |
880 // switch to background mode | 882 // switch to background mode |
881 if (daemon(1,0) < 0) { | 883 if (daemon(1,0) < 0) { |
882 fprintf(stderr, "daemon() call failed\n"); | 884 fprintf(stderr, "daemon() call failed\n"); |