xref: /netbsd-src/external/ibm-public/postfix/dist/src/global/canon_addr.c (revision 41fbaed053f8fbfdf9d2a4ee0a7386a3c83f8505)
1 /*	$NetBSD: canon_addr.c,v 1.1.1.1 2009/06/23 10:08:45 tron Exp $	*/
2 
3 /*++
4 /* NAME
5 /*	canon_addr 3
6 /* SUMMARY
7 /*	simple address canonicalization
8 /* SYNOPSIS
9 /*	#include <canon_addr.h>
10 /*
11 /*	VSTRING	*canon_addr_external(result, address)
12 /*	VSTRING	*result;
13 /*	const char *address;
14 /*
15 /*	VSTRING	*canon_addr_internal(result, address)
16 /*	VSTRING	*result;
17 /*	const char *address;
18 /* DESCRIPTION
19 /*	This module provides a simple interface to the address
20 /*	canonicalization service that is provided by the address
21 /*	rewriting service.
22 /*
23 /*	canon_addr_external() transforms an address in external (i.e.
24 /*	quoted) RFC822 form to a fully-qualified address (user@domain).
25 /*
26 /*	canon_addr_internal() transforms an address in internal (i.e.
27 /*	unquoted) RFC822 form to a fully-qualified address (user@domain).
28 /* STANDARDS
29 /*	RFC 822 (ARPA Internet Text Messages).
30 /* SEE ALSO
31 /*	rewrite_clnt(3) address rewriting client interface
32 /* LICENSE
33 /* .ad
34 /* .fi
35 /*	The Secure Mailer license must be distributed with this software.
36 /* AUTHOR(S)
37 /*	Wietse Venema
38 /*	IBM T.J. Watson Research
39 /*	P.O. Box 704
40 /*	Yorktown Heights, NY 10598, USA
41 /*--*/
42 
43 /* System library. */
44 
45 #include <sys_defs.h>
46 
47 /* Utility library. */
48 
49 #include <vstring.h>
50 #include <mymalloc.h>
51 
52 /* Global library. */
53 
54 #include "rewrite_clnt.h"
55 #include "canon_addr.h"
56 
57 /* canon_addr_external - make address fully qualified, external form */
58 
canon_addr_external(VSTRING * result,const char * addr)59 VSTRING *canon_addr_external(VSTRING *result, const char *addr)
60 {
61     return (rewrite_clnt(REWRITE_CANON, addr, result));
62 }
63 
64 /* canon_addr_internal - make address fully qualified, internal form */
65 
canon_addr_internal(VSTRING * result,const char * addr)66 VSTRING *canon_addr_internal(VSTRING *result, const char *addr)
67 {
68     return (rewrite_clnt_internal(REWRITE_CANON, addr, result));
69 }
70