Back to index

courier  0.68.2
comdsn.c
Go to the documentation of this file.
00001 /*
00002 ** Copyright 1998 - 2000 Double Precision, Inc.
00003 ** See COPYING for distribution information.
00004 */
00005 
00006 #include      "courier.h"
00007 #include      <stdlib.h>
00008 #include      <string.h>
00009 
00010 char *config_dsnfrom()
00011 {
00012 char   *f=config_localfilename("dsnfrom");
00013 char   *p=config_read1l(f);
00014 static const char defaultdsnfrom[]="\"Courier mail server at %s\" <@>";
00015 
00016        free(f);
00017        if (!p)
00018        {
00019        const char *me=config_me();
00020 
00021               p=courier_malloc(sizeof(defaultdsnfrom)+strlen(me));
00022               sprintf(p, defaultdsnfrom, me);
00023        }
00024        return (p);
00025 }
00026 
00027 size_t config_dsnlimit()
00028 {
00029 char   *f=config_localfilename("dsnlimit");
00030 char   *p=config_read1l(f);
00031 size_t l=32768;
00032 
00033        if (p)
00034        {
00035               l=atol(p);
00036               free(p);
00037        }
00038        return (l);
00039 }