xref: /netbsd-src/external/ibm-public/postfix/dist/src/global/mail_addr.c (revision 41fbaed053f8fbfdf9d2a4ee0a7386a3c83f8505)
1 /*	$NetBSD: mail_addr.c,v 1.1.1.1 2009/06/23 10:08:46 tron Exp $	*/
2 
3 /*++
4 /* NAME
5 /*	mail_addr 3
6 /* SUMMARY
7 /*	pre-defined mail addresses
8 /* SYNOPSIS
9 /*	#include <mail_addr.h>
10 /*
11 /*	const char *mail_addr_double_bounce()
12 /*
13 /*	const char *mail_addr_postmaster()
14 /*
15 /*	const char *mail_addr_mail_daemon()
16 /* DESCRIPTION
17 /*	This module predefines the following addresses:
18 /* .IP MAIL_ADDR_POSTMASTER
19 /*	The postmaster handle. Typically used for sending mail to.
20 /* .IP MAIL_ADDR_MAIL_DAEMON
21 /*	The mailer-daemon handle. Typically used to bring bad news.
22 /* .IP MAIL_ADDR_EMPTY
23 /*	The empty mail address. This refers to the postmaster on the
24 /*	local machine.
25 /* .PP
26 /*	mail_addr_double_bounce() produces the fully-qualified version
27 /*	of the local double bounce address.
28 /*
29 /*	mail_addr_postmaster() produces the fully-qualified version
30 /*	of the local postmaster address.
31 /*
32 /*	mail_addr_mail_daemon() produces the fully-qualified version
33 /*	of the local mailer-daemon address.
34 /* CONFIGURATION PARAMETERS
35 /*	double_bounce_sender, the double bounce pseudo account.
36 /*	myhostname, the local machine hostname.
37 /* BUGS
38 /*	Addresses are constructed by string concatenation, instead of
39 /*	passing them to the rewriting service.
40 /* LICENSE
41 /* .ad
42 /* .fi
43 /*	The Secure Mailer license must be distributed with this software.
44 /* AUTHOR(S)
45 /*	Wietse Venema
46 /*	IBM T.J. Watson Research
47 /*	P.O. Box 704
48 /*	Yorktown Heights, NY 10598, USA
49 /*--*/
50 
51 /* System library. */
52 
53 #include <sys_defs.h>
54 
55 /* Utility library. */
56 
57 #include <stringops.h>
58 
59 /* Global library. */
60 
61 #include "mail_params.h"
62 #include "mail_addr.h"
63 
64 /* mail_addr_double_bounce - construct the local double-bounce address */
65 
mail_addr_double_bounce(void)66 const char *mail_addr_double_bounce(void)
67 {
68     static char *addr;
69 
70     if (addr == 0)
71 	addr = concatenate(var_double_bounce_sender, "@",
72 			   var_myhostname, (char *) 0);
73     return (addr);
74 }
75 
76 /* mail_addr_postmaster - construct the local postmaster address */
77 
mail_addr_postmaster(void)78 const char *mail_addr_postmaster(void)
79 {
80     static char *addr;
81 
82     if (addr == 0)
83 	addr = concatenate(MAIL_ADDR_POSTMASTER, "@",
84 			   var_myhostname, (char *) 0);
85     return (addr);
86 }
87 
88 /* mail_addr_mail_daemon - construct the local mailer-daemon address */
89 
mail_addr_mail_daemon(void)90 const char *mail_addr_mail_daemon(void)
91 {
92     static char *addr;
93 
94     if (addr == 0)
95 	addr = concatenate(MAIL_ADDR_MAIL_DAEMON, "@",
96 			   var_myhostname, (char *) 0);
97     return (addr);
98 }
99