ze-filter  (ze-filter-0.8.0-develop-180218)
mlfi_negotiate.c
Go to the documentation of this file.
1 
2 /*
3  *
4  * ze-filter - Mail Server Filter for sendmail
5  *
6  * Copyright (c) 2001-2018 - Jose-Marcio Martins da Cruz
7  *
8  * Auteur : Jose Marcio Martins da Cruz
9  * jose.marcio.mc@gmail.org
10  *
11  * Historique :
12  * Creation : janvier 2002
13  *
14  * This program is free software, but with restricted license :
15  *
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20  *
21  * More details about ze-filter license can be found at ze-filter
22  * web site : http://foss.jose-marcio.org
23  */
24 
25 
26 /* ****************************************************************************
27  * *
28  * *
29  ******************************************************************************/
30 #if HAVE_XXFI_NEGOTIATE
31 static sfsistat
32 mlfi_negotiate(SMFICTX * ctx,
33  unsigned long f0, unsigned long f1,
34  unsigned long f2, unsigned long f3,
35  unsigned long *pf0, unsigned long *pf1,
36  unsigned long *pf2, unsigned long *pf3)
37 {
38  CTXPRIV_T *priv = NULL;
39  sfsistat result = SMFIS_ALL_OPTS;
40 
41  *pf0 = f0;
42  *pf1 = f1;
43  *pf1 = 0;
44 
45 #if 0
46  priv = malloc(sizeof (CTXPRIV_T));
47  if (priv != NULL) {
48  if (smfi_setpriv(ctx, priv) != MI_SUCCESS) {
49  FREE(priv);
50  ZE_LogMsgError(0, "smfi_setpriv(priv) error");
51  (void) jsmfi_setreply(ctx, "421", "4.5.1",
52  "I'm too busy now. Try again later !");
53  result = SMFIS_TEMPFAIL;
54  goto fin;
55  }
56  }
57 #endif
58 
59  /*
60  ** Ask the MTA to send even rejected recipients
61  */
62  if ((f1 & SMFIP_RCPT_REJ) == 0) {
63  static int n = 0;
64 
65  if (n++ < 5)
66  ZE_MessageInfo(10, "MTA unable to send rejected recipients information");
67  } else
68  *pf1 |= SMFIP_RCPT_REJ;
69 #if 0
70  *pf1 |= SMFIP_NR_HDR;
71 #endif
72  *pf2 = 0;
73  *pf3 = 0;
74  if (priv != NULL) {
75  priv->mta_caps.f0 = f0;
76  priv->mta_caps.f1 = f1;
77  priv->mta_caps.f2 = f2;
78  priv->mta_caps.f3 = f3;
79  }
80 
81 fin:
82 #if 1
83  return SMFIS_CONTINUE;
84 #else
85  return SMFIS_ALL_OPTS;
86 #endif
87 }
88 #endif
#define SMFIS_TEMPFAIL
int jsmfi_setreply(SMFICTX *, char *, char *, char *)
Definition: ze-libmilter.c:99
#define FREE(x)
Definition: macros.h:37
MTA_caps_T mta_caps
unsigned long f0
unsigned long f1
unsigned long f2
#define SMFIS_CONTINUE
#define ZE_LogMsgError(level,...)
Definition: zeSyslog.h:113
#define ZE_MessageInfo(level,...)
Definition: zeSyslog.h:90
unsigned long f3