ze-filter  (ze-filter-0.8.0-develop-180218)
mlfi_abort.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 sfsistat
32  SMFICTX *ctx;
33 
34 {
35  CTXPRIV_T *priv = MLFIPRIV(ctx);
36  sfsistat result = SMFIS_CONTINUE;
37 
40  if (priv == NULL)
41  goto fin;
43  sm_macro_update(ctx, priv->sm);
44  priv->nb_abort++;
45 #if _FFR_MODULES
46  /*
47  ** ze-filter modules
48  **
49  */
50  if (do_module_callback(ctx, 0, &result))
51  goto fin;
52  if (result != SMFIS_CONTINUE)
53  goto fin;
54 #endif /* _FFR_MODULES */
55  if (priv->rej_greyrcpt > 0) {
56  priv->rej_greymsgs++;
58  }
59 
60  {
61  int n;
62 
63  if ((n = update_nb_badrcpts(ctx)) > 0)
64  ZE_MessageInfo(19, "%s : BAD RECIPIENTS : %d", CONNID_STR(priv->id), n);
65  priv->nb_mbadrcpt = 0;
66  priv->nb_cbadrcpt += n;
67  ZE_MessageInfo(19, "mlfi_abort : bad = %d", n);
68  }
69 
70  result = mlfi_cleanup(ctx, FALSE);
71 fin:
73  return result;
74 }
void stats_inc(int, long)
Definition: ze-stats.c:401
sfsistat mlfi_cleanup(SMFICTX *ctx, bool ok)
Definition: mlfi_cleanup.c:31
#define FALSE
Definition: macros.h:160
#define SMFIS_CONTINUE
#define STAT_GREY_MSGS
Definition: ze-stats.h:80
#define MLFIPRIV(ctx)
#define INIT_CALLBACK(p, which)
Definition: ze-filter.c:125
sfsistat mlfi_abort(SMFICTX *ctx)
Definition: mlfi_abort.c:31
void sm_macro_update(SMFICTX *, sm_mac_T *)
Definition: ze-smmacros.c:150
CONNID_T id
#define INIT_CALLBACK_DELAY()
Definition: ze-filter.c:135
#define ZE_MessageInfo(level,...)
Definition: zeSyslog.h:90
#define CALLBACK_ABORT
Definition: ze-callback.h:37
bool do_module_callback(SMFICTX *ctx, int step, int *result)
Definition: ze-mod-tools.c:84
sm_mac_T * sm
#define CONNID_STR(connid)
Definition: ze-filter.h:113
#define CHECK_CALLBACK_DELAY()
Definition: ze-filter.c:146
int update_nb_badrcpts(SMFICTX *)
#define STAT_ABORT
Definition: ze-stats.h:30