Back to index

courier  0.68.2
dsnstub.c
Go to the documentation of this file.
00001 /*
00002 ** Copyright 1998 - 1999 Double Precision, Inc.
00003 ** See COPYING for distribution information.
00004 */
00005 
00006 #if    HAVE_CONFIG_H
00007 #include      "config.h"
00008 #endif
00009 #include      "courier.h"
00010 #include      "rw.h"
00011 
00012 /*
00013 **     The dsn module is a noop - it is invoked automatically by courier,
00014 **     as needed, to generate DSN messages.  By itself, it does not accept
00015 **     any regular messages for delivery, but since it is initialized just
00016 **     like any other transport module, it must provide a minimum
00017 **     implementation of Courier's plug-in transport module mechanism.
00018 */
00019 
00020 static void rw_dsn(struct rw_info *, void (*)(struct rw_info *));
00021 static void rw_del_dsn(struct rw_info *, void (*)(struct rw_info *),
00022               void (*)(struct rw_info *, const struct rfc822token *,
00023                      const struct rfc822token *));
00024 
00025 static struct rw_transport *local;
00026 
00027 struct rw_list *dsn_rw_install(const struct rw_install_info *p)
00028 {
00029 static struct rw_list dsn_info={0, "module.dsn - " COURIER_COPYRIGHT,
00030                             rw_dsn, rw_del_dsn, 0};
00031 
00032        return (&dsn_info);
00033 }
00034 
00035 const char *dsn_rw_init()
00036 {
00037        local=rw_search_transport("local");
00038        return (0);
00039 }
00040 
00041 static void rw_dsn(struct rw_info *p, void (*func)(struct rw_info *))
00042 {
00043        if (local)
00044        {
00045               (*local->rw_ptr->rewrite)(p, func);
00046               return;
00047        }
00048        (*func)(p);
00049 }
00050 
00051 static void rw_del_dsn(struct rw_info *rwi,
00052                      void (*nextfunc)(struct rw_info *),
00053               void (*delfunc)(struct rw_info *, const struct rfc822token *,
00054                             const struct rfc822token *))
00055 {
00056        delfunc=delfunc;
00057        (*nextfunc)(rwi);
00058 }