--- src/modules/rlm_python/rlm_python.c.orig	2007-03-06 00:45:28.000000000 +1030
+++ src/modules/rlm_python/rlm_python.c	2007-10-10 15:36:51.000000000 +0930
@@ -54,6 +54,7 @@
         char    *mod_authenticate;
         char    *mod_preacct;
         char    *mod_accounting;
+        char    *mod_post_proxy;
         char    *mod_checksimul;
         char    *mod_detach;
 
@@ -63,6 +64,7 @@
         char    *func_authenticate;
         char    *func_preacct;
         char    *func_accounting;
+        char    *func_post_proxy;
         char    *func_checksimul;
         char    *func_detach;
 
@@ -71,6 +73,7 @@
         PyObject *pModule_authenticate;
         PyObject *pModule_preacct;
         PyObject *pModule_accounting;
+        PyObject *pModule_post_proxy;
         PyObject *pModule_checksimul;
         PyObject *pModule_detach;
 
@@ -80,6 +83,7 @@
         PyObject *pFunc_authenticate;
         PyObject *pFunc_preacct;
         PyObject *pFunc_accounting;
+        PyObject *pFunc_post_proxy;
         PyObject *pFunc_checksimul;
         PyObject *pFunc_detach;
 };
@@ -120,6 +124,11 @@
   { "func_accounting",  PW_TYPE_STRING_PTR,
     offsetof(struct rlm_python_t, func_accounting), NULL,  NULL},
 
+  { "mod_post_proxy",  PW_TYPE_STRING_PTR,
+    offsetof(struct rlm_python_t, mod_post_proxy), NULL,  NULL},
+  { "func_post_proxy",  PW_TYPE_STRING_PTR,
+    offsetof(struct rlm_python_t, func_post_proxy), NULL,  NULL},
+
   { "mod_checksimul",  PW_TYPE_STRING_PTR,
     offsetof(struct rlm_python_t, mod_checksimul), NULL,  NULL},
   { "func_checksimul",  PW_TYPE_STRING_PTR,
@@ -490,6 +499,7 @@
         python_objclear(&data->pFunc_authenticate);
         python_objclear(&data->pFunc_preacct);
         python_objclear(&data->pFunc_accounting);
+        python_objclear(&data->pFunc_post_proxy);
         python_objclear(&data->pFunc_checksimul);
         python_objclear(&data->pFunc_detach);
 
@@ -498,6 +508,7 @@
         python_objclear(&data->pModule_authenticate);
         python_objclear(&data->pModule_preacct);
         python_objclear(&data->pModule_accounting);
+        python_objclear(&data->pModule_post_proxy);
         python_objclear(&data->pModule_checksimul);
         python_objclear(&data->pModule_detach);
 }
@@ -566,6 +577,12 @@
                                 &data->pFunc_accounting) < 0)
                 goto failed;
 
+        if (python_load_function(data->mod_post_proxy,
+                                data->func_post_proxy,
+                                &data->pModule_post_proxy,
+                                &data->pFunc_post_proxy) < 0)
+                goto failed;
+
         if (python_load_function(data->mod_checksimul,
                                 data->func_checksimul,
                                 &data->pModule_checksimul,
@@ -633,6 +650,14 @@
 	"accounting");
 }
 
+static int python_post_proxy(void *instance, REQUEST *request)
+{
+    return python_function(
+	request,
+	((struct rlm_python_t *)instance)->pFunc_post_proxy,
+	"post-proxy");
+}
+
 static int python_checksimul(void *instance, REQUEST *request)
 {
     return python_function(
@@ -663,7 +688,7 @@
 		python_accounting,	/* accounting */
 		python_checksimul,	/* checksimul */
 		NULL,			/* pre-proxy */
-		NULL,			/* post-proxy */
+		python_post_proxy,	/* post-proxy */
 		NULL			/* post-auth */
 	},
 	python_detach,			/* detach */
