· 11 years ago · Jun 29, 2015, 03:23 AM
1#
2# Copyright (c) 1998-2004 Sendmail, Inc. and its suppliers.
3# All rights reserved.
4# Copyright (c) 1983, 1995 Eric P. Allman. All rights reserved.
5# Copyright (c) 1988, 1993
6# The Regents of the University of California. All rights reserved.
7#
8# By using this file, you agree to the terms and conditions set
9# forth in the LICENSE file which can be found at the top level of
10# the sendmail distribution.
11#
12#
13
14######################################################################
15######################################################################
16#####
17##### SENDMAIL CONFIGURATION FILE
18#####
19##### built by root@asterisk1.local on Sat Nov 18 23:17:27 GMT 2006
20##### in /etc/mail
21##### using /usr/share/sendmail-cf/ as configuration include directory
22#####
23######################################################################
24#####
25##### DO NOT EDIT THIS FILE! Only edit the source .mc file.
26#####
27######################################################################
28######################################################################
29
30##### $Id: cfhead.m4,v 8.116 2004/01/28 22:02:22 ca Exp $ #####
31##### $Id: cf.m4,v 8.32 1999/02/07 07:26:14 gshapiro Exp $ #####
32##### setup for Red Hat Linux #####
33##### $Id: linux.m4,v 8.13 2000/09/17 17:30:00 gshapiro Exp $ #####
34
35
36
37##### $Id: local_procmail.m4,v 8.22 2002/11/17 04:24:19 ca Exp $ #####
38
39
40##### $Id: no_default_msa.m4,v 8.2 2001/02/14 05:03:22 gshapiro Exp $ #####
41
42##### $Id: smrsh.m4,v 8.14 1999/11/18 05:06:23 ca Exp $ #####
43
44##### $Id: mailertable.m4,v 8.25 2002/06/27 23:23:57 gshapiro Exp $ #####
45
46##### $Id: virtusertable.m4,v 8.23 2002/06/27 23:23:57 gshapiro Exp $ #####
47
48##### $Id: redirect.m4,v 8.15 1999/08/06 01:47:36 gshapiro Exp $ #####
49
50##### $Id: always_add_domain.m4,v 8.11 2000/09/12 22:00:53 ca Exp $ #####
51
52##### $Id: use_cw_file.m4,v 8.11 2001/08/26 20:58:57 gshapiro Exp $ #####
53
54
55##### $Id: use_ct_file.m4,v 8.11 2001/08/26 20:58:57 gshapiro Exp $ #####
56
57
58##### $Id: local_procmail.m4,v 8.22 2002/11/17 04:24:19 ca Exp $ #####
59
60##### $Id: access_db.m4,v 8.26 2004/06/24 18:10:02 ca Exp $ #####
61
62##### $Id: blacklist_recipients.m4,v 8.13 1999/04/02 02:25:13 gshapiro Exp $ #####
63
64##### $Id: accept_unresolvable_domains.m4,v 8.10 1999/02/07 07:26:07 gshapiro Exp $ #####
65
66##### $Id: masquerade_envelope.m4,v 8.9 1999/02/07 07:26:10 gshapiro Exp $ #####
67
68
69##### $Id: proto.m4,v 8.710 2004/07/27 17:32:48 ca Exp $ #####
70
71# level 10 config file format
72V10/Berkeley
73
74# override file safeties - setting this option compromises system security,
75# addressing the actual file configuration problem is preferred
76# need to set this before any file actions are encountered in the cf file
77#O DontBlameSendmail=safe
78
79# default LDAP map specification
80# need to set this now before any LDAP maps are defined
81#O LDAPDefaultSpec=-h localhost
82
83##################
84# local info #
85##################
86
87# my LDAP cluster
88# need to set this before any LDAP lookups are done (including classes)
89#D{sendmailMTACluster}$m
90
91Cwlocalhost
92# file containing names of hosts for which we receive email
93Fw/etc/mail/local-host-names
94
95# my official domain name
96# ... define this only if sendmail cannot automatically determine your domain
97#Dj$w.Foo.COM
98
99# host/domain names ending with a token in class P are canonical
100CP.
101
102# "Smart" relay host (may be null)
103DS
104
105
106# operators that cannot be in local usernames (i.e., network indicators)
107CO @ % !
108
109# a class with just dot (for identifying canonical names)
110C..
111
112# a class with just a left bracket (for identifying domain literals)
113C[[
114
115# access_db acceptance class
116C{Accept}OK RELAY
117
118
119C{ResOk}OKR
120
121
122# Hosts for which relaying is permitted ($=R)
123FR-o /etc/mail/relay-domains
124
125# arithmetic map
126Karith arith
127# macro storage map
128Kmacro macro
129# possible values for TLS_connection in access map
130C{Tls}VERIFY ENCR
131
132
133
134
135
136# dequoting map
137Kdequote dequote
138
139# class E: names that should be exposed as from this host, even if we masquerade
140# class L: names that should be delivered locally, even if we have a relay
141# class M: domains that should be converted to $M
142# class N: domains that should not be converted to $M
143#CL root
144C{E}root
145C{w}localhost.localdomain
146
147# who I masquerade as (null for no masquerading) (see also $=M)
148DM
149
150# my name for error messages
151DnMAILER-DAEMON
152
153
154# Mailer table (overriding domains)
155Kmailertable hash -o /etc/mail/mailertable.db
156
157# Virtual user table (maps incoming users)
158Kvirtuser hash -o /etc/mail/virtusertable.db
159
160CPREDIRECT
161
162# Access list database (for spam stomping)
163Kaccess hash -T<TMPF> -o /etc/mail/access.db
164
165# Configuration version number
166DZ8.13.1
167
168
169###############
170# Options #
171###############
172
173# strip message body to 7 bits on input?
174O SevenBitInput=False
175
176# 8-bit data handling
177#O EightBitMode=pass8
178
179# wait for alias file rebuild (default units: minutes)
180O AliasWait=10
181
182# location of alias file
183O AliasFile=/etc/aliases
184
185# minimum number of free blocks on filesystem
186O MinFreeBlocks=100
187
188# maximum message size
189#O MaxMessageSize=0
190
191# substitution for space (blank) characters
192O BlankSub=.
193
194# avoid connecting to "expensive" mailers on initial submission?
195O HoldExpensive=False
196
197# checkpoint queue runs after every N successful deliveries
198#O CheckpointInterval=10
199
200# default delivery mode
201O DeliveryMode=background
202
203# error message header/file
204#O ErrorHeader=/etc/mail/error-header
205
206# error mode
207#O ErrorMode=print
208
209# save Unix-style "From_" lines at top of header?
210#O SaveFromLine=False
211
212# queue file mode (qf files)
213#O QueueFileMode=0600
214
215# temporary file mode
216O TempFileMode=0600
217
218# match recipients against GECOS field?
219#O MatchGECOS=False
220
221# maximum hop count
222#O MaxHopCount=25
223
224# location of help file
225O HelpFile=/etc/mail/helpfile
226
227# ignore dots as terminators in incoming messages?
228#O IgnoreDots=False
229
230# name resolver options
231#O ResolverOptions=+AAONLY
232
233# deliver MIME-encapsulated error messages?
234O SendMimeErrors=True
235
236# Forward file search path
237O ForwardPath=$z/.forward.$w:$z/.forward
238
239# open connection cache size
240O ConnectionCacheSize=2
241
242# open connection cache timeout
243O ConnectionCacheTimeout=5m
244
245# persistent host status directory
246#O HostStatusDirectory=.hoststat
247
248# single thread deliveries (requires HostStatusDirectory)?
249#O SingleThreadDelivery=False
250
251# use Errors-To: header?
252O UseErrorsTo=False
253
254# log level
255O LogLevel=9
256
257# send to me too, even in an alias expansion?
258#O MeToo=True
259
260# verify RHS in newaliases?
261O CheckAliases=False
262
263# default messages to old style headers if no special punctuation?
264O OldStyleHeaders=True
265
266# SMTP daemon options
267
268O DaemonPortOptions=Port=smtp,Addr=127.0.0.1, Name=MTA
269
270# SMTP client options
271#O ClientPortOptions=Family=inet, Address=0.0.0.0
272
273# Modifiers to define {daemon_flags} for direct submissions
274#O DirectSubmissionModifiers
275
276# Use as mail submission program? See sendmail/SECURITY
277#O UseMSP
278
279# privacy flags
280O PrivacyOptions=authwarnings,novrfy,noexpn,restrictqrun
281
282# who (if anyone) should get extra copies of error messages
283#O PostmasterCopy=Postmaster
284
285# slope of queue-only function
286#O QueueFactor=600000
287
288# limit on number of concurrent queue runners
289#O MaxQueueChildren
290
291# maximum number of queue-runners per queue-grouping with multiple queues
292#O MaxRunnersPerQueue=1
293
294# priority of queue runners (nice(3))
295#O NiceQueueRun
296
297# shall we sort the queue by hostname first?
298#O QueueSortOrder=priority
299
300# minimum time in queue before retry
301#O MinQueueAge=30m
302
303# how many jobs can you process in the queue?
304#O MaxQueueRunSize=10000
305
306# perform initial split of envelope without checking MX records
307#O FastSplit=1
308
309# queue directory
310O QueueDirectory=/var/spool/mqueue
311
312# key for shared memory; 0 to turn off
313#O SharedMemoryKey=0
314
315
316
317# timeouts (many of these)
318#O Timeout.initial=5m
319O Timeout.connect=1m
320#O Timeout.aconnect=0s
321#O Timeout.iconnect=5m
322#O Timeout.helo=5m
323#O Timeout.mail=10m
324#O Timeout.rcpt=1h
325#O Timeout.datainit=5m
326#O Timeout.datablock=1h
327#O Timeout.datafinal=1h
328#O Timeout.rset=5m
329#O Timeout.quit=2m
330#O Timeout.misc=2m
331#O Timeout.command=1h
332O Timeout.ident=0
333#O Timeout.fileopen=60s
334#O Timeout.control=2m
335O Timeout.queuereturn=5d
336#O Timeout.queuereturn.normal=5d
337#O Timeout.queuereturn.urgent=2d
338#O Timeout.queuereturn.non-urgent=7d
339#O Timeout.queuereturn.dsn=5d
340O Timeout.queuewarn=4h
341#O Timeout.queuewarn.normal=4h
342#O Timeout.queuewarn.urgent=1h
343#O Timeout.queuewarn.non-urgent=12h
344#O Timeout.queuewarn.dsn=4h
345#O Timeout.hoststatus=30m
346#O Timeout.resolver.retrans=5s
347#O Timeout.resolver.retrans.first=5s
348#O Timeout.resolver.retrans.normal=5s
349#O Timeout.resolver.retry=4
350#O Timeout.resolver.retry.first=4
351#O Timeout.resolver.retry.normal=4
352#O Timeout.lhlo=2m
353#O Timeout.auth=10m
354#O Timeout.starttls=1h
355
356# time for DeliverBy; extension disabled if less than 0
357#O DeliverByMin=0
358
359# should we not prune routes in route-addr syntax addresses?
360#O DontPruneRoutes=False
361
362# queue up everything before forking?
363O SuperSafe=True
364
365# status file
366O StatusFile=/var/log/mail/statistics
367
368# time zone handling:
369# if undefined, use system default
370# if defined but null, use TZ envariable passed in
371# if defined and non-null, use that info
372#O TimeZoneSpec=
373
374# default UID (can be username or userid:groupid)
375O DefaultUser=8:12
376
377# list of locations of user database file (null means no lookup)
378O UserDatabaseSpec=/etc/mail/userdb.db
379
380# fallback MX host
381#O FallbackMXhost=fall.back.host.net
382
383# fallback smart host
384#O FallbackSmartHost=fall.back.host.net
385
386# if we are the best MX host for a site, try it directly instead of config err
387O TryNullMXList=true
388
389# load average at which we just queue messages
390#O QueueLA=8
391
392# load average at which we refuse connections
393#O RefuseLA=12
394
395# log interval when refusing connections for this long
396#O RejectLogInterval=3h
397
398# load average at which we delay connections; 0 means no limit
399#O DelayLA=0
400
401# maximum number of children we allow at one time
402#O MaxDaemonChildren=0
403
404# maximum number of new connections per second
405#O ConnectionRateThrottle=0
406
407# Width of the window
408#O ConnectionRateWindowSize=60s
409
410# work recipient factor
411#O RecipientFactor=30000
412
413# deliver each queued job in a separate process?
414#O ForkEachJob=False
415
416# work class factor
417#O ClassFactor=1800
418
419# work time factor
420#O RetryFactor=90000
421
422# default character set
423#O DefaultCharSet=iso-8859-1
424
425# service switch file (name hardwired on Solaris, Ultrix, OSF/1, others)
426#O ServiceSwitchFile=/etc/mail/service.switch
427
428# hosts file (normally /etc/hosts)
429#O HostsFile=/etc/hosts
430
431# dialup line delay on connection failure
432#O DialDelay=10s
433
434# action to take if there are no recipients in the message
435#O NoRecipientAction=add-to-undisclosed
436
437# chrooted environment for writing to files
438#O SafeFileEnvironment=/arch
439
440# are colons OK in addresses?
441#O ColonOkInAddr=True
442
443# shall I avoid expanding CNAMEs (violates protocols)?
444#O DontExpandCnames=False
445
446# SMTP initial login message (old $e macro)
447O SmtpGreetingMessage=$j Sendmail $v/$Z; $b
448
449# UNIX initial From header format (old $l macro)
450O UnixFromLine=From $g $d
451
452# From: lines that have embedded newlines are unwrapped onto one line
453#O SingleLineFromHeader=False
454
455# Allow HELO SMTP command that does not include a host name
456#O AllowBogusHELO=False
457
458# Characters to be quoted in a full name phrase (@,;:\()[] are automatic)
459#O MustQuoteChars=.
460
461# delimiter (operator) characters (old $o macro)
462O OperatorChars=.:%@!^/[]+
463
464# shall I avoid calling initgroups(3) because of high NIS costs?
465#O DontInitGroups=False
466
467# are group-writable :include: and .forward files (un)trustworthy?
468# True (the default) means they are not trustworthy.
469#O UnsafeGroupWrites=True
470
471
472# where do errors that occur when sending errors get sent?
473#O DoubleBounceAddress=postmaster
474
475# where to save bounces if all else fails
476#O DeadLetterDrop=/var/tmp/dead.letter
477
478# what user id do we assume for the majority of the processing?
479#O RunAsUser=sendmail
480
481# maximum number of recipients per SMTP envelope
482#O MaxRecipientsPerMessage=0
483
484# limit the rate recipients per SMTP envelope are accepted
485# once the threshold number of recipients have been rejected
486#O BadRcptThrottle=0
487
488# shall we get local names from our installed interfaces?
489O DontProbeInterfaces=true
490
491# Return-Receipt-To: header implies DSN request
492#O RrtImpliesDsn=False
493
494# override connection address (for testing)
495#O ConnectOnlyTo=0.0.0.0
496
497# Trusted user for file ownership and starting the daemon
498#O TrustedUser=root
499
500# Control socket for daemon management
501#O ControlSocketName=/var/spool/mqueue/.control
502
503# Maximum MIME header length to protect MUAs
504#O MaxMimeHeaderLength=0/0
505
506# Maximum length of the sum of all headers
507#O MaxHeadersLength=32768
508
509# Maximum depth of alias recursion
510#O MaxAliasRecursion=10
511
512# location of pid file
513#O PidFile=/var/run/sendmail.pid
514
515# Prefix string for the process title shown on 'ps' listings
516#O ProcessTitlePrefix=prefix
517
518# Data file (df) memory-buffer file maximum size
519#O DataFileBufferSize=4096
520
521# Transcript file (xf) memory-buffer file maximum size
522#O XscriptFileBufferSize=4096
523
524# lookup type to find information about local mailboxes
525#O MailboxDatabase=pw
526
527# override compile time flag REQUIRES_DIR_FSYNC
528#O RequiresDirfsync=true
529
530# list of authentication mechanisms
531#O AuthMechanisms=EXTERNAL GSSAPI KERBEROS_V4 DIGEST-MD5 CRAM-MD5
532
533# Authentication realm
534#O AuthRealm
535
536# default authentication information for outgoing connections
537#O DefaultAuthInfo=/etc/mail/default-auth-info
538
539# SMTP AUTH flags
540O AuthOptions=A
541
542# SMTP AUTH maximum encryption strength
543#O AuthMaxBits
544
545# SMTP STARTTLS server options
546#O TLSSrvOptions
547
548# Input mail filters
549#O InputMailFilters
550
551
552# CA directory
553#O CACertPath
554# CA file
555#O CACertFile
556# Server Cert
557#O ServerCertFile
558# Server private key
559#O ServerKeyFile
560# Client Cert
561#O ClientCertFile
562# Client private key
563#O ClientKeyFile
564# File containing certificate revocation lists
565#O CRLFile
566# DHParameters (only required if DSA/DH is used)
567#O DHParameters
568# Random data source (required for systems without /dev/urandom under OpenSSL)
569#O RandFile
570
571############################
572# QUEUE GROUP DEFINITIONS #
573############################
574
575
576###########################
577# Message precedences #
578###########################
579
580Pfirst-class=0
581Pspecial-delivery=100
582Plist=-30
583Pbulk=-60
584Pjunk=-100
585
586#####################
587# Trusted users #
588#####################
589
590# this is equivalent to setting class "t"
591Ft/etc/mail/trusted-users
592Troot
593Tdaemon
594Tuucp
595
596#########################
597# Format of headers #
598#########################
599
600H?P?Return-Path: <$g>
601HReceived: $?sfrom $s $.$?_($?s$|from $.$_)
602 $.$?{auth_type}(authenticated$?{auth_ssf} bits=${auth_ssf}$.)
603 $.by $j ($v/$Z)$?r with $r$. id $i$?{tls_version}
604 (version=${tls_version} cipher=${cipher} bits=${cipher_bits} verify=${verify})$.$?u
605 for $u; $|;
606 $.$b
607H?D?Resent-Date: $a
608H?D?Date: $a
609H?F?Resent-From: $?x$x <$g>$|$g$.
610H?F?From: $?x$x <$g>$|$g$.
611H?x?Full-Name: $x
612# HPosted-Date: $a
613# H?l?Received-Date: $b
614H?M?Resent-Message-Id: <$t.$i@$j>
615H?M?Message-Id: <$t.$i@$j>
616
617#
618######################################################################
619######################################################################
620#####
621##### REWRITING RULES
622#####
623######################################################################
624######################################################################
625
626############################################
627### Ruleset 3 -- Name Canonicalization ###
628############################################
629Scanonify=3
630
631# handle null input (translate to <@> special case)
632R$@ $@ <@>
633
634# strip group: syntax (not inside angle brackets!) and trailing semicolon
635R$* $: $1 <@> mark addresses
636R$* < $* > $* <@> $: $1 < $2 > $3 unmark <addr>
637R@ $* <@> $: @ $1 unmark @host:...
638R$* [ IPv6 : $+ ] <@> $: $1 [ IPv6 : $2 ] unmark IPv6 addr
639R$* :: $* <@> $: $1 :: $2 unmark node::addr
640R:include: $* <@> $: :include: $1 unmark :include:...
641R$* : $* [ $* ] $: $1 : $2 [ $3 ] <@> remark if leading colon
642R$* : $* <@> $: $2 strip colon if marked
643R$* <@> $: $1 unmark
644R$* ; $1 strip trailing semi
645R$* < $+ :; > $* $@ $2 :; <@> catch <list:;>
646R$* < $* ; > $1 < $2 > bogus bracketed semi
647
648# null input now results from list:; syntax
649R$@ $@ :; <@>
650
651# strip angle brackets -- note RFC733 heuristic to get innermost item
652R$* $: < $1 > housekeeping <>
653R$+ < $* > < $2 > strip excess on left
654R< $* > $+ < $1 > strip excess on right
655R<> $@ < @ > MAIL FROM:<> case
656R< $+ > $: $1 remove housekeeping <>
657
658# strip route address <@a,@b,@c:user@d> -> <user@d>
659R@ $+ , $+ $2
660R@ [ $* ] : $+ $2
661R@ $+ : $+ $2
662
663# find focus for list syntax
664R $+ : $* ; @ $+ $@ $>Canonify2 $1 : $2 ; < @ $3 > list syntax
665R $+ : $* ; $@ $1 : $2; list syntax
666
667# find focus for @ syntax addresses
668R$+ @ $+ $: $1 < @ $2 > focus on domain
669R$+ < $+ @ $+ > $1 $2 < @ $3 > move gaze right
670R$+ < @ $+ > $@ $>Canonify2 $1 < @ $2 > already canonical
671
672
673# convert old-style addresses to a domain-based address
674R$- ! $+ $@ $>Canonify2 $2 < @ $1 .UUCP > resolve uucp names
675R$+ . $- ! $+ $@ $>Canonify2 $3 < @ $1 . $2 > domain uucps
676R$+ ! $+ $@ $>Canonify2 $2 < @ $1 .UUCP > uucp subdomains
677
678# if we have % signs, take the rightmost one
679R$* % $* $1 @ $2 First make them all @s.
680R$* @ $* @ $* $1 % $2 @ $3 Undo all but the last.
681R$* @ $* $@ $>Canonify2 $1 < @ $2 > Insert < > and finish
682
683# else we must be a local name
684R$* $@ $>Canonify2 $1
685
686
687################################################
688### Ruleset 96 -- bottom half of ruleset 3 ###
689################################################
690
691SCanonify2=96
692
693# handle special cases for local names
694R$* < @ localhost > $* $: $1 < @ $j . > $2 no domain at all
695R$* < @ localhost . $m > $* $: $1 < @ $j . > $2 local domain
696R$* < @ localhost . UUCP > $* $: $1 < @ $j . > $2 .UUCP domain
697
698# check for IPv4/IPv6 domain literal
699R$* < @ [ $+ ] > $* $: $1 < @@ [ $2 ] > $3 mark [addr]
700R$* < @@ $=w > $* $: $1 < @ $j . > $3 self-literal
701R$* < @@ $+ > $* $@ $1 < @ $2 > $3 canon IP addr
702
703
704
705
706
707# if really UUCP, handle it immediately
708
709# try UUCP traffic as a local address
710R$* < @ $+ . UUCP > $* $: $1 < @ $[ $2 $] . UUCP . > $3
711R$* < @ $+ . . UUCP . > $* $@ $1 < @ $2 . > $3
712
713# hostnames ending in class P are always canonical
714R$* < @ $* $=P > $* $: $1 < @ $2 $3 . > $4
715R$* < @ $* $~P > $* $: $&{daemon_flags} $| $1 < @ $2 $3 > $4
716R$* CC $* $| $* < @ $+.$+ > $* $: $3 < @ $4.$5 . > $6
717R$* CC $* $| $* $: $3
718# pass to name server to make hostname canonical
719R$* $| $* < @ $* > $* $: $2 < @ $[ $3 $] > $4
720R$* $| $* $: $2
721
722# local host aliases and pseudo-domains are always canonical
723R$* < @ $=w > $* $: $1 < @ $2 . > $3
724R$* < @ $=M > $* $: $1 < @ $2 . > $3
725R$* < @ $={VirtHost} > $* $: $1 < @ $2 . > $3
726R$* < @ $* . . > $* $1 < @ $2 . > $3
727
728
729##################################################
730### Ruleset 4 -- Final Output Post-rewriting ###
731##################################################
732Sfinal=4
733
734R$+ :; <@> $@ $1 : handle <list:;>
735R$* <@> $@ handle <> and list:;
736
737# strip trailing dot off possibly canonical name
738R$* < @ $+ . > $* $1 < @ $2 > $3
739
740# eliminate internal code
741R$* < @ *LOCAL* > $* $1 < @ $j > $2
742
743# externalize local domain info
744R$* < $+ > $* $1 $2 $3 defocus
745R@ $+ : @ $+ : $+ @ $1 , @ $2 : $3 <route-addr> canonical
746R@ $* $@ @ $1 ... and exit
747
748# UUCP must always be presented in old form
749R$+ @ $- . UUCP $2!$1 u@h.UUCP => h!u
750
751# delete duplicate local names
752R$+ % $=w @ $=w $1 @ $2 u%host@host => u@host
753
754
755
756##############################################################
757### Ruleset 97 -- recanonicalize and call ruleset zero ###
758### (used for recursive calls) ###
759##############################################################
760
761SRecurse=97
762R$* $: $>canonify $1
763R$* $@ $>parse $1
764
765
766######################################
767### Ruleset 0 -- Parse Address ###
768######################################
769
770Sparse=0
771
772R$* $: $>Parse0 $1 initial parsing
773R<@> $#local $: <@> special case error msgs
774R$* $: $>ParseLocal $1 handle local hacks
775R$* $: $>Parse1 $1 final parsing
776
777#
778# Parse0 -- do initial syntax checking and eliminate local addresses.
779# This should either return with the (possibly modified) input
780# or return with a #error mailer. It should not return with a
781# #mailer other than the #error mailer.
782#
783
784SParse0
785R<@> $@ <@> special case error msgs
786R$* : $* ; <@> $#error $@ 5.1.3 $: "553 List:; syntax illegal for recipient addresses"
787R@ <@ $* > < @ $1 > catch "@@host" bogosity
788R<@ $+> $#error $@ 5.1.3 $: "553 User address required"
789R$+ <@> $#error $@ 5.1.3 $: "553 Hostname required"
790R$* $: <> $1
791R<> $* < @ [ $* ] : $+ > $* $1 < @ [ $2 ] : $3 > $4
792R<> $* < @ [ $* ] , $+ > $* $1 < @ [ $2 ] , $3 > $4
793R<> $* < @ [ $* ] $+ > $* $#error $@ 5.1.2 $: "553 Invalid address"
794R<> $* < @ [ $+ ] > $* $1 < @ [ $2 ] > $3
795R<> $* <$* : $* > $* $#error $@ 5.1.3 $: "553 Colon illegal in host name part"
796R<> $* $1
797R$* < @ . $* > $* $#error $@ 5.1.2 $: "553 Invalid host name"
798R$* < @ $* .. $* > $* $#error $@ 5.1.2 $: "553 Invalid host name"
799R$* < @ $* @ > $* $#error $@ 5.1.2 $: "553 Invalid route address"
800R$* @ $* < @ $* > $* $#error $@ 5.1.3 $: "553 Invalid route address"
801R$* , $~O $* $#error $@ 5.1.3 $: "553 Invalid route address"
802
803
804# now delete the local info -- note $=O to find characters that cause forwarding
805R$* < @ > $* $@ $>Parse0 $>canonify $1 user@ => user
806R< @ $=w . > : $* $@ $>Parse0 $>canonify $2 @here:... -> ...
807R$- < @ $=w . > $: $(dequote $1 $) < @ $2 . > dequote "foo"@here
808R< @ $+ > $#error $@ 5.1.3 $: "553 User address required"
809R$* $=O $* < @ $=w . > $@ $>Parse0 $>canonify $1 $2 $3 ...@here -> ...
810R$- $: $(dequote $1 $) < @ *LOCAL* > dequote "foo"
811R< @ *LOCAL* > $#error $@ 5.1.3 $: "553 User address required"
812R$* $=O $* < @ *LOCAL* >
813 $@ $>Parse0 $>canonify $1 $2 $3 ...@*LOCAL* -> ...
814R$* < @ *LOCAL* > $: $1
815
816#
817# Parse1 -- the bottom half of ruleset 0.
818#
819
820SParse1
821
822# handle numeric address spec
823R$* < @ [ $+ ] > $* $: $>ParseLocal $1 < @ [ $2 ] > $3 numeric internet spec
824R$* < @ [ $+ ] > $* $: $1 < @ [ $2 ] : $S > $3 Add smart host to path
825R$* < @ [ $+ ] : > $* $#esmtp $@ [$2] $: $1 < @ [$2] > $3 no smarthost: send
826R$* < @ [ $+ ] : $- : $*> $* $#$3 $@ $4 $: $1 < @ [$2] > $5 smarthost with mailer
827R$* < @ [ $+ ] : $+ > $* $#esmtp $@ $3 $: $1 < @ [$2] > $4 smarthost without mailer
828
829# handle virtual users
830R$+ $: <!> $1 Mark for lookup
831R<!> $+ < @ $={VirtHost} . > $: < $(virtuser $1 @ $2 $@ $1 $: @ $) > $1 < @ $2 . >
832R<!> $+ < @ $=w . > $: < $(virtuser $1 @ $2 $@ $1 $: @ $) > $1 < @ $2 . >
833R<@> $+ + $+ < @ $* . >
834 $: < $(virtuser $1 + + @ $3 $@ $1 $@ $2 $@ +$2 $: @ $) > $1 + $2 < @ $3 . >
835R<@> $+ + $* < @ $* . >
836 $: < $(virtuser $1 + * @ $3 $@ $1 $@ $2 $@ +$2 $: @ $) > $1 + $2 < @ $3 . >
837R<@> $+ + $* < @ $* . >
838 $: < $(virtuser $1 @ $3 $@ $1 $@ $2 $@ +$2 $: @ $) > $1 + $2 < @ $3 . >
839R<@> $+ + $+ < @ $+ . > $: < $(virtuser + + @ $3 $@ $1 $@ $2 $@ +$2 $: @ $) > $1 + $2 < @ $3 . >
840R<@> $+ + $* < @ $+ . > $: < $(virtuser + * @ $3 $@ $1 $@ $2 $@ +$2 $: @ $) > $1 + $2 < @ $3 . >
841R<@> $+ + $* < @ $+ . > $: < $(virtuser @ $3 $@ $1 $@ $2 $@ +$2 $: ! $) > $1 + $2 < @ $3 . >
842R<@> $+ < @ $+ . > $: < $(virtuser @ $2 $@ $1 $: @ $) > $1 < @ $2 . >
843R<@> $+ $: $1
844R<!> $+ $: $1
845R< error : $-.$-.$- : $+ > $* $#error $@ $1.$2.$3 $: $4
846R< error : $- $+ > $* $#error $@ $(dequote $1 $) $: $2
847R< $+ > $+ < @ $+ > $: $>Recurse $1
848
849# short circuit local delivery so forwarded email works
850
851
852R$=L < @ $=w . > $#local $: @ $1 special local names
853R$+ < @ $=w . > $#local $: $1 regular local name
854
855# not local -- try mailer table lookup
856R$* <@ $+ > $* $: < $2 > $1 < @ $2 > $3 extract host name
857R< $+ . > $* $: < $1 > $2 strip trailing dot
858R< $+ > $* $: < $(mailertable $1 $) > $2 lookup
859R< $~[ : $* > $* $>MailerToTriple < $1 : $2 > $3 check -- resolved?
860R< $+ > $* $: $>Mailertable <$1> $2 try domain
861
862# resolve remotely connected UUCP links (if any)
863
864# resolve fake top level domains by forwarding to other hosts
865
866
867
868# pass names that still have a host to a smarthost (if defined)
869R$* < @ $* > $* $: $>MailerToTriple < $S > $1 < @ $2 > $3 glue on smarthost name
870
871# deal with other remote names
872R$* < @$* > $* $#esmtp $@ $2 $: $1 < @ $2 > $3 user@host.domain
873
874# handle locally delivered names
875R$=L $#local $: @ $1 special local names
876R$+ $#local $: $1 regular local names
877
878###########################################################################
879### Ruleset 5 -- special rewriting after aliases have been expanded ###
880###########################################################################
881
882SLocal_localaddr
883Slocaladdr=5
884R$+ $: $1 $| $>"Local_localaddr" $1
885R$+ $| $#ok $@ $1 no change
886R$+ $| $#$* $#$2
887R$+ $| $* $: $1
888
889
890
891
892# deal with plussed users so aliases work nicely
893R$+ + * $#local $@ $&h $: $1
894R$+ + $* $#local $@ + $2 $: $1 + *
895
896# prepend an empty "forward host" on the front
897R$+ $: <> $1
898
899
900
901R< > $+ $: < > < $1 <> $&h > nope, restore +detail
902
903R< > < $+ <> + $* > $: < > < $1 + $2 > check whether +detail
904R< > < $+ <> $* > $: < > < $1 > else discard
905R< > < $+ + $* > $* < > < $1 > + $2 $3 find the user part
906R< > < $+ > + $* $#local $@ $2 $: @ $1 strip the extra +
907R< > < $+ > $@ $1 no +detail
908R$+ $: $1 <> $&h add +detail back in
909
910R$+ <> + $* $: $1 + $2 check whether +detail
911R$+ <> $* $: $1 else discard
912R< local : $* > $* $: $>MailerToTriple < local : $1 > $2 no host extension
913R< error : $* > $* $: $>MailerToTriple < error : $1 > $2 no host extension
914
915R< $~[ : $+ > $+ $: $>MailerToTriple < $1 : $2 > $3 < @ $2 >
916
917R< $+ > $+ $@ $>MailerToTriple < $1 > $2 < @ $1 >
918
919
920###################################################################
921### Ruleset 90 -- try domain part of mailertable entry ###
922###################################################################
923
924SMailertable=90
925R$* <$- . $+ > $* $: $1$2 < $(mailertable .$3 $@ $1$2 $@ $2 $) > $4
926R$* <$~[ : $* > $* $>MailerToTriple < $2 : $3 > $4 check -- resolved?
927R$* < . $+ > $* $@ $>Mailertable $1 . <$2> $3 no -- strip & try again
928R$* < $* > $* $: < $(mailertable . $@ $1$2 $) > $3 try "."
929R< $~[ : $* > $* $>MailerToTriple < $1 : $2 > $3 "." found?
930R< $* > $* $@ $2 no mailertable match
931
932###################################################################
933### Ruleset 95 -- canonify mailer:[user@]host syntax to triple ###
934###################################################################
935
936SMailerToTriple=95
937R< > $* $@ $1 strip off null relay
938R< error : $-.$-.$- : $+ > $* $#error $@ $1.$2.$3 $: $4
939R< error : $- : $+ > $* $#error $@ $(dequote $1 $) $: $2
940R< error : $+ > $* $#error $: $1
941R< local : $* > $* $>CanonLocal < $1 > $2
942R< $~[ : $+ @ $+ > $*<$*>$* $# $1 $@ $3 $: $2<@$3> use literal user
943R< $~[ : $+ > $* $# $1 $@ $2 $: $3 try qualified mailer
944R< $=w > $* $@ $2 delete local host
945R< $+ > $* $#relay $@ $1 $: $2 use unqualified mailer
946
947###################################################################
948### Ruleset CanonLocal -- canonify local: syntax ###
949###################################################################
950
951SCanonLocal
952# strip local host from routed addresses
953R< $* > < @ $+ > : $+ $@ $>Recurse $3
954R< $* > $+ $=O $+ < @ $+ > $@ $>Recurse $2 $3 $4
955
956# strip trailing dot from any host name that may appear
957R< $* > $* < @ $* . > $: < $1 > $2 < @ $3 >
958
959# handle local: syntax -- use old user, either with or without host
960R< > $* < @ $* > $* $#local $@ $1@$2 $: $1
961R< > $+ $#local $@ $1 $: $1
962
963# handle local:user@host syntax -- ignore host part
964R< $+ @ $+ > $* < @ $* > $: < $1 > $3 < @ $4 >
965
966# handle local:user syntax
967R< $+ > $* <@ $* > $* $#local $@ $2@$3 $: $1
968R< $+ > $* $#local $@ $2 $: $1
969
970###################################################################
971### Ruleset 93 -- convert header names to masqueraded form ###
972###################################################################
973
974SMasqHdr=93
975
976
977# do not masquerade anything in class N
978R$* < @ $* $=N . > $@ $1 < @ $2 $3 . >
979
980# special case the users that should be exposed
981R$=E < @ *LOCAL* > $@ $1 < @ $j . > leave exposed
982R$=E < @ $=M . > $@ $1 < @ $2 . >
983R$=E < @ $=w . > $@ $1 < @ $2 . >
984
985# handle domain-specific masquerading
986R$* < @ $=M . > $* $: $1 < @ $2 . @ $M > $3 convert masqueraded doms
987R$* < @ $=w . > $* $: $1 < @ $2 . @ $M > $3
988R$* < @ *LOCAL* > $* $: $1 < @ $j . @ $M > $2
989R$* < @ $+ @ > $* $: $1 < @ $2 > $3 $M is null
990R$* < @ $+ @ $+ > $* $: $1 < @ $3 . > $4 $M is not null
991
992###################################################################
993### Ruleset 94 -- convert envelope names to masqueraded form ###
994###################################################################
995
996SMasqEnv=94
997R$+ $@ $>MasqHdr $1
998
999###################################################################
1000### Ruleset 98 -- local part of ruleset zero (can be null) ###
1001###################################################################
1002
1003SParseLocal=98
1004
1005# addresses sent to foo@host.REDIRECT will give a 551 error code
1006R$* < @ $+ .REDIRECT. > $: $1 < @ $2 . REDIRECT . > < ${opMode} >
1007R$* < @ $+ .REDIRECT. > <i> $: $1 < @ $2 . REDIRECT. >
1008R$* < @ $+ .REDIRECT. > < $- > $#error $@ 5.1.1 $: "551 User has moved; please try " <$1@$2>
1009
1010
1011
1012
1013######################################################################
1014### D: LookUpDomain -- search for domain in access database
1015###
1016### Parameters:
1017### <$1> -- key (domain name)
1018### <$2> -- default (what to return if not found in db)
1019### <$3> -- mark (must be <(!|+) single-token>)
1020### ! does lookup only with tag
1021### + does lookup with and without tag
1022### <$4> -- passthru (additional data passed unchanged through)
1023######################################################################
1024
1025SD
1026R<$*> <$+> <$- $-> <$*> $: < $(access $4:$1 $: ? $) > <$1> <$2> <$3 $4> <$5>
1027R<?> <$+> <$+> <+ $-> <$*> $: < $(access $1 $: ? $) > <$1> <$2> <+ $3> <$4>
1028R<?> <[$+.$-]> <$+> <$- $-> <$*> $@ $>D <[$1]> <$3> <$4 $5> <$6>
1029R<?> <[$+::$-]> <$+> <$- $-> <$*> $: $>D <[$1]> <$3> <$4 $5> <$6>
1030R<?> <[$+:$-]> <$+> <$- $-> <$*> $: $>D <[$1]> <$3> <$4 $5> <$6>
1031R<?> <$+.$+> <$+> <$- $-> <$*> $@ $>D <$2> <$3> <$4 $5> <$6>
1032R<?> <$+> <$+> <$- $-> <$*> $@ <$2> <$5>
1033R<$* <TMPF>> <$+> <$+> <$- $-> <$*> $@ <<TMPF>> <$6>
1034R<$*> <$+> <$+> <$- $-> <$*> $@ <$1> <$6>
1035
1036######################################################################
1037### A: LookUpAddress -- search for host address in access database
1038###
1039### Parameters:
1040### <$1> -- key (dot quadded host address)
1041### <$2> -- default (what to return if not found in db)
1042### <$3> -- mark (must be <(!|+) single-token>)
1043### ! does lookup only with tag
1044### + does lookup with and without tag
1045### <$4> -- passthru (additional data passed through)
1046######################################################################
1047
1048SA
1049R<$+> <$+> <$- $-> <$*> $: < $(access $4:$1 $: ? $) > <$1> <$2> <$3 $4> <$5>
1050R<?> <$+> <$+> <+ $-> <$*> $: < $(access $1 $: ? $) > <$1> <$2> <+ $3> <$4>
1051R<?> <$+::$-> <$+> <$- $-> <$*> $@ $>A <$1> <$3> <$4 $5> <$6>
1052R<?> <$+:$-> <$+> <$- $-> <$*> $@ $>A <$1> <$3> <$4 $5> <$6>
1053R<?> <$+.$-> <$+> <$- $-> <$*> $@ $>A <$1> <$3> <$4 $5> <$6>
1054R<?> <$+> <$+> <$- $-> <$*> $@ <$2> <$5>
1055R<$* <TMPF>> <$+> <$+> <$- $-> <$*> $@ <<TMPF>> <$6>
1056R<$*> <$+> <$+> <$- $-> <$*> $@ <$1> <$6>
1057
1058######################################################################
1059### CanonAddr -- Convert an address into a standard form for
1060### relay checking. Route address syntax is
1061### crudely converted into a %-hack address.
1062###
1063### Parameters:
1064### $1 -- full recipient address
1065###
1066### Returns:
1067### parsed address, not in source route form
1068######################################################################
1069
1070SCanonAddr
1071R$* $: $>Parse0 $>canonify $1 make domain canonical
1072
1073
1074######################################################################
1075### ParseRecipient -- Strip off hosts in $=R as well as possibly
1076### $* $=m or the access database.
1077### Check user portion for host separators.
1078###
1079### Parameters:
1080### $1 -- full recipient address
1081###
1082### Returns:
1083### parsed, non-local-relaying address
1084######################################################################
1085
1086SParseRecipient
1087R$* $: <?> $>CanonAddr $1
1088R<?> $* < @ $* . > <?> $1 < @ $2 > strip trailing dots
1089R<?> $- < @ $* > $: <?> $(dequote $1 $) < @ $2 > dequote local part
1090
1091# if no $=O character, no host in the user portion, we are done
1092R<?> $* $=O $* < @ $* > $: <NO> $1 $2 $3 < @ $4>
1093R<?> $* $@ $1
1094
1095
1096R<NO> $* < @ $* $=R > $: <RELAY> $1 < @ $2 $3 >
1097R<NO> $* < @ $+ > $: $>D <$2> <NO> <+ To> <$1 < @ $2 >>
1098R<$+> <$+> $: <$1> $2
1099
1100
1101
1102R<RELAY> $* < @ $* > $@ $>ParseRecipient $1
1103R<$+> $* $@ $2
1104
1105
1106######################################################################
1107### check_relay -- check hostname/address on SMTP startup
1108######################################################################
1109
1110
1111
1112SLocal_check_relay
1113Scheck_relay
1114R$* $: $1 $| $>"Local_check_relay" $1
1115R$* $| $* $| $#$* $#$3
1116R$* $| $* $| $* $@ $>"Basic_check_relay" $1 $| $2
1117
1118SBasic_check_relay
1119# check for deferred delivery mode
1120R$* $: < $&{deliveryMode} > $1
1121R< d > $* $@ deferred
1122R< $* > $* $: $2
1123
1124R$+ $| $+ $: $>D < $1 > <?> <+ Connect> < $2 >
1125R $| $+ $: $>A < $1 > <?> <+ Connect> <> empty client_name
1126R<?> <$+> $: $>A < $1 > <?> <+ Connect> <> no: another lookup
1127R<?> <$*> $: OK found nothing
1128R<$={Accept}> <$*> $@ $1 return value of lookup
1129R<REJECT> <$*> $#error $@ 5.7.1 $: "550 Access denied"
1130R<DISCARD> <$*> $#discard $: discard
1131R<QUARANTINE:$+> <$*> $#error $@ quarantine $: $1
1132R<ERROR:$-.$-.$-:$+> <$*> $#error $@ $1.$2.$3 $: $4
1133R<ERROR:$+> <$*> $#error $: $1
1134R<$* <TMPF>> <$*> $#error $@ 4.3.0 $: "451 Temporary system failure. Please try again later."
1135R<$+> <$*> $#error $: $1
1136
1137
1138
1139######################################################################
1140### check_mail -- check SMTP `MAIL FROM:' command argument
1141######################################################################
1142
1143SLocal_check_mail
1144Scheck_mail
1145R$* $: $1 $| $>"Local_check_mail" $1
1146R$* $| $#$* $#$2
1147R$* $| $* $@ $>"Basic_check_mail" $1
1148
1149SBasic_check_mail
1150# check for deferred delivery mode
1151R$* $: < $&{deliveryMode} > $1
1152R< d > $* $@ deferred
1153R< $* > $* $: $2
1154
1155# authenticated?
1156R$* $: $1 $| $>"tls_client" $&{verify} $| MAIL
1157R$* $| $#$+ $#$2
1158R$* $| $* $: $1
1159
1160R<> $@ <OK> we MUST accept <> (RFC 1123)
1161R$+ $: <?> $1
1162R<?><$+> $: <@> <$1>
1163R<?>$+ $: <@> <$1>
1164R$* $: $&{daemon_flags} $| $1
1165R$* f $* $| <@> < $* @ $- > $: < ? $&{client_name} > < $3 @ $4 >
1166R$* u $* $| <@> < $* > $: <?> < $3 >
1167R$* $| $* $: $2
1168# handle case of @localhost on address
1169R<@> < $* @ localhost > $: < ? $&{client_name} > < $1 @ localhost >
1170R<@> < $* @ [127.0.0.1] >
1171 $: < ? $&{client_name} > < $1 @ [127.0.0.1] >
1172R<@> < $* @ localhost.$m >
1173 $: < ? $&{client_name} > < $1 @ localhost.$m >
1174R<@> < $* @ localhost.UUCP >
1175 $: < ? $&{client_name} > < $1 @ localhost.UUCP >
1176R<@> $* $: $1 no localhost as domain
1177R<? $=w> $* $: $2 local client: ok
1178R<? $+> <$+> $#error $@ 5.5.4 $: "553 Real domain name required for sender address"
1179R<?> $* $: $1
1180R$* $: <?> $>CanonAddr $1 canonify sender address and mark it
1181R<?> $* < @ $+ . > <?> $1 < @ $2 > strip trailing dots
1182# handle non-DNS hostnames (*.bitnet, *.decnet, *.uucp, etc)
1183R<?> $* < @ $* $=P > $: <OKR> $1 < @ $2 $3 >
1184R<?> $* < @ $j > $: <OKR> $1 < @ $j >
1185R<?> $* < @ $+ > $: <OKR> $1 < @ $2 > ... unresolvable OK
1186
1187# check sender address: user@address, user@, address
1188R<$+> $+ < @ $* > $: @<$1> <$2 < @ $3 >> $| <F:$2@$3> <U:$2@> <D:$3>
1189R<$+> $+ $: @<$1> <$2> $| <U:$2@>
1190R@ <$+> <$*> $| <$+> $: <@> <$1> <$2> $| $>SearchList <+ From> $| <$3> <>
1191R<@> <$+> <$*> $| <$*> $: <$3> <$1> <$2> reverse result
1192# retransform for further use
1193R<?> <$+> <$*> $: <$1> $2 no match
1194R<$+> <$+> <$*> $: <$1> $3 relevant result, keep it
1195
1196# handle case of no @domain on address
1197R<?> $* $: $&{daemon_flags} $| <?> $1
1198R$* u $* $| <?> $* $: <OKR> $3
1199R$* $| $* $: $2
1200R<?> $* $: < ? $&{client_addr} > $1
1201R<?> $* $@ <OKR> ...local unqualed ok
1202R<? $+> $* $#error $@ 5.5.4 $: "553 Domain name required for sender address " $&f
1203 ...remote is not
1204# check results
1205R<?> $* $: @ $1 mark address: nothing known about it
1206R<$={ResOk}> $* $@ <OKR> domain ok: stop
1207R<TEMP> $* $#error $@ 4.1.8 $: "451 Domain of sender address " $&f " does not resolve"
1208R<PERM> $* $#error $@ 5.1.8 $: "553 Domain of sender address " $&f " does not exist"
1209R<$={Accept}> $* $# $1 accept from access map
1210R<DISCARD> $* $#discard $: discard
1211R<QUARANTINE:$+> $* $#error $@ quarantine $: $1
1212R<REJECT> $* $#error $@ 5.7.1 $: "550 Access denied"
1213R<ERROR:$-.$-.$-:$+> $* $#error $@ $1.$2.$3 $: $4
1214R<ERROR:$+> $* $#error $: $1
1215R<<TMPF>> $* $#error $@ 4.3.0 $: "451 Temporary system failure. Please try again later."
1216R<$+> $* $#error $: $1 error from access db
1217
1218######################################################################
1219### check_rcpt -- check SMTP `RCPT TO:' command argument
1220######################################################################
1221
1222SLocal_check_rcpt
1223Scheck_rcpt
1224R$* $: $1 $| $>"Local_check_rcpt" $1
1225R$* $| $#$* $#$2
1226R$* $| $* $@ $>"Basic_check_rcpt" $1
1227
1228SBasic_check_rcpt
1229# empty address?
1230R<> $#error $@ nouser $: "553 User address required"
1231R$@ $#error $@ nouser $: "553 User address required"
1232# check for deferred delivery mode
1233R$* $: < $&{deliveryMode} > $1
1234R< d > $* $@ deferred
1235R< $* > $* $: $2
1236
1237
1238######################################################################
1239R$* $: $1 $| @ $>"Rcpt_ok" $1
1240R$* $| @ $#TEMP $+ $: $1 $| T $2
1241R$* $| @ $#$* $#$2
1242R$* $| @ RELAY $@ RELAY
1243R$* $| @ $* $: O $| $>"Relay_ok" $1
1244R$* $| T $+ $: T $2 $| $>"Relay_ok" $1
1245R$* $| $#TEMP $+ $#error $2
1246R$* $| $#$* $#$2
1247R$* $| RELAY $@ RELAY
1248R T $+ $| $* $#error $1
1249# anything else is bogus
1250R$* $#error $@ 5.7.1 $: "550 Relaying denied"
1251
1252
1253######################################################################
1254### Rcpt_ok: is the recipient ok?
1255######################################################################
1256SRcpt_ok
1257R$* $: $>ParseRecipient $1 strip relayable hosts
1258
1259
1260
1261# blacklist local users or any host from receiving mail
1262R$* $: <?> $1
1263R<?> $+ < @ $=w > $: <> <$1 < @ $2 >> $| <F:$1@$2> <U:$1@> <D:$2>
1264R<?> $+ < @ $* > $: <> <$1 < @ $2 >> $| <F:$1@$2> <D:$2>
1265R<?> $+ $: <> <$1> $| <U:$1@>
1266R<> <$*> $| <$+> $: <@> <$1> $| $>SearchList <+ To> $| <$2> <>
1267R<@> <$*> $| <$*> $: <$2> <$1> reverse result
1268R<?> <$*> $: @ $1 mark address as no match
1269R<$={Accept}> <$*> $: @ $2 mark address as no match
1270
1271R<REJECT> $* $#error $@ 5.2.1 $: "550 Mailbox disabled for this recipient"
1272R<DISCARD> $* $#discard $: discard
1273R<QUARANTINE:$+> $* $#error $@ quarantine $: $1
1274R<ERROR:$-.$-.$-:$+> $* $#error $@ $1.$2.$3 $: $4
1275R<ERROR:$+> $* $#error $: $1
1276R<<TMPF>> $* $#error $@ 4.3.0 $: "451 Temporary system failure. Please try again later."
1277R<$+> $* $#error $: $1 error from access db
1278R@ $* $1 remove mark
1279
1280# authenticated via TLS?
1281R$* $: $1 $| $>RelayTLS client authenticated?
1282R$* $| $# $+ $# $2 error/ok?
1283R$* $| $* $: $1 no
1284
1285R$* $: $1 $| $>"Local_Relay_Auth" $&{auth_type}
1286R$* $| $# $* $# $2
1287R$* $| NO $: $1
1288R$* $| $* $: $1 $| $&{auth_type}
1289R$* $| $: $1
1290R$* $| $={TrustAuthMech} $# RELAY
1291R$* $| $* $: $1
1292# anything terminating locally is ok
1293R$+ < @ $=w > $@ RELAY
1294R$+ < @ $* $=R > $@ RELAY
1295R$+ < @ $+ > $: $>D <$2> <?> <+ To> <$1 < @ $2 >>
1296R<RELAY> $* $@ RELAY
1297R<$* <TMPF>> $* $#TEMP $@ 4.3.0 $: "451 Temporary system failure. Please try again later."
1298R<$*> <$*> $: $2
1299
1300
1301
1302# check for local user (i.e. unqualified address)
1303R$* $: <?> $1
1304R<?> $* < @ $+ > $: <REMOTE> $1 < @ $2 >
1305# local user is ok
1306R<?> $+ $@ RELAY
1307R<$+> $* $: $2
1308
1309######################################################################
1310### Relay_ok: is the relay/sender ok?
1311######################################################################
1312SRelay_ok
1313# anything originating locally is ok
1314# check IP address
1315R$* $: $&{client_addr}
1316R$@ $@ RELAY originated locally
1317R0 $@ RELAY originated locally
1318R127.0.0.1 $@ RELAY originated locally
1319RIPv6:::1 $@ RELAY originated locally
1320R$=R $* $@ RELAY relayable IP address
1321R$* $: $>A <$1> <?> <+ Connect> <$1>
1322R<RELAY> $* $@ RELAY relayable IP address
1323
1324R<<TMPF>> $* $#TEMP $@ 4.3.0 $: "451 Temporary system failure. Please try again later."
1325R<$*> <$*> $: $2
1326R$* $: [ $1 ] put brackets around it...
1327R$=w $@ RELAY ... and see if it is local
1328
1329
1330# check client name: first: did it resolve?
1331R$* $: < $&{client_resolve} >
1332R<TEMP> $#TEMP $@ 4.4.0 $: "450 Relaying temporarily denied. Cannot resolve PTR record for " $&{client_addr}
1333R<FORGED> $#error $@ 5.7.1 $: "550 Relaying denied. IP name possibly forged " $&{client_name}
1334R<FAIL> $#error $@ 5.7.1 $: "550 Relaying denied. IP name lookup failed " $&{client_name}
1335R$* $: <@> $&{client_name}
1336# pass to name server to make hostname canonical
1337R<@> $* $=P $:<?> $1 $2
1338R<@> $+ $:<?> $[ $1 $]
1339R$* . $1 strip trailing dots
1340R<?> $=w $@ RELAY
1341R<?> $* $=R $@ RELAY
1342R<?> $* $: $>D <$1> <?> <+ Connect> <$1>
1343R<RELAY> $* $@ RELAY
1344R<$* <TMPF>> $* $#TEMP $@ 4.3.0 $: "451 Temporary system failure. Please try again later."
1345R<$*> <$*> $: $2
1346
1347
1348######################################################################
1349### F: LookUpFull -- search for an entry in access database
1350###
1351### lookup of full key (which should be an address) and
1352### variations if +detail exists: +* and without +detail
1353###
1354### Parameters:
1355### <$1> -- key
1356### <$2> -- default (what to return if not found in db)
1357### <$3> -- mark (must be <(!|+) single-token>)
1358### ! does lookup only with tag
1359### + does lookup with and without tag
1360### <$4> -- passthru (additional data passed unchanged through)
1361######################################################################
1362
1363SF
1364R<$+> <$*> <$- $-> <$*> $: <$(access $4:$1 $: ? $)> <$1> <$2> <$3 $4> <$5>
1365R<?> <$+> <$*> <+ $-> <$*> $: <$(access $1 $: ? $)> <$1> <$2> <+ $3> <$4>
1366R<?> <$+ + $* @ $+> <$*> <$- $-> <$*>
1367 $: <$(access $6:$1+*@$3 $: ? $)> <$1+$2@$3> <$4> <$5 $6> <$7>
1368R<?> <$+ + $* @ $+> <$*> <+ $-> <$*>
1369 $: <$(access $1+*@$3 $: ? $)> <$1+$2@$3> <$4> <+ $5> <$6>
1370R<?> <$+ + $* @ $+> <$*> <$- $-> <$*>
1371 $: <$(access $6:$1@$3 $: ? $)> <$1+$2@$3> <$4> <$5 $6> <$7>
1372R<?> <$+ + $* @ $+> <$*> <+ $-> <$*>
1373 $: <$(access $1@$3 $: ? $)> <$1+$2@$3> <$4> <+ $5> <$6>
1374R<?> <$+> <$*> <$- $-> <$*> $@ <$2> <$5>
1375R<$+ <TMPF>> <$*> <$- $-> <$*> $@ <<TMPF>> <$5>
1376R<$+> <$*> <$- $-> <$*> $@ <$1> <$5>
1377
1378######################################################################
1379### E: LookUpExact -- search for an entry in access database
1380###
1381### Parameters:
1382### <$1> -- key
1383### <$2> -- default (what to return if not found in db)
1384### <$3> -- mark (must be <(!|+) single-token>)
1385### ! does lookup only with tag
1386### + does lookup with and without tag
1387### <$4> -- passthru (additional data passed unchanged through)
1388######################################################################
1389
1390SE
1391R<$*> <$*> <$- $-> <$*> $: <$(access $4:$1 $: ? $)> <$1> <$2> <$3 $4> <$5>
1392R<?> <$+> <$*> <+ $-> <$*> $: <$(access $1 $: ? $)> <$1> <$2> <+ $3> <$4>
1393R<?> <$+> <$*> <$- $-> <$*> $@ <$2> <$5>
1394R<$+ <TMPF>> <$*> <$- $-> <$*> $@ <<TMPF>> <$5>
1395R<$+> <$*> <$- $-> <$*> $@ <$1> <$5>
1396
1397######################################################################
1398### U: LookUpUser -- search for an entry in access database
1399###
1400### lookup of key (which should be a local part) and
1401### variations if +detail exists: +* and without +detail
1402###
1403### Parameters:
1404### <$1> -- key (user@)
1405### <$2> -- default (what to return if not found in db)
1406### <$3> -- mark (must be <(!|+) single-token>)
1407### ! does lookup only with tag
1408### + does lookup with and without tag
1409### <$4> -- passthru (additional data passed unchanged through)
1410######################################################################
1411
1412SU
1413R<$+> <$*> <$- $-> <$*> $: <$(access $4:$1 $: ? $)> <$1> <$2> <$3 $4> <$5>
1414R<?> <$+> <$*> <+ $-> <$*> $: <$(access $1 $: ? $)> <$1> <$2> <+ $3> <$4>
1415R<?> <$+ + $* @> <$*> <$- $-> <$*>
1416 $: <$(access $5:$1+*@ $: ? $)> <$1+$2@> <$3> <$4 $5> <$6>
1417R<?> <$+ + $* @> <$*> <+ $-> <$*>
1418 $: <$(access $1+*@ $: ? $)> <$1+$2@> <$3> <+ $4> <$5>
1419R<?> <$+ + $* @> <$*> <$- $-> <$*>
1420 $: <$(access $5:$1@ $: ? $)> <$1+$2@> <$3> <$4 $5> <$6>
1421R<?> <$+ + $* @> <$*> <+ $-> <$*>
1422 $: <$(access $1@ $: ? $)> <$1+$2@> <$3> <+ $4> <$5>
1423R<?> <$+> <$*> <$- $-> <$*> $@ <$2> <$5>
1424R<$+ <TMPF>> <$*> <$- $-> <$*> $@ <<TMPF>> <$5>
1425R<$+> <$*> <$- $-> <$*> $@ <$1> <$5>
1426
1427######################################################################
1428### SearchList: search a list of items in the access map
1429### Parameters:
1430### <exact tag> $| <mark:address> <mark:address> ... <>
1431### where "exact" is either "+" or "!":
1432### <+ TAG> lookup with and w/o tag
1433### <! TAG> lookup with tag
1434### possible values for "mark" are:
1435### D: recursive host lookup (LookUpDomain)
1436### E: exact lookup, no modifications
1437### F: full lookup, try user+ext@domain and user@domain
1438### U: user lookup, try user+ext and user (input must have trailing @)
1439### return: <RHS of lookup> or <?> (not found)
1440######################################################################
1441
1442# class with valid marks for SearchList
1443C{Src}E F D U
1444SSearchList
1445# just call the ruleset with the name of the tag... nice trick...
1446R<$+> $| <$={Src}:$*> <$*> $: <$1> $| <$4> $| $>$2 <$3> <?> <$1> <>
1447R<$+> $| <> $| <?> <> $@ <?>
1448R<$+> $| <$+> $| <?> <> $@ $>SearchList <$1> $| <$2>
1449R<$+> $| <$*> $| <$+> <> $@ <$3>
1450R<$+> $| <$+> $@ <$2>
1451
1452
1453######################################################################
1454### trust_auth: is user trusted to authenticate as someone else?
1455###
1456### Parameters:
1457### $1: AUTH= parameter from MAIL command
1458######################################################################
1459
1460SLocal_trust_auth
1461Strust_auth
1462R$* $: $&{auth_type} $| $1
1463# required by RFC 2554 section 4.
1464R$@ $| $* $#error $@ 5.7.1 $: "550 not authenticated"
1465R$* $| $&{auth_authen} $@ identical
1466R$* $| <$&{auth_authen}> $@ identical
1467R$* $| $* $: $1 $| $>"Local_trust_auth" $2
1468R$* $| $#$* $#$2
1469R$* $#error $@ 5.7.1 $: "550 " $&{auth_authen} " not allowed to act as " $&{auth_author}
1470
1471######################################################################
1472### Relay_Auth: allow relaying based on authentication?
1473###
1474### Parameters:
1475### $1: ${auth_type}
1476######################################################################
1477SLocal_Relay_Auth
1478
1479######################################################################
1480### srv_features: which features to offer to a client?
1481### (done in server)
1482######################################################################
1483Ssrv_features
1484R$* $: $>D <$&{client_name}> <?> <! "Srv_Features"> <>
1485R<?>$* $: $>A <$&{client_addr}> <?> <! "Srv_Features"> <>
1486R<?>$* $: <$(access "Srv_Features": $: ? $)>
1487R<?>$* $@ OK
1488R<$* <TMPF>>$* $#temp
1489R<$+>$* $# $1
1490
1491######################################################################
1492### try_tls: try to use STARTTLS?
1493### (done in client)
1494######################################################################
1495Stry_tls
1496R$* $: $>D <$&{server_name}> <?> <! "Try_TLS"> <>
1497R<?>$* $: $>A <$&{server_addr}> <?> <! "Try_TLS"> <>
1498R<?>$* $: <$(access "Try_TLS": $: ? $)>
1499R<?>$* $@ OK
1500R<$* <TMPF>>$* $#error $@ 4.3.0 $: "451 Temporary system failure. Please try again later."
1501R<NO>$* $#error $@ 5.7.1 $: "550 do not try TLS with " $&{server_name} " ["$&{server_addr}"]"
1502
1503######################################################################
1504### tls_rcpt: is connection with server "good" enough?
1505### (done in client, per recipient)
1506###
1507### Parameters:
1508### $1: recipient
1509######################################################################
1510Stls_rcpt
1511R$* $: $(macro {TLS_Name} $@ $&{server_name} $) $1
1512R$+ $: <?> $>CanonAddr $1
1513R<?> $+ < @ $+ . > <?> $1 <@ $2 >
1514R<?> $+ < @ $+ > $: $1 <@ $2 > $| <F:$1@$2> <U:$1@> <D:$2> <E:>
1515R<?> $+ $: $1 $| <U:$1@> <E:>
1516R$* $| $+ $: $1 $| $>SearchList <! "TLS_Rcpt"> $| $2 <>
1517R$* $| <?> $@ OK
1518R$* $| <$* <TMPF>> $#error $@ 4.3.0 $: "451 Temporary system failure. Please try again later."
1519R$* $| <$+> $@ $>"TLS_connection" $&{verify} $| <$2>
1520
1521######################################################################
1522### tls_client: is connection with client "good" enough?
1523### (done in server)
1524###
1525### Parameters:
1526### ${verify} $| (MAIL|STARTTLS)
1527######################################################################
1528Stls_client
1529R$* $: $(macro {TLS_Name} $@ $&{server_name} $) $1
1530R$* $| $* $: $1 $| $>D <$&{client_name}> <?> <! "TLS_Clt"> <>
1531R$* $| <?>$* $: $1 $| $>A <$&{client_addr}> <?> <! "TLS_Clt"> <>
1532R$* $| <?>$* $: $1 $| <$(access "TLS_Clt": $: ? $)>
1533R$* $| <$* <TMPF>> $#error $@ 4.3.0 $: "451 Temporary system failure. Please try again later."
1534R$* $@ $>"TLS_connection" $1
1535
1536######################################################################
1537### tls_server: is connection with server "good" enough?
1538### (done in client)
1539###
1540### Parameter:
1541### ${verify}
1542######################################################################
1543Stls_server
1544R$* $: $(macro {TLS_Name} $@ $&{server_name} $) $1
1545R$* $: $1 $| $>D <$&{server_name}> <?> <! "TLS_Srv"> <>
1546R$* $| <?>$* $: $1 $| $>A <$&{server_addr}> <?> <! "TLS_Srv"> <>
1547R$* $| <?>$* $: $1 $| <$(access "TLS_Srv": $: ? $)>
1548R$* $| <$* <TMPF>> $#error $@ 4.3.0 $: "451 Temporary system failure. Please try again later."
1549R$* $@ $>"TLS_connection" $1
1550
1551######################################################################
1552### TLS_connection: is TLS connection "good" enough?
1553###
1554### Parameters:
1555### ${verify} $| <Requirement> [<>]
1556### Requirement: RHS from access map, may be ? for none.
1557######################################################################
1558STLS_connection
1559R$* $| <$*>$* $: $1 $| <$2>
1560# create the appropriate error codes
1561R$* $| <PERM + $={Tls} $*> $: $1 $| <503:5.7.0> <$2 $3>
1562R$* $| <TEMP + $={Tls} $*> $: $1 $| <403:4.7.0> <$2 $3>
1563R$* $| <$={Tls} $*> $: $1 $| <403:4.7.0> <$2 $3>
1564# deal with TLS handshake failures: abort
1565RSOFTWARE $| <$-:$+> $* $#error $@ $2 $: $1 " TLS handshake failed."
1566RSOFTWARE $| $* $#error $@ 4.7.0 $: "403 TLS handshake failed."
1567R$* $| <$*> <VERIFY> $: <$2> <VERIFY> <> $1
1568R$* $| <$*> <VERIFY + $+> $: <$2> <VERIFY> <$3> $1
1569R$* $| <$*> <$={Tls}:$->$* $: <$2> <$3:$4> <> $1
1570R$* $| <$*> <$={Tls}:$- + $+>$* $: <$2> <$3:$4> <$5> $1
1571R$* $| $* $@ OK
1572# authentication required: give appropriate error
1573# other side did authenticate (via STARTTLS)
1574R<$*><VERIFY> <> OK $@ OK
1575R<$*><VERIFY> <$+> OK $: <$1> <REQ:0> <$2>
1576R<$*><VERIFY:$-> <$*> OK $: <$1> <REQ:$2> <$3>
1577R<$*><ENCR:$-> <$*> $* $: <$1> <REQ:$2> <$3>
1578R<$-:$+><VERIFY $*> <$*> $#error $@ $2 $: $1 " authentication required"
1579R<$-:$+><VERIFY $*> <$*> FAIL $#error $@ $2 $: $1 " authentication failed"
1580R<$-:$+><VERIFY $*> <$*> NO $#error $@ $2 $: $1 " not authenticated"
1581R<$-:$+><VERIFY $*> <$*> NOT $#error $@ $2 $: $1 " no authentication requested"
1582R<$-:$+><VERIFY $*> <$*> NONE $#error $@ $2 $: $1 " other side does not support STARTTLS"
1583R<$-:$+><VERIFY $*> <$*> $+ $#error $@ $2 $: $1 " authentication failure " $4
1584R<$*><REQ:$-> <$*> $: <$1> <REQ:$2> <$3> $>max $&{cipher_bits} : $&{auth_ssf}
1585R<$*><REQ:$-> <$*> $- $: <$1> <$2:$4> <$3> $(arith l $@ $4 $@ $2 $)
1586R<$-:$+><$-:$-> <$*> TRUE $#error $@ $2 $: $1 " encryption too weak " $4 " less than " $3
1587R<$-:$+><$-:$-> <$*> $* $: <$1:$2 ++ $5>
1588R<$-:$+ ++ > $@ OK
1589R<$-:$+ ++ $+ > $: <$1:$2> <$3>
1590R<$-:$+> < $+ ++ $+ > <$1:$2> <$3> <$4>
1591R<$-:$+> $+ $@ $>"TLS_req" $3 $| <$1:$2>
1592
1593######################################################################
1594### TLS_req: check additional TLS requirements
1595###
1596### Parameters: [<list> <of> <req>] $| <$-:$+>
1597### $-: SMTP reply code
1598### $+: Enhanced Status Code
1599######################################################################
1600STLS_req
1601R $| $+ $@ OK
1602R<CN> $* $| <$+> $: <CN:$&{TLS_Name}> $1 $| <$2>
1603R<CN:$&{cn_subject}> $* $| <$+> $@ $>"TLS_req" $1 $| <$2>
1604R<CN:$+> $* $| <$-:$+> $#error $@ $4 $: $3 " CN " $&{cn_subject} " does not match " $1
1605R<CS:$&{cert_subject}> $* $| <$+> $@ $>"TLS_req" $1 $| <$2>
1606R<CS:$+> $* $| <$-:$+> $#error $@ $4 $: $3 " Cert Subject " $&{cert_subject} " does not match " $1
1607R<CI:$&{cert_issuer}> $* $| <$+> $@ $>"TLS_req" $1 $| <$2>
1608R<CI:$+> $* $| <$-:$+> $#error $@ $4 $: $3 " Cert Issuer " $&{cert_issuer} " does not match " $1
1609ROK $@ OK
1610
1611######################################################################
1612### max: return the maximum of two values separated by :
1613###
1614### Parameters: [$-]:[$-]
1615######################################################################
1616Smax
1617R: $: 0
1618R:$- $: $1
1619R$-: $: $1
1620R$-:$- $: $(arith l $@ $1 $@ $2 $) : $1 : $2
1621RTRUE:$-:$- $: $2
1622R$-:$-:$- $: $2
1623
1624
1625######################################################################
1626### RelayTLS: allow relaying based on TLS authentication
1627###
1628### Parameters:
1629### none
1630######################################################################
1631SRelayTLS
1632# authenticated?
1633R$* $: <?> $&{verify}
1634R<?> OK $: OK authenticated: continue
1635R<?> $* $@ NO not authenticated
1636R$* $: $&{cert_issuer}
1637R$+ $: $(access CERTISSUER:$1 $)
1638RRELAY $# RELAY
1639RSUBJECT $: <@> $&{cert_subject}
1640R<@> $+ $: <@> $(access CERTSUBJECT:$1 $)
1641R<@> RELAY $# RELAY
1642R$* $: NO
1643
1644######################################################################
1645### authinfo: lookup authinfo in the access map
1646###
1647### Parameters:
1648### $1: {server_name}
1649### $2: {server_addr}
1650######################################################################
1651Sauthinfo
1652R$* $: $1 $| $>D <$&{server_name}> <?> <! AuthInfo> <>
1653R$* $| <?>$* $: $1 $| $>A <$&{server_addr}> <?> <! AuthInfo> <>
1654R$* $| <?>$* $: $1 $| <$(access AuthInfo: $: ? $)> <>
1655R$* $| <?>$* $@ no no authinfo available
1656R$* $| <$*> <> $# $2
1657
1658
1659
1660
1661
1662#
1663######################################################################
1664######################################################################
1665#####
1666##### MAIL FILTER DEFINITIONS
1667#####
1668######################################################################
1669######################################################################
1670
1671#
1672######################################################################
1673######################################################################
1674#####
1675##### MAILER DEFINITIONS
1676#####
1677######################################################################
1678######################################################################
1679
1680#####################################
1681### SMTP Mailer specification ###
1682#####################################
1683
1684##### $Id: smtp.m4,v 8.64 2001/04/03 01:52:54 gshapiro Exp $ #####
1685
1686#
1687# common sender and masquerading recipient rewriting
1688#
1689SMasqSMTP
1690R$* < @ $* > $* $@ $1 < @ $2 > $3 already fully qualified
1691R$+ $@ $1 < @ *LOCAL* > add local qualification
1692
1693#
1694# convert pseudo-domain addresses to real domain addresses
1695#
1696SPseudoToReal
1697
1698# pass <route-addr>s through
1699R< @ $+ > $* $@ < @ $1 > $2 resolve <route-addr>
1700
1701# output fake domains as user%fake@relay
1702
1703# do UUCP heuristics; note that these are shared with UUCP mailers
1704R$+ < @ $+ .UUCP. > $: < $2 ! > $1 convert to UUCP form
1705R$+ < @ $* > $* $@ $1 < @ $2 > $3 not UUCP form
1706
1707# leave these in .UUCP form to avoid further tampering
1708R< $&h ! > $- ! $+ $@ $2 < @ $1 .UUCP. >
1709R< $&h ! > $-.$+ ! $+ $@ $3 < @ $1.$2 >
1710R< $&h ! > $+ $@ $1 < @ $&h .UUCP. >
1711R< $+ ! > $+ $: $1 ! $2 < @ $Y > use UUCP_RELAY
1712R$+ < @ $~[ $* : $+ > $@ $1 < @ $4 > strip mailer: part
1713R$+ < @ > $: $1 < @ *LOCAL* > if no UUCP_RELAY
1714
1715
1716#
1717# envelope sender rewriting
1718#
1719SEnvFromSMTP
1720R$+ $: $>PseudoToReal $1 sender/recipient common
1721R$* :; <@> $@ list:; special case
1722R$* $: $>MasqSMTP $1 qualify unqual'ed names
1723R$+ $: $>MasqEnv $1 do masquerading
1724
1725
1726#
1727# envelope recipient rewriting --
1728# also header recipient if not masquerading recipients
1729#
1730SEnvToSMTP
1731R$+ $: $>PseudoToReal $1 sender/recipient common
1732R$+ $: $>MasqSMTP $1 qualify unqual'ed names
1733R$* < @ *LOCAL* > $* $: $1 < @ $j . > $2
1734
1735#
1736# header sender and masquerading header recipient rewriting
1737#
1738SHdrFromSMTP
1739R$+ $: $>PseudoToReal $1 sender/recipient common
1740R:; <@> $@ list:; special case
1741
1742# do special header rewriting
1743R$* <@> $* $@ $1 <@> $2 pass null host through
1744R< @ $* > $* $@ < @ $1 > $2 pass route-addr through
1745R$* $: $>MasqSMTP $1 qualify unqual'ed names
1746R$+ $: $>MasqHdr $1 do masquerading
1747
1748
1749#
1750# relay mailer header masquerading recipient rewriting
1751#
1752SMasqRelay
1753R$+ $: $>MasqSMTP $1
1754R$+ $: $>MasqHdr $1
1755
1756Msmtp, P=[IPC], F=mDFMuX, S=EnvFromSMTP/HdrFromSMTP, R=EnvToSMTP, E=\r\n, L=990,
1757 T=DNS/RFC822/SMTP,
1758 A=TCP $h
1759Mesmtp, P=[IPC], F=mDFMuXa, S=EnvFromSMTP/HdrFromSMTP, R=EnvToSMTP, E=\r\n, L=990,
1760 T=DNS/RFC822/SMTP,
1761 A=TCP $h
1762Msmtp8, P=[IPC], F=mDFMuX8, S=EnvFromSMTP/HdrFromSMTP, R=EnvToSMTP, E=\r\n, L=990,
1763 T=DNS/RFC822/SMTP,
1764 A=TCP $h
1765Mdsmtp, P=[IPC], F=mDFMuXa%, S=EnvFromSMTP/HdrFromSMTP, R=EnvToSMTP, E=\r\n, L=990,
1766 T=DNS/RFC822/SMTP,
1767 A=TCP $h
1768Mrelay, P=[IPC], F=mDFMuXa8, S=EnvFromSMTP/HdrFromSMTP, R=MasqSMTP, E=\r\n, L=2040,
1769 T=DNS/RFC822/SMTP,
1770 A=TCP $h
1771
1772
1773######################*****##############
1774### PROCMAIL Mailer specification ###
1775##################*****##################
1776
1777##### $Id: procmail.m4,v 8.22 2001/11/12 23:11:34 ca Exp $ #####
1778
1779Mprocmail, P=/usr/bin/procmail, F=DFMSPhnu9, S=EnvFromSMTP/HdrFromSMTP, R=EnvToSMTP/HdrFromSMTP,
1780 T=DNS/RFC822/X-Unix,
1781 A=procmail -Y -m $h $f $u
1782
1783
1784##################################################
1785### Local and Program Mailer specification ###
1786##################################################
1787
1788##### $Id: local.m4,v 8.58 2000/10/26 01:58:29 ca Exp $ #####
1789
1790#
1791# Envelope sender rewriting
1792#
1793SEnvFromL
1794R<@> $n errors to mailer-daemon
1795R@ <@ $*> $n temporarily bypass Sun bogosity
1796R$+ $: $>AddDomain $1 add local domain if needed
1797R$* $: $>MasqEnv $1 do masquerading
1798
1799#
1800# Envelope recipient rewriting
1801#
1802SEnvToL
1803R$+ < @ $* > $: $1 strip host part
1804
1805#
1806# Header sender rewriting
1807#
1808SHdrFromL
1809R<@> $n errors to mailer-daemon
1810R@ <@ $*> $n temporarily bypass Sun bogosity
1811R$+ $: $>AddDomain $1 add local domain if needed
1812R$* $: $>MasqHdr $1 do masquerading
1813
1814#
1815# Header recipient rewriting
1816#
1817SHdrToL
1818R$+ $: $>AddDomain $1 add local domain if needed
1819R$* < @ *LOCAL* > $* $: $1 < @ $j . > $2
1820
1821#
1822# Common code to add local domain name (only if always-add-domain)
1823#
1824SAddDomain
1825R$* < @ $* > $* $@ $1 < @ $2 > $3 already fully qualified
1826
1827R$+ $@ $1 < @ *LOCAL* > add local qualification
1828
1829Mlocal, P=/usr/bin/procmail, F=lsDFMAw5:/|@qSPfhn9, S=EnvFromL/HdrFromL, R=EnvToL/HdrToL,
1830 T=DNS/RFC822/X-Unix,
1831 A=procmail -t -Y -a $h -d $u
1832Mprog, P=/usr/sbin/smrsh, F=lsDFMoqeu9, S=EnvFromL/HdrFromL, R=EnvToL/HdrToL, D=$z:/,
1833 T=X-Unix/X-Unix/X-Unix,
1834 A=smrsh -c $u
1835
1836CGone-web.com
1837