1PUSHDIVERT(-1) 2# 3# Copyright (c) 1998-2000 Sendmail, Inc. and its suppliers. 4# All rights reserved. 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. 8# 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. 12# 13# 14_DEFIFNOT(`_DEF_SMTP_MAILER_FLAGS', `mDFMuX') 15_DEFIFNOT(`SMTP_MAILER_FLAGS',`') 16_DEFIFNOT(`RELAY_MAILER_FLAGS', `SMTP_MAILER_FLAGS') 17ifdef(`SMTP_MAILER_ARGS',, `define(`SMTP_MAILER_ARGS', `TCP $h')') 18ifdef(`ESMTP_MAILER_ARGS',, `define(`ESMTP_MAILER_ARGS', `TCP $h')') 19ifdef(`SMTP8_MAILER_ARGS',, `define(`SMTP8_MAILER_ARGS', `TCP $h')') 20ifdef(`DSMTP_MAILER_ARGS',, `define(`DSMTP_MAILER_ARGS', `TCP $h')') 21ifdef(`RELAY_MAILER_ARGS',, `define(`RELAY_MAILER_ARGS', `TCP $h')') 22POPDIVERT 23##################################### 24### SMTP Mailer specification ### 25##################################### 26 27VERSIONID(`$Id: smtp.m4,v 8.56.2.1.2.3 2000/09/25 13:53:27 ca Exp $') 28 29# 30# common sender and masquerading recipient rewriting 31# 32SMasqSMTP=61 33R$* < @ $* > $* $@ $1 < @ $2 > $3 already fully qualified 34R$+ $@ $1 < @ *LOCAL* > add local qualification 35 36# 37# convert pseudo-domain addresses to real domain addresses 38# 39SPseudoToReal=51 40 41# pass <route-addr>s through 42R< @ $+ > $* $@ < @ $1 > $2 resolve <route-addr> 43 44# output fake domains as user%fake@relay 45ifdef(`BITNET_RELAY', 46`R$+ <@ $+ .BITNET. > $: $1 % $2 .BITNET < @ $B > user@host.BITNET 47R$+.BITNET <@ $+:$+ > $: $1 .BITNET < @ $3 > strip mailer: part', 48 `dnl') 49ifdef(`_NO_UUCP_', `dnl', ` 50# do UUCP heuristics; note that these are shared with UUCP mailers 51R$+ < @ $+ .UUCP. > $: < $2 ! > $1 convert to UUCP form 52R$+ < @ $* > $* $@ $1 < @ $2 > $3 not UUCP form 53 54# leave these in .UUCP form to avoid further tampering 55R< $&h ! > $- ! $+ $@ $2 < @ $1 .UUCP. > 56R< $&h ! > $-.$+ ! $+ $@ $3 < @ $1.$2 > 57R< $&h ! > $+ $@ $1 < @ $&h .UUCP. > 58R< $+ ! > $+ $: $1 ! $2 < @ $Y > use UUCP_RELAY 59R$+ < @ $+ : $+ > $@ $1 < @ $3 > strip mailer: part 60R$+ < @ > $: $1 < @ *LOCAL* > if no UUCP_RELAY') 61 62 63# 64# envelope sender rewriting 65# 66SEnvFromSMTP=11 67R$+ $: $>PseudoToReal $1 sender/recipient common 68R$* :; <@> $@ list:; special case 69R$* $: $>MasqSMTP $1 qualify unqual'ed names 70R$+ $: $>MasqEnv $1 do masquerading 71 72 73# 74# envelope recipient rewriting -- 75# also header recipient if not masquerading recipients 76# 77SEnvToSMTP=21 78R$+ $: $>PseudoToReal $1 sender/recipient common 79R$+ $: $>MasqSMTP $1 qualify unqual'ed names 80R$* < @ *LOCAL* > $* $: $1 < @ $j . > $2 81 82# 83# header sender and masquerading header recipient rewriting 84# 85SHdrFromSMTP=31 86R$+ $: $>PseudoToReal $1 sender/recipient common 87R:; <@> $@ list:; special case 88 89# do special header rewriting 90R$* <@> $* $@ $1 <@> $2 pass null host through 91R< @ $* > $* $@ < @ $1 > $2 pass route-addr through 92R$* $: $>MasqSMTP $1 qualify unqual'ed names 93R$+ $: $>MasqHdr $1 do masquerading 94 95 96# 97# relay mailer header masquerading recipient rewriting 98# 99SMasqRelay=71 100R$+ $: $>MasqSMTP $1 101R$+ $: $>MasqHdr $1 102 103Msmtp, 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, 104 _OPTINS(`SMTP_MAILER_MAX', `M=', `, ')_OPTINS(`SMTP_MAILER_MAXMSGS', `m=', `, ')_OPTINS(`SMTP_MAILER_MAXRCPTS', `r=', `, ')_OPTINS(`SMTP_MAILER_CHARSET', `C=', `, ')T=DNS/RFC822/SMTP, 105 A=SMTP_MAILER_ARGS 106Mesmtp, P=[IPC], F=_MODMF_(CONCAT(_DEF_SMTP_MAILER_FLAGS, `a', SMTP_MAILER_FLAGS), `SMTP'), S=EnvFromSMTP/HdrFromSMTP, R=ifdef(`_ALL_MASQUERADE_', `EnvToSMTP/HdrFromSMTP', `EnvToSMTP'), E=\r\n, L=990, 107 _OPTINS(`SMTP_MAILER_MAX', `M=', `, ')_OPTINS(`SMTP_MAILER_MAXMSGS', `m=', `, ')_OPTINS(`SMTP_MAILER_MAXRCPTS', `r=', `, ')_OPTINS(`SMTP_MAILER_CHARSET', `C=', `, ')T=DNS/RFC822/SMTP, 108 A=ESMTP_MAILER_ARGS 109Msmtp8, P=[IPC], F=_MODMF_(CONCAT(_DEF_SMTP_MAILER_FLAGS, `8', 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, 111 A=SMTP8_MAILER_ARGS 112Mdsmtp, P=[IPC], F=_MODMF_(CONCAT(_DEF_SMTP_MAILER_FLAGS, `a%', SMTP_MAILER_FLAGS), `SMTP'), 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, 114 A=DSMTP_MAILER_ARGS 115Mrelay, 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, 116 _OPTINS(`RELAY_MAILER_CHARSET', `C=', `, ')_OPTINS(`RELAY_MAILER_MAXMSGS', `m=', `, ')_OPTINS(`SMTP_MAILER_MAXRCPTS', `r=', `, ')T=DNS/RFC822/SMTP, 117 A=RELAY_MAILER_ARGS 118