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