Allow ACCEPT as an exception policy.
This commit is contained in:
@@ -135,8 +135,6 @@ http://www.bmsi.com/linux/sendmail-rh72.spec
|
|||||||
IPv6 Notes
|
IPv6 Notes
|
||||||
----------
|
----------
|
||||||
|
|
||||||
IPv6 is still experimental.
|
|
||||||
|
|
||||||
The IPv6 protocol is supported if your operation system supports it
|
The IPv6 protocol is supported if your operation system supports it
|
||||||
and if sendmail was compiled with IPv6 support. To determine if your
|
and if sendmail was compiled with IPv6 support. To determine if your
|
||||||
sendmail supports IPv6, run "sendmail -d0" and check for the NETINET6
|
sendmail supports IPv6, run "sendmail -d0" and check for the NETINET6
|
||||||
|
|||||||
@@ -59,6 +59,7 @@ class milterContext(object):
|
|||||||
# M_CONNECT, M_HELO, M_ENVFROM, M_ENVRCPT, M_DATA, M_EOM, M_EOH.
|
# M_CONNECT, M_HELO, M_ENVFROM, M_ENVRCPT, M_DATA, M_EOM, M_EOH.
|
||||||
# Calls <a href="https://www.milter.org/developers/api/smfi_setsymlist">smfi_setsymlist</a>.
|
# Calls <a href="https://www.milter.org/developers/api/smfi_setsymlist">smfi_setsymlist</a>.
|
||||||
# @param stage protocol stage in which the macro list should be used
|
# @param stage protocol stage in which the macro list should be used
|
||||||
|
# @param macrolist a space separated list of macro names
|
||||||
def setsymlist(self,stage,macrolist): pass
|
def setsymlist(self,stage,macrolist): pass
|
||||||
|
|
||||||
class error(Exception): pass
|
class error(Exception): pass
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
web:
|
web:
|
||||||
doxygen
|
doxygen
|
||||||
|
cd doc/html; zip -r ../../doc .
|
||||||
rsync -ravK doc/html/ spidey2.bmsi.com:/Public/pymilter
|
rsync -ravK doc/html/ spidey2.bmsi.com:/Public/pymilter
|
||||||
|
|
||||||
VERSION=0.9.8
|
VERSION=0.9.8
|
||||||
|
|||||||
+10
-3
@@ -35,6 +35,9 @@ $ python setup.py help
|
|||||||
libraries=["milter","smutil","resolv"]
|
libraries=["milter","smutil","resolv"]
|
||||||
|
|
||||||
* $Log$
|
* $Log$
|
||||||
|
* Revision 1.35 2013/03/14 22:11:25 customdesigned
|
||||||
|
* Release 0.9.8
|
||||||
|
*
|
||||||
* Revision 1.34 2013/03/09 05:42:14 customdesigned
|
* Revision 1.34 2013/03/09 05:42:14 customdesigned
|
||||||
* Make TestBase members private, fix getsymlist misspelling.
|
* Make TestBase members private, fix getsymlist misspelling.
|
||||||
*
|
*
|
||||||
@@ -641,7 +644,8 @@ milter_set_exception_policy(PyObject *self, PyObject *args) {
|
|||||||
if (!PyArg_ParseTuple(args, "i:set_exception_policy", &i))
|
if (!PyArg_ParseTuple(args, "i:set_exception_policy", &i))
|
||||||
return NULL;
|
return NULL;
|
||||||
switch (i) {
|
switch (i) {
|
||||||
case SMFIS_REJECT: case SMFIS_TEMPFAIL: case SMFIS_CONTINUE:
|
case SMFIS_REJECT: case SMFIS_TEMPFAIL:
|
||||||
|
case SMFIS_CONTINUE: case SMFIS_ACCEPT:
|
||||||
exception_policy = i;
|
exception_policy = i;
|
||||||
Py_INCREF(Py_None);
|
Py_INCREF(Py_None);
|
||||||
return Py_None;
|
return Py_None;
|
||||||
@@ -661,9 +665,9 @@ _release_thread(PyThreadState *t) {
|
|||||||
The interpreter is locked when we are called, and we unlock it. */
|
The interpreter is locked when we are called, and we unlock it. */
|
||||||
static int _report_exception(milter_ContextObject *self) {
|
static int _report_exception(milter_ContextObject *self) {
|
||||||
char untrapped_msg[80];
|
char untrapped_msg[80];
|
||||||
|
if (PyErr_Occurred()) {
|
||||||
sprintf(untrapped_msg,"pymilter: untrapped exception in %.40s",
|
sprintf(untrapped_msg,"pymilter: untrapped exception in %.40s",
|
||||||
description.xxfi_name);
|
description.xxfi_name);
|
||||||
if (PyErr_Occurred()) {
|
|
||||||
PyErr_Print();
|
PyErr_Print();
|
||||||
PyErr_Clear(); /* must clear since not returning to python */
|
PyErr_Clear(); /* must clear since not returning to python */
|
||||||
_release_thread(self->t);
|
_release_thread(self->t);
|
||||||
@@ -675,8 +679,11 @@ static int _report_exception(milter_ContextObject *self) {
|
|||||||
smfi_setreply(self->ctx, "451", "4.3.0", untrapped_msg);
|
smfi_setreply(self->ctx, "451", "4.3.0", untrapped_msg);
|
||||||
return SMFIS_TEMPFAIL;
|
return SMFIS_TEMPFAIL;
|
||||||
}
|
}
|
||||||
return SMFIS_CONTINUE;
|
return exception_policy;
|
||||||
}
|
}
|
||||||
|
/* This should never happen, _report_exception is only called when
|
||||||
|
* the caller has already detected a python exception. If it
|
||||||
|
* does somehow happen, pretend nothing is wrong... */
|
||||||
_release_thread(self->t);
|
_release_thread(self->t);
|
||||||
return SMFIS_CONTINUE;
|
return SMFIS_CONTINUE;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user