3 # Copyright (c) 1998-2001 Sendmail, Inc. and its suppliers.
5 # Copyright (c) 1983 Eric P. Allman. All rights reserved.
6 # Copyright (c) 1988, 1993
7 # The Regents of the University of California. All rights reserved.
9 # By using this file, you agree to the terms and conditions set
10 # forth in the LICENSE file which can be found at the top level of
11 # the sendmail distribution.
13 #ident "%Z%%M% %I% %E% SMI"
15 _DEFIFNOT(`_DEF_SMTP_MAILER_FLAGS', `mDFMuX')
16 _DEFIFNOT(`SMTP_MAILER_FLAGS',`')
17 _DEFIFNOT(`RELAY_MAILER_FLAGS', `SMTP_MAILER_FLAGS')
18 ifdef(`SMTP_MAILER_ARGS',, `define(`SMTP_MAILER_ARGS', `TCP $h')')
19 ifdef(`ESMTP_MAILER_ARGS',, `define(`ESMTP_MAILER_ARGS', `TCP $h')')
20 ifdef(`SMTP8_MAILER_ARGS',, `define(`SMTP8_MAILER_ARGS', `TCP $h')')
21 ifdef(`DSMTP_MAILER_ARGS',, `define(`DSMTP_MAILER_ARGS', `TCP $h')')
22 ifdef(`RELAY_MAILER_ARGS',, `define(`RELAY_MAILER_ARGS', `TCP $h')')
23 define(`_SMTP_QGRP', `ifelse(defn(`SMTP_MAILER_QGRP'),`',`', ` Q=SMTP_MAILER_QGRP,')')dnl
24 define(`_ESMTP_QGRP', `ifelse(defn(`ESMTP_MAILER_QGRP'),`',`', ` Q=ESMTP_MAILER_QGRP,')')dnl
25 define(`_SMTP8_QGRP', `ifelse(defn(`SMTP8_MAILER_QGRP'),`',`', ` Q=SMTP8_MAILER_QGRP,')')dnl
26 define(`_DSMTP_QGRP', `ifelse(defn(`DSMTP_MAILER_QGRP'),`',`', ` Q=DSMTP_MAILER_QGRP,')')dnl
27 define(`_RELAY_QGRP', `ifelse(defn(`RELAY_MAILER_QGRP'),`',`', ` Q=RELAY_MAILER_QGRP,')')dnl
29 #####################################
30 ### SMTP Mailer specification ###
31 #####################################
33 VERSIONID(`$Id: smtp.m4,v 8.64 2001/04/03 01:52:54 gshapiro Exp $')
36 # common sender and masquerading recipient rewriting
39 R$* < @ $* > $* $@ $1 < @ $2 > $3 already fully qualified
40 R$+ $@ $1 < @ *LOCAL* > add local qualification
43 # convert pseudo-domain addresses to real domain addresses
47 # pass <route-addr>s through
48 R< @ $+ > $* $@ < @ $1 > $2 resolve <route-addr>
50 # output fake domains as user%fake@relay
52 `R$+ <@ $+ .BITNET. > $: $1 % $2 .BITNET < @ $B > user@host.BITNET
53 R$+.BITNET <@ $~[ $*:$+ > $: $1 .BITNET < @ $4 > strip mailer: part',
55 ifdef(`_NO_UUCP_', `dnl', `
56 # do UUCP heuristics; note that these are shared with UUCP mailers
57 R$+ < @ $+ .UUCP. > $: < $2 ! > $1 convert to UUCP form
58 R$+ < @ $* > $* $@ $1 < @ $2 > $3 not UUCP form
60 # leave these in .UUCP form to avoid further tampering
61 R< $&h ! > $- ! $+ $@ $2 < @ $1 .UUCP. >
62 R< $&h ! > $-.$+ ! $+ $@ $3 < @ $1.$2 >
63 R< $&h ! > $+ $@ $1 < @ $&h .UUCP. >
64 R< $+ ! > $+ $: $1 ! $2 < @ $Y > use UUCP_RELAY
65 R$+ < @ $~[ $* : $+ > $@ $1 < @ $4 > strip mailer: part
66 R$+ < @ > $: $1 < @ *LOCAL* > if no UUCP_RELAY')
70 # envelope sender rewriting
73 R$+ $: $>PseudoToReal $1 sender/recipient common
74 R$* :; <@> $@ list:; special case
75 R$* $: $>MasqSMTP $1 qualify unqual'ed names
76 R$+ $: $>MasqEnv $1 do masquerading
80 # envelope recipient rewriting --
81 # also header recipient if not masquerading recipients
84 R$+ $: $>PseudoToReal $1 sender/recipient common
85 R$+ $: $>MasqSMTP $1 qualify unqual'ed names
86 R$* < @ *LOCAL* > $* $: $1 < @ $j . > $2
89 # header sender and masquerading header recipient rewriting
92 R$+ $: $>PseudoToReal $1 sender/recipient common
93 R:; <@> $@ list:; special case
95 # do special header rewriting
96 R$* <@> $* $@ $1 <@> $2 pass null host through
97 R< @ $* > $* $@ < @ $1 > $2 pass route-addr through
98 R$* $: $>MasqSMTP $1 qualify unqual'ed names
99 R$+ $: $>MasqHdr $1 do masquerading
103 # relay mailer header masquerading recipient rewriting
109 Msmtp, P=[IPC], F=_MODMF_(CONCAT(_DEF_SMTP_MAILER_FLAGS, SMTP_MAILER_FLAGS), `SMTP'), S=EnvFromSMTP/HdrFromSMTP, R=ifdef(`_ALL_MASQUERADE_', `EnvToSMTP/HdrFromSMTP', `EnvToSMTP'), E=\r\n, L=990,
110 _OPTINS(`SMTP_MAILER_MAX', `M=', `, ')_OPTINS(`SMTP_MAILER_MAXMSGS', `m=', `, ')_OPTINS(`SMTP_MAILER_MAXRCPTS', `r=', `, ')_OPTINS(`SMTP_MAILER_CHARSET', `C=', `, ')T=DNS/RFC822/SMTP,_SMTP_QGRP
112 Mesmtp, P=[IPC], F=_MODMF_(CONCAT(_DEF_SMTP_MAILER_FLAGS, `a', SMTP_MAILER_FLAGS), `ESMTP'), S=EnvFromSMTP/HdrFromSMTP, R=ifdef(`_ALL_MASQUERADE_', `EnvToSMTP/HdrFromSMTP', `EnvToSMTP'), E=\r\n, L=990,
113 _OPTINS(`SMTP_MAILER_MAX', `M=', `, ')_OPTINS(`SMTP_MAILER_MAXMSGS', `m=', `, ')_OPTINS(`SMTP_MAILER_MAXRCPTS', `r=', `, ')_OPTINS(`SMTP_MAILER_CHARSET', `C=', `, ')T=DNS/RFC822/SMTP,_ESMTP_QGRP
115 Msmtp8, P=[IPC], F=_MODMF_(CONCAT(_DEF_SMTP_MAILER_FLAGS, `8', SMTP_MAILER_FLAGS), `SMTP8'), S=EnvFromSMTP/HdrFromSMTP, R=ifdef(`_ALL_MASQUERADE_', `EnvToSMTP/HdrFromSMTP', `EnvToSMTP'), E=\r\n, L=990,
116 _OPTINS(`SMTP_MAILER_MAX', `M=', `, ')_OPTINS(`SMTP_MAILER_MAXMSGS', `m=', `, ')_OPTINS(`SMTP_MAILER_MAXRCPTS', `r=', `, ')_OPTINS(`SMTP_MAILER_CHARSET', `C=', `, ')T=DNS/RFC822/SMTP,_SMTP8_QGRP
118 Mdsmtp, P=[IPC], F=_MODMF_(CONCAT(_DEF_SMTP_MAILER_FLAGS, `a%', SMTP_MAILER_FLAGS), `DSMTP'), S=EnvFromSMTP/HdrFromSMTP, R=ifdef(`_ALL_MASQUERADE_', `EnvToSMTP/HdrFromSMTP', `EnvToSMTP'), E=\r\n, L=990,
119 _OPTINS(`SMTP_MAILER_MAX', `M=', `, ')_OPTINS(`SMTP_MAILER_MAXMSGS', `m=', `, ')_OPTINS(`SMTP_MAILER_MAXRCPTS', `r=', `, ')_OPTINS(`SMTP_MAILER_CHARSET', `C=', `, ')T=DNS/RFC822/SMTP,_DSMTP_QGRP
121 Mrelay, P=[IPC], F=_MODMF_(CONCAT(_DEF_SMTP_MAILER_FLAGS, `a8', RELAY_MAILER_FLAGS), `RELAY'), S=EnvFromSMTP/HdrFromSMTP, R=ifdef(`_ALL_MASQUERADE_', `MasqSMTP/MasqRelay', `MasqSMTP'), E=\r\n, L=2040,
122 _OPTINS(`RELAY_MAILER_CHARSET', `C=', `, ')_OPTINS(`RELAY_MAILER_MAXMSGS', `m=', `, ')_OPTINS(`SMTP_MAILER_MAXRCPTS', `r=', `, ')T=DNS/RFC822/SMTP,_RELAY_QGRP