1PUSHDIVERT(-1) 2# 3# Copyright (c) 1998-2001 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')') 22define(`_SMTP_QGRP', `ifelse(defn(`SMTP_MAILER_QGRP'),`',`', ` Q=SMTP_MAILER_QGRP,')')dnl 23define(`_ESMTP_QGRP', `ifelse(defn(`ESMTP_MAILER_QGRP'),`',`', ` Q=ESMTP_MAILER_QGRP,')')dnl 24define(`_SMTP8_QGRP', `ifelse(defn(`SMTP8_MAILER_QGRP'),`',`', ` Q=SMTP8_MAILER_QGRP,')')dnl 25define(`_DSMTP_QGRP', `ifelse(defn(`DSMTP_MAILER_QGRP'),`',`', ` Q=DSMTP_MAILER_QGRP,')')dnl 26define(`_RELAY_QGRP', `ifelse(defn(`RELAY_MAILER_QGRP'),`',`', ` Q=RELAY_MAILER_QGRP,')')dnl 27POPDIVERT 28##################################### 29### SMTP Mailer specification ### 30##################################### 31 32VERSIONID(`$Id: smtp.m4,v 8.64 2001/04/03 01:52:54 gshapiro Exp $') 33 34# 35# common sender and masquerading recipient rewriting 36# 37SMasqSMTP 38R$* < @ $* > $* $@ $1 < @ $2 > $3 already fully qualified 39R$+ $@ $1 < @ *LOCAL* > add local qualification 40 41# 42# convert pseudo-domain addresses to real domain addresses 43# 44SPseudoToReal 45 46# pass <route-addr>s through 47R< @ $+ > $* $@ < @ $1 > $2 resolve <route-addr> 48 49# output fake domains as user%fake@relay 50ifdef(`BITNET_RELAY', 51`R$+ <@ $+ .BITNET. > $: $1 % $2 .BITNET < @ $B > user@host.BITNET 52R$+.BITNET <@ $~[ $*:$+ > $: $1 .BITNET < @ $4 > strip mailer: part', 53 `dnl') 54ifdef(`_NO_UUCP_', `dnl', ` 55# do UUCP heuristics; note that these are shared with UUCP mailers 56R$+ < @ $+ .UUCP. > $: < $2 ! > $1 convert to UUCP form 57R$+ < @ $* > $* $@ $1 < @ $2 > $3 not UUCP form 58 59# leave these in .UUCP form to avoid further tampering 60R< $&h ! > $- ! $+ $@ $2 < @ $1 .UUCP. > 61R< $&h ! > $-.$+ ! $+ $@ $3 < @ $1.$2 > 62R< $&h ! > $+ $@ $1 < @ $&h .UUCP. > 63R< $+ ! > $+ $: $1 ! $2 < @ $Y > use UUCP_RELAY 64R$+ < @ $~[ $* : $+ > $@ $1 < @ $4 > strip mailer: part 65R$+ < @ > $: $1 < @ *LOCAL* > if no UUCP_RELAY') 66 67 68# 69# envelope sender rewriting 70# 71SEnvFromSMTP 72R$+ $: $>PseudoToReal $1 sender/recipient common 73R$* :; <@> $@ list:; special case 74R$* $: $>MasqSMTP $1 qualify unqual'ed names 75R$+ $: $>MasqEnv $1 do masquerading 76 77 78# 79# envelope recipient rewriting -- 80# also header recipient if not masquerading recipients 81# 82SEnvToSMTP 83R$+ $: $>PseudoToReal $1 sender/recipient common 84R$+ $: $>MasqSMTP $1 qualify unqual'ed names 85R$* < @ *LOCAL* > $* $: $1 < @ $j . > $2 86 87# 88# header sender and masquerading header recipient rewriting 89# 90SHdrFromSMTP 91R$+ $: $>PseudoToReal $1 sender/recipient common 92R:; <@> $@ list:; special case 93 94# do special header rewriting 95R$* <@> $* $@ $1 <@> $2 pass null host through 96R< @ $* > $* $@ < @ $1 > $2 pass route-addr through 97R$* $: $>MasqSMTP $1 qualify unqual'ed names 98R$+ $: $>MasqHdr $1 do masquerading 99 100 101# 102# relay mailer header masquerading recipient rewriting 103# 104SMasqRelay 105R$+ $: $>MasqSMTP $1 106R$+ $: $>MasqHdr $1 107 108Msmtp, 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, 109 _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 110 A=SMTP_MAILER_ARGS 111Mesmtp, 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, 112 _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 113 A=ESMTP_MAILER_ARGS 114Msmtp8, 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, 115 _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 116 A=SMTP8_MAILER_ARGS 117Mdsmtp, 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, 118 _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 119 A=DSMTP_MAILER_ARGS 120Mrelay, 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, 121 _OPTINS(`RELAY_MAILER_CHARSET', `C=', `, ')_OPTINS(`RELAY_MAILER_MAXMSGS', `m=', `, ')_OPTINS(`SMTP_MAILER_MAXRCPTS', `r=', `, ')T=DNS/RFC822/SMTP,_RELAY_QGRP 122 A=RELAY_MAILER_ARGS 123