1 /* $Id: spf.h,v 1.14 2007/11/06 11:39:33 manu Exp $ */ 2 3 /* 4 * Copyright (c) 2004 Emmanuel Dreyfus 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions 9 * are met: 10 * 1. Redistributions of source code must retain the above copyright 11 * notice, this list of conditions and the following disclaimer. 12 * 2. Redistributions in binary form must reproduce the above copyright 13 * notice, this list of conditions and the following disclaimer in the 14 * documentation and/or other materials provided with the distribution. 15 * 3. All advertising materials mentioning features or use of this software 16 * must display the following acknowledgement: 17 * This product includes software developed by Emmanuel Dreyfus 18 * 19 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED 20 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 21 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 22 * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, 23 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 24 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 27 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 29 * OF THE POSSIBILITY OF SUCH DAMAGE. 30 */ 31 32 #ifndef _SPF_H_ 33 #define _SPF_H_ 34 35 #include "config.h" 36 37 #include <sys/types.h> 38 #include <sys/socket.h> 39 #include <arpa/inet.h> 40 #include <netinet/in.h> 41 42 enum spf_status { 43 MGSPF_PASS, 44 MGSPF_FAIL, 45 MGSPF_SOFTFAIL, 46 MGSPF_NEUTRAL, 47 MGSPF_UNKNOWN, 48 MGSPF_ERROR, 49 MGSPF_NONE, 50 MGSPF_SELF, 51 }; 52 53 #include "acl.h" 54 55 #if (defined(HAVE_SPF) || defined(HAVE_SPF_ALT) || \ 56 defined(HAVE_SPF2_10) || defined(HAVE_SPF2)) 57 char *acl_print_spf(acl_data_t *, char *, size_t); 58 void acl_add_spf(acl_data_t *, void *); 59 int spf_check(acl_data_t *, acl_stage_t, 60 struct acl_param *, struct mlfi_priv *); 61 #define SPF_CHECK(priv) spf_check(NULL, AS_RCPT, NULL, (priv)) 62 #else 63 #define SPF_CHECK(priv) 0 64 #endif 65 66 67 #endif /* _SPH_H_ */ 68