由 cailinaaa 在 11-04-2004 19:08 发表:
txkss大哥入!请问大哥怎么解决OE收AS3.0sendmail邮件问题的
txkss大哥,小弟新手现在也是用AS3.0架设邮件服务器的时候遇见问题了,也是不能使用OE收邮件啊!急啊!大哥999999999999999999999
QQ:21102400
由 txkss 在 11-04-2004 23:24 发表:
基本收发还是很好实现的
就是深一些的不好搞了
由 txkss 在 11-04-2004 23:27 发表:
我没有遇到过在OE下收不到邮件的问题啊
只是在做SMTP认证时发不出去
不过后来解决了
由 txkss 在 11-04-2004 23:28 发表:
你把你做的步骤和改变的参数贴出来吧
我现在正被另外一大堆问题烦着呢
能帮你当然好了
由 cailinaaa 在 11-05-2004 08:40 发表:
在服务器上收发都很正常!可是用OE的时候就出现问题了。老是报指定服务器已找到,但服务器没有响应
由 cailinaaa 在 11-05-2004 11:42 发表:
Copyright (c) 1998-2003 Sendmail, Inc. and its suppliers.
All rights reserved.
Copyright (c) 1983, 1995 Eric P. Allman. All rights reserved.
Copyright (c) 1988, 1993
The Regents of the University of California. All rights reserved.
By using this file, you agree to the terms and conditions set
forth in the LICENSE file which can be found at the top level of
the sendmail distribution.
######################################################################
######################################################################
SENDMAIL CONFIGURATION FILE
built by [email protected] on 四 11月 4 18:26:00 CST 2004
in /etc/mail
using /usr/share/sendmail-cf/ as configuration include directory
######################################################################
DO NOT EDIT THIS FILE! Only edit the source .mc file.
######################################################################
######################################################################
$Id: cfhead.m4,v 8.108.2.3 2003/04/03 17:51:51 ca Exp $
$Id: cf.m4,v 8.32 1999/02/07 07:26:14 gshapiro Exp $
setup for Red Hat Linux
$Id: linux.m4,v 8.13 2000/09/17 17:30:00 gshapiro Exp $
$Id: local_procmail.m4,v 8.21.42.1 2002/11/17 04:25:07 ca Exp $
$Id: no_default_msa.m4,v 8.2 2001/02/14 05:03:22 gshapiro Exp $
$Id: smrsh.m4,v 8.14 1999/11/18 05:06:23 ca Exp $
$Id: mailertable.m4,v 8.23 2001/03/16 00:51:26 gshapiro Exp $
$Id: virtusertable.m4,v 8.21 2001/03/16 00:51:26 gshapiro Exp $
$Id: redirect.m4,v 8.15 1999/08/06 01:47:36 gshapiro Exp $
$Id: always_add_domain.m4,v 8.11 2000/09/12 22:00:53 ca Exp $
$Id: use_cw_file.m4,v 8.11 2001/08/26 20:58:57 gshapiro Exp $
$Id: use_ct_file.m4,v 8.11 2001/08/26 20:58:57 gshapiro Exp $
$Id: local_procmail.m4,v 8.21.42.1 2002/11/17 04:25:07 ca Exp $
$Id: access_db.m4,v 8.24 2002/03/06 21:50:25 ca Exp $
$Id: blacklist_recipients.m4,v 8.13 1999/04/02 02:25:13 gshapiro Exp $
$Id: accept_unresolvable_domains.m4,v 8.10 1999/02/07 07:26:07 gshapiro Exp $
$Id: proto.m4,v 8.649.2.24 2003/08/04 21:14:26 ca Exp $
level 10 config file format
V10/Berkeley
override file safeties - setting this option compromises system security,
addressing the actual file configuration problem is preferred
need to set this before any file actions are encountered in the cf file
#O DontBlameSendmail=safe
default LDAP map specification
need to set this now before any LDAP maps are defined
#O LDAPDefaultSpec=-h localhost
##################
local info
##################
my LDAP cluster
need to set this before any LDAP lookups are done (including classes)
#D{sendmailMTACluster}$m
Cwlocalhost
file containing names of hosts for which we receive email
Fw/etc/mail/local-host-names
my official domain name
... define this only if sendmail cannot automatically determine your domain
#Dj$w.Foo.COM
CP.
"Smart" relay host (may be null)
DS
operators that cannot be in local usernames (i.e., network indicators)
CO @ % !
a class with just dot (for identifying canonical names)
C..
a class with just a left bracket (for identifying domain literals)
C[[
access_db acceptance class
C{Accept}OK RELAY
C{ResOk}OKR
Hosts for which relaying is permitted ($=R)
FR-o /etc/mail/relay-domains
arithmetic map
Karith arith
macro storage map
Kmacro macro
possible values for TLS_connection in access map
C{tls}VERIFY ENCR
dequoting map
Kdequote dequote
class E: names that should be exposed as from this host, even if we masquerade
class L: names that should be delivered locally, even if we have a relay
class M: domains that should be converted to $M
class N: domains that should not be converted to $M
#CL root
C{TrustAuthMech}EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN
C{E}root
C{w}localhost.localdomain
my name for error messages
DnMAILER-DAEMON
Mailer table (overriding domains)
Kmailertable hash -o /etc/mail/mailertable.db
Virtual user table (maps incoming users)
Kvirtuser hash -o /etc/mail/virtusertable.db
CPREDIRECT
Access list database (for spam stomping)
Kaccess hash -T
1<tmpf> -o /etc/mail/access.db
2
3
4
5# Configuration version number
6
7DZ8.12.10
8
9
10
11
12
13###############
14
15# Options #
16
17###############
18
19
20
21# strip message body to 7 bits on input?
22
23O SevenBitInput=False
24
25
26
27# 8-bit data handling
28
29#O EightBitMode=pass8
30
31
32
33# wait for alias file rebuild (default units: minutes)
34
35O AliasWait=10
36
37
38
39# location of alias file
40
41O AliasFile=/etc/aliases
42
43
44
45# minimum number of free blocks on filesystem
46
47O MinFreeBlocks=100
48
49
50
51# maximum message size
52
53#O MaxMessageSize=1000000
54
55
56
57# substitution for space (blank) characters
58
59O BlankSub=.
60
61
62
63# avoid connecting to "expensive" mailers on initial submission?
64
65O HoldExpensive=False
66
67
68
69# checkpoint queue runs after every N successful deliveries
70
71#O CheckpointInterval=10
72
73
74
75# default delivery mode
76
77O DeliveryMode=background
78
79
80
81# error message header/file
82
83#O ErrorHeader=/etc/mail/error-header
84
85
86
87# error mode
88
89#O ErrorMode=print
90
91
92
93# save Unix-style "From_" lines at top of header?
94
95#O SaveFromLine=False
96
97
98
99# queue file mode (qf files)
100
101#O QueueFileMode=0600
102
103
104
105# temporary file mode
106
107O TempFileMode=0600
108
109
110
111# match recipients against GECOS field?
112
113#O MatchGECOS=False
114
115
116
117# maximum hop count
118
119#O MaxHopCount=25
120
121
122
123# location of help file
124
125O HelpFile=/etc/mail/helpfile
126
127
128
129# ignore dots as terminators in incoming messages?
130
131#O IgnoreDots=False
132
133
134
135# name resolver options
136
137#O ResolverOptions=+AAONLY
138
139
140
141# deliver MIME-encapsulated error messages?
142
143O SendMimeErrors=True
144
145
146
147# Forward file search path
148
149O ForwardPath=$z/.forward.$w:$z/.forward
150
151
152
153# open connection cache size
154
155O ConnectionCacheSize=2
156
157
158
159# open connection cache timeout
160
161O ConnectionCacheTimeout=5m
162
163
164
165# persistent host status directory
166
167#O HostStatusDirectory=.hoststat
168
169
170
171# single thread deliveries (requires HostStatusDirectory)?
172
173#O SingleThreadDelivery=False
174
175
176
177# use Errors-To: header?
178
179O UseErrorsTo=False
180
181
182
183# log level
184
185O LogLevel=9
186
187
188
189# send to me too, even in an alias expansion?
190
191#O MeToo=True
192
193
194
195# verify RHS in newaliases?
196
197O CheckAliases=False
198
199
200
201# default messages to old style headers if no special punctuation?
202
203O OldStyleHeaders=True
204
205
206
207# SMTP daemon options
208
209
210
211O DaemonPortOptions=Port=smtp,Addr=0.0.0.0, Name=MTA
212
213
214
215# SMTP client options
216
217O ClientPortOptions=Family=inet, Address=0.0.0.0
218
219
220
221# Modifiers to define {daemon_flags} for direct submissions
222
223#O DirectSubmissionModifiers
224
225
226
227# Use as mail submission program? See sendmail/SECURITY
228
229#O UseMSP
230
231
232
233# privacy flags
234
235O PrivacyOptions=authwarnings,novrfy,noexpn,restrictqrun
236
237
238
239# who (if anyone) should get extra copies of error messages
240
241#O PostmasterCopy=Postmaster
242
243
244
245# slope of queue-only function
246
247#O QueueFactor=600000
248
249
250
251# limit on number of concurrent queue runners
252
253#O MaxQueueChildren
254
255
256
257# maximum number of queue-runners per queue-grouping with multiple queues
258
259#O MaxRunnersPerQueue=1
260
261
262
263# priority of queue runners (nice(3))
264
265#O NiceQueueRun
266
267
268
269# shall we sort the queue by hostname first?
270
271#O QueueSortOrder=priority
272
273
274
275# minimum time in queue before retry
276
277#O MinQueueAge=30m
278
279
280
281# how many jobs can you process in the queue?
282
283#O MaxQueueRunSize=10000
284
285
286
287# perform initial split of envelope without checking MX records
288
289#O FastSplit=1
290
291
292
293# queue directory
294
295O QueueDirectory=/var/spool/mqueue
296
297
298
299# key for shared memory; 0 to turn off
300
301#O SharedMemoryKey=0
302
303
304
305
306
307
308
309# timeouts (many of these)
310
311#O Timeout.initial=5m
312
313O Timeout.connect=1m
314
315#O Timeout.aconnect=0s
316
317#O Timeout.iconnect=5m
318
319#O Timeout.helo=5m
320
321#O Timeout.mail=10m
322
323#O Timeout.rcpt=1h
324
325#O Timeout.datainit=5m
326
327#O Timeout.datablock=1h
328
329#O Timeout.datafinal=1h
330
331#O Timeout.rset=5m
332
333#O Timeout.quit=2m
334
335#O Timeout.misc=2m
336
337#O Timeout.command=1h
338
339O Timeout.ident=0
340
341#O Timeout.fileopen=60s
342
343#O Timeout.control=2m
344
345O Timeout.queuereturn=5d
346
347#O Timeout.queuereturn.normal=5d
348
349#O Timeout.queuereturn.urgent=2d
350
351#O Timeout.queuereturn.non-urgent=7d
352
353
354
355O Timeout.queuewarn=4h
356
357#O Timeout.queuewarn.normal=4h
358
359#O Timeout.queuewarn.urgent=1h
360
361#O Timeout.queuewarn.non-urgent=12h
362
363
364
365#O Timeout.hoststatus=30m
366
367#O Timeout.resolver.retrans=5s
368
369#O Timeout.resolver.retrans.first=5s
370
371#O Timeout.resolver.retrans.normal=5s
372
373#O Timeout.resolver.retry=4
374
375#O Timeout.resolver.retry.first=4
376
377#O Timeout.resolver.retry.normal=4
378
379#O Timeout.lhlo=2m
380
381#O Timeout.auth=10m
382
383#O Timeout.starttls=1h
384
385
386
387# time for DeliverBy; extension disabled if less than 0
388
389#O DeliverByMin=0
390
391
392
393# should we not prune routes in route-addr syntax addresses?
394
395#O DontPruneRoutes=False
396
397
398
399# queue up everything before forking?
400
401O SuperSafe=True
402
403
404
405# status file
406
407O StatusFile=/etc/mail/statistics
408
409
410
411# time zone handling:
412
413# if undefined, use system default
414
415# if defined but null, use TZ envariable passed in
416
417# if defined and non-null, use that info
418
419#O TimeZoneSpec=
420
421
422
423# default UID (can be username or userid:groupid)
424
425O DefaultUser=8:12
426
427
428
429# list of locations of user database file (null means no lookup)
430
431O UserDatabaseSpec=/etc/mail/userdb.db
432
433
434
435# fallback MX host
436
437#O FallbackMXhost=fall.back.host.net
438
439
440
441# if we are the best MX host for a site, try it directly instead of config err
442
443O TryNullMXList=true
444
445
446
447# load average at which we just queue messages
448
449#O QueueLA=8
450
451
452
453# load average at which we refuse connections
454
455#O RefuseLA=12
456
457
458
459# load average at which we delay connections; 0 means no limit
460
461#O DelayLA=0
462
463
464
465# maximum number of children we allow at one time
466
467#O MaxDaemonChildren=0
468
469
470
471# maximum number of new connections per second
472
473#O ConnectionRateThrottle=0
474
475
476
477# work recipient factor
478
479#O RecipientFactor=30000
480
481
482
483# deliver each queued job in a separate process?
484
485#O ForkEachJob=False
486
487
488
489# work class factor
490
491#O ClassFactor=1800
492
493
494
495# work time factor
496
497#O RetryFactor=90000
498
499
500
501# default character set
502
503#O DefaultCharSet=iso-8859-1
504
505
506
507# service switch file (name hardwired on Solaris, Ultrix, OSF/1, others)
508
509#O ServiceSwitchFile=/etc/mail/service.switch
510
511
512
513# hosts file (normally /etc/hosts)
514
515#O HostsFile=/etc/hosts
516
517
518
519# dialup line delay on connection failure
520
521#O DialDelay=10s
522
523
524
525# action to take if there are no recipients in the message
526
527#O NoRecipientAction=add-to-undisclosed
528
529
530
531# chrooted environment for writing to files
532
533#O SafeFileEnvironment=/arch
534
535
536
537# are colons OK in addresses?
538
539#O ColonOkInAddr=True
540
541
542
543# shall I avoid expanding CNAMEs (violates protocols)?
544
545#O DontExpandCnames=False
546
547
548
549# SMTP initial login message (old $e macro)
550
551O SmtpGreetingMessage=$j Sendmail $v/$Z; $b
552
553
554
555# UNIX initial From header format (old $l macro)
556
557O UnixFromLine=From $g $d
558
559
560
561# From: lines that have embedded newlines are unwrapped onto one line
562
563#O SingleLineFromHeader=False
564
565
566
567# Allow HELO SMTP command that does not include a host name
568
569#O AllowBogusHELO=False
570
571
572
573# Characters to be quoted in a full name phrase (@,;:\\()[] are automatic)
574
575#O MustQuoteChars=.
576
577
578
579# delimiter (operator) characters (old $o macro)
580
581O OperatorChars=.  @!^/[]+
582
583
584
585# shall I avoid calling initgroups(3) because of high NIS costs?
586
587#O DontInitGroups=False
588
589
590
591# are group-writable :include: and .forward files (un)trustworthy?
592
593# True (the default) means they are not trustworthy.
594
595#O UnsafeGroupWrites=True
596
597
598
599
600
601# where do errors that occur when sending errors get sent?
602
603#O DoubleBounceAddress=postmaster
604
605
606
607# where to save bounces if all else fails
608
609#O DeadLetterDrop=/var/tmp/dead.letter
610
611
612
613# what user id do we assume for the majority of the processing?
614
615#O RunAsUser=sendmail
616
617
618
619# maximum number of recipients per SMTP envelope
620
621#O MaxRecipientsPerMessage=100
622
623
624
625# limit the rate recipients per SMTP envelope are accepted
626
627# once the threshold number of recipients have been rejected
628
629#O BadRcptThrottle=20
630
631
632
633# shall we get local names from our installed interfaces?
634
635O DontProbeInterfaces=true
636
637
638
639# Return-Receipt-To: header implies DSN request
640
641#O RrtImpliesDsn=False
642
643
644
645# override connection address (for testing)
646
647#O ConnectOnlyTo=0.0.0.0
648
649
650
651# Trusted user for file ownership and starting the daemon
652
653#O TrustedUser=root
654
655
656
657# Control socket for daemon management
658
659#O ControlSocketName=/var/spool/mqueue/.control
660
661
662
663# Maximum MIME header length to protect MUAs
664
665#O MaxMimeHeaderLength=2048/1024
666
667
668
669# Maximum length of the sum of all headers
670
671#O MaxHeadersLength=32768
672
673
674
675# Maximum depth of alias recursion
676
677#O MaxAliasRecursion=10
678
679
680
681# location of pid file
682
683#O PidFile=/var/run/sendmail.pid
684
685
686
687# Prefix string for the process title shown on 'ps' listings
688
689#O ProcessTitlePrefix=prefix
690
691
692
693# Data file (df) memory-buffer file maximum size
694
695#O DataFileBufferSize=4096
696
697
698
699# Transcript file (xf) memory-buffer file maximum size
700
701#O XscriptFileBufferSize=4096
702
703
704
705# lookup type to find information about local mailboxes
706
707#O MailboxDatabase=pw
708
709
710
711# list of authentication mechanisms
712
713O AuthMechanisms=EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN
714
715
716
717# default authentication information for outgoing connections
718
719#O DefaultAuthInfo=/etc/mail/default-auth-info
720
721
722
723# SMTP AUTH flags
724
725O AuthOptions=A
726
727
728
729# SMTP AUTH maximum encryption strength
730
731#O AuthMaxBits
732
733
734
735# SMTP STARTTLS server options
736
737#O TLSSrvOptions
738
739
740
741# Input mail filters
742
743#O InputMailFilters
744
745
746
747
748
749# CA directory
750
751#O CACertPath
752
753# CA file
754
755#O CACertFile
756
757# Server Cert
758
759#O ServerCertFile
760
761# Server private key
762
763#O ServerKeyFile
764
765# Client Cert
766
767#O ClientCertFile
768
769# Client private key
770
771#O ClientKeyFile
772
773# DHParameters (only required if DSA/DH is used)
774
775#O DHParameters
776
777# Random data source (required for systems without /dev/urandom under OpenSSL)
778
779#O RandFile
780
781
782
783############################
784
785# QUEUE GROUP DEFINITIONS #
786
787############################
788
789
790
791
792
793###########################
794
795# Message precedences #
796
797###########################
798
799
800
801Pfirst-class=0
802
803Pspecial-delivery=100
804
805Plist=-30
806
807Pbulk=-60
808
809Pjunk=-100
810
811
812
813#####################
814
815# Trusted users #
816
817#####################
818
819
820
821# this is equivalent to setting class "t"
822
823Ft/etc/mail/trusted-users
824
825Troot
826
827Tdaemon
828
829Tuucp
830
831
832
833#########################
834
835# Format of headers #
836
837#########################
838
839
840
841H?P?Return-Path: <$g>
842
843HReceived: $?sfrom $s $.$?_($?s$|from $.$_)
844
845$.$?{auth_type}(authenticated$?{auth_ssf} bits=${auth_ssf}$.)
846
847$.by $j ($v/$Z)$?r with $r$. id $i$?{tls_version}
848
849(version=${tls_version} cipher=${cipher} bits=${cipher_bits} verify=${verify})$.$?u
850
851for $u; $|;
852
853$.$b
854
855H?D?Resent-Date: $a
856
857H?D?Date: $a
858
859H?F?Resent-From: $?x$x <$g>$|$g$.
860
861H?F?From: $?x$x <$g>$|$g$.
862
863H?x?Full-Name: $x
864
865# HPosted-Date: $a
866
867# H?l?Received-Date: $b
868
869H?M?Resent-Message-Id: <$t.$i@$j>
870
871H?M?Message-Id: <$t.$i@$j>
872
873
874
875#
876
877######################################################################
878
879######################################################################
880
881#####
882
883##### REWRITING RULES
884
885#####
886
887######################################################################
888
889######################################################################
890
891
892
893############################################
894
895### Ruleset 3 -- Name Canonicalization ###
896
897############################################
898
899Scanonify=3
900
901
902
903# handle null input (translate to <@> special case)
904
905R$@ $@ <@>
906
907
908
909# strip group: syntax (not inside angle brackets!) and trailing semicolon
910
911R$* $: $1 <@> mark addresses
912
913R$* < $* > $* <@> $: $1 < $2 > $3 unmark <addr>
914
915R@ $* <@> $: @ $1 unmark @host:...
916
917R$* [ IPv6 : $+ ] <@> $: $1 [ IPv6 : $2 ] unmark IPv6 addr
918
919R$* :: $* <@> $: $1 :: $2 unmark node::addr
920
921R:include: $* <@> $: :include: $1 unmark :include:...
922
923R$* : $* [ $* ] $: $1 : $2 [ $3 ] <@> remark if leading colon
924
925R$* : $* <@> $: $2 strip colon if marked
926
927R$* <@> $: $1 unmark
928
929R$* ; $1 strip trailing semi
930
931R$* < $+ :; > $* $@ $2 :; <@> catch <list:;>
932
933R$* < $* ; > $1 < $2 > bogus bracketed semi
934
935
936
937# null input now results from list:; syntax
938
939R$@ $@ :; <@>
940
941
942
943# strip angle brackets -- note RFC733 heuristic to get innermost item
944
945R$* $: < $1 > housekeeping <>
946
947R$+ < $* > < $2 > strip excess on left
948
949R< $* > $+ < $1 > strip excess on right
950
951R<> $@ < @ > MAIL FROM:<> case
952
953R< $+ > $: $1 remove housekeeping <>
954
955
956
957# strip route address <@a,@b,@c:user@d> -> <user@d>
958
959R@ $+ , $+ $2
960
961R@ [ $* ] : $+ $2
962
963R@ $+ : $+ $2
964
965
966
967# find focus for list syntax
968
969R $+ : $* ; @ $+ $@ $>Canonify2 $1 : $2 ; < @ $3 > list syntax
970
971R $+ : $* ; $@ $1 : $2; list syntax
972
973
974
975# find focus for @ syntax addresses
976
977R$+ @ $+ $: $1 < @ $2 > focus on domain
978
979R$+ < $+ @ $+ > $1 $2 < @ $3 > move gaze right
980
981R$+ < @ $+ > $@ $>Canonify2 $1 < @ $2 > already canonical
982
983
984
985
986
987# convert old-style addresses to a domain-based address
988
989R$- ! $+ $@ $>Canonify2 $2 < @ $1 .UUCP > resolve uucp names
990
991R$+ . $- ! $+ $@ $>Canonify2 $3 < @ $1 . $2 > domain uucps
992
993R$+ ! $+ $@ $>Canonify2 $2 < @ $1 .UUCP > uucp subdomains
994
995
996
997# if we have % signs, take the rightmost one
998
999R$* % $* $1 @ $2 First make them all @s.
1000
1001R$* @ $* @ $* $1 % $2 @ $3 Undo all but the last.
1002
1003R$* @ $* $@ $>Canonify2 $1 < @ $2 > Insert < > and finish
1004
1005
1006
1007# else we must be a local name
1008
1009R$* $@ $>Canonify2 $1
1010
1011
1012
1013
1014
1015################################################
1016
1017### Ruleset 96 -- bottom half of ruleset 3 ###
1018
1019################################################
1020
1021
1022
1023SCanonify2=96
1024
1025
1026
1027# handle special cases for local names
1028
1029R$* < @ localhost > $* $: $1 < @ $j . > $2 no domain at all
1030
1031R$* < @ localhost . $m > $* $: $1 < @ $j . > $2 local domain
1032
1033R$* < @ localhost . UUCP > $* $: $1 < @ $j . > $2 .UUCP domain
1034
1035
1036
1037# check for IPv4/IPv6 domain literal
1038
1039R$* < @ [ $+ ] > $* $: $1 < @@ [ $2 ] > $3 mark [addr]
1040
1041R$* < @@ $=w > $* $: $1 < @ $j . > $3 self-literal
1042
1043R$* < @@ $+ > $* $@ $1 < @ $2 > $3 canon IP addr
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055# if really UUCP, handle it immediately
1056
1057
1058
1059# try UUCP traffic as a local address
1060
1061R$* < @ $+ . UUCP > $* $: $1 < @ $[ $2 $] . UUCP . > $3
1062
1063R$* < @ $+ . . UUCP . > $* $@ $1 < @ $2 . > $3
1064
1065
1066
1067# hostnames ending in class P are always canonical
1068
1069R$* < @ $* $=P > $* $: $1 < @ $2 $3 . > $4
1070
1071R$* < @ $* $~P > $* $: $&{daemon_flags} $| $1 < @ $2 $3 > $4
1072
1073R$* CC $* $| $* < @ $+.$+ > $* $: $3 < @ $4.$5 . > $6
1074
1075R$* CC $* $| $* $: $3
1076
1077# pass to name server to make hostname canonical
1078
1079R$* $| $* < @ $* > $* $: $2 < @ $[ $3 $] > $4
1080
1081R$* $| $* $: $2
1082
1083
1084
1085# local host aliases and pseudo-domains are always canonical
1086
1087R$* < @ $=w > $* $: $1 < @ $2 . > $3
1088
1089R$* < @ $=M > $* $: $1 < @ $2 . > $3
1090
1091R$* < @ $={VirtHost} > $* $: $1 < @ $2 . > $3
1092
1093R$* < @ $* . . > $* $1 < @ $2 . > $3
1094
1095
1096
1097
1098
1099##################################################
1100
1101### Ruleset 4 -- Final Output Post-rewriting ###
1102
1103##################################################
1104
1105Sfinal=4
1106
1107
1108
1109R$+ :; <@> $@ $1 : handle <list:;>
1110
1111R$* <@> $@ handle <> and list:;
1112
1113
1114
1115# strip trailing dot off possibly canonical name
1116
1117R$* < @ $+ . > $* $1 < @ $2 > $3
1118
1119
1120
1121# eliminate internal code
1122
1123R$* < @ *LOCAL* > $* $1 < @ $j > $2
1124
1125
1126
1127# externalize local domain info
1128
1129R$* < $+ > $* $1 $2 $3 defocus
1130
1131R@ $+ : @ $+ : $+ @ $1 , @ $2 : $3 <route-addr> canonical
1132
1133R@ $* $@ @ $1 ... and exit
1134
1135
1136
1137# UUCP must always be presented in old form
1138
1139R$+ @ $- . UUCP $2!$1 [email protected] => h!u
1140
1141
1142
1143# delete duplicate local names
1144
1145R$+ % $=w @ $=w $1 @ $2 u%host@host => u@host
1146
1147
1148
1149
1150
1151
1152
1153##############################################################
1154
1155### Ruleset 97 -- recanonicalize and call ruleset zero ###
1156
1157### (used for recursive calls) ###
1158
1159##############################################################
1160
1161
1162
1163SRecurse=97
1164
1165R$* $: $>canonify $1
1166
1167R$* $@ $>parse $1
1168
1169
1170
1171
1172
1173######################################
1174
1175### Ruleset 0 -- Parse Address ###
1176
1177######################################
1178
1179
1180
1181Sparse=0
1182
1183
1184
1185R$* $: $>Parse0 $1 initial parsing
1186
1187R<@> $#local $: <@> special case error msgs
1188
1189R$* $: $>ParseLocal $1 handle local hacks
1190
1191R$* $: $>Parse1 $1 final parsing
1192
1193
1194
1195#
1196
1197# Parse0 -- do initial syntax checking and eliminate local addresses.
1198
1199# This should either return with the (possibly modified) input
1200
1201# or return with a #error mailer. It should not return with a
1202
1203# #mailer other than the #error mailer.
1204
1205#
1206
1207
1208
1209SParse0
1210
1211R<@> $@ <@> special case error msgs
1212
1213R$* : $* ; <@> $#error $@ 5.1.3 $: "553 List:; syntax illegal for recipient addresses"
1214
1215R@ <@ $* > < @ $1 > catch "@@host" bogosity
1216
1217R<@ $+> $#error $@ 5.1.3 $: "553 User address required"
1218
1219R$+ <@> $#error $@ 5.1.3 $: "553 Hostname required"
1220
1221R$* $: <> $1
1222
1223R<> $* < @ [ $* ] : $+ > $* $1 < @ [ $2 ] : $3 > $4
1224
1225R<> $* < @ [ $* ] , $+ > $* $1 < @ [ $2 ] , $3 > $4
1226
1227R<> $* < @ [ $* ] $+ > $* $#error $@ 5.1.2 $: "553 Invalid address"
1228
1229R<> $* < @ [ $+ ] > $* $1 < @ [ $2 ] > $3
1230
1231R<> $* <$* : $* > $* $#error $@ 5.1.3 $: "553 Colon illegal in host name part"
1232
1233R<> $* $1
1234
1235R$* < @ . $* > $* $#error $@ 5.1.2 $: "553 Invalid host name"
1236
1237R$* < @ $* .. $* > $* $#error $@ 5.1.2 $: "553 Invalid host name"
1238
1239R$* < @ $* @ > $* $#error $@ 5.1.2 $: "553 Invalid route address"
1240
1241R$* @ $* < @ $* > $* $#error $@ 5.1.3 $: "553 Invalid route address"
1242
1243R$* , $~O $* $#error $@ 5.1.3 $: "553 Invalid route address"
1244
1245
1246
1247
1248
1249# now delete the local info -- note $=O to find characters that cause forwarding
1250
1251R$* < @ > $* $@ $>Parse0 $>canonify $1 user@ => user
1252
1253R< @ $=w . > : $* $@ $>Parse0 $>canonify $2 @here:... -> ...
1254
1255R$- < @ $=w . > $: $(dequote $1 $) < @ $2 . > dequote "foo"@here
1256
1257R< @ $+ > $#error $@ 5.1.3 $: "553 User address required"
1258
1259R$* $=O $* < @ $=w . > $@ $>Parse0 $>canonify $1 $2 $3 ...@here -> ...
1260
1261R$- $: $(dequote $1 $) < @ *LOCAL* > dequote "foo"
1262
1263R< @ *LOCAL* > $#error $@ 5.1.3 $: "553 User address required"
1264
1265R$* $=O $* < @ *LOCAL* >
1266
1267$@ $>Parse0 $>canonify $1 $2 $3 ...@*LOCAL* -> ...
1268
1269R$* < @ *LOCAL* > $: $1
1270
1271
1272
1273#
1274
1275# Parse1 -- the bottom half of ruleset 0.
1276
1277#
1278
1279
1280
1281SParse1
1282
1283
1284
1285# handle numeric address spec
1286
1287R$* < @ [ $+ ] > $* $: $>ParseLocal $1 < @ [ $2 ] > $3 numeric internet spec
1288
1289R$* < @ [ $+ ] > $* $: $1 < @ [ $2 ] : $S > $3 Add smart host to path
1290
1291R$* < @ [ $+ ] : > $* $#esmtp $@ [$2] $: $1 < @ [$2] > $3 no smarthost: send
1292
1293R$* < @ [ $+ ] : $- : $*> $* $#$3 $@ $4 $: $1 < @ [$2] > $5 smarthost with mailer
1294
1295R$* < @ [ $+ ] : $+ > $* $#esmtp $@ $3 $: $1 < @ [$2] > $4 smarthost without mailer
1296
1297
1298
1299# handle virtual users
1300
1301R$+ $: <!-- --> $1 Mark for lookup
1302
1303R<!-- --> $+ < @ $={VirtHost} . > $: < $(virtuser $1 @ $2 $@ $1 $: @ $) > $1 < @ $2 . >
1304
1305R<!-- --> $+ < @ $=w . > $: < $(virtuser $1 @ $2 $@ $1 $: @ $) > $1 < @ $2 . >
1306
1307R<@> $+ + $+ < @ $* . >
1308
1309$: < $(virtuser $1 + + @ $3 $@ $1 $@ $2 $@ +$2 $: @ $) > $1 + $2 < @ $3 . >
1310
1311R<@> $+ + $* < @ $* . >
1312
1313$: < $(virtuser $1 + * @ $3 $@ $1 $@ $2 $@ +$2 $: @ $) > $1 + $2 < @ $3 . >
1314
1315R<@> $+ + $* < @ $* . >
1316
1317$: < $(virtuser $1 @ $3 $@ $1 $@ $2 $@ +$2 $: @ $) > $1 + $2 < @ $3 . >
1318
1319R<@> $+ + $+ < @ $+ . > $: < $(virtuser + + @ $3 $@ $1 $@ $2 $@ +$2 $: @ $) > $1 + $2 < @ $3 . >
1320
1321R<@> $+ + $* < @ $+ . > $: < $(virtuser + * @ $3 $@ $1 $@ $2 $@ +$2 $: @ $) > $1 + $2 < @ $3 . >
1322
1323R<@> $+ + $* < @ $+ . > $: < $(virtuser @ $3 $@ $1 $@ $2 $@ +$2 $: ! $) > $1 + $2 < @ $3 . >
1324
1325R<@> $+ < @ $+ . > $: < $(virtuser @ $2 $@ $1 $: @ $) > $1 < @ $2 . >
1326
1327R<@> $+ $: $1
1328
1329R<!-- --> $+ $: $1
1330
1331R< error : $-.$-.$- : $+ > $* $#error $@ $1.$2.$3 $: $4
1332
1333R< error : $- $+ > $* $#error $@ $(dequote $1 $) $: $2
1334
1335R< $+ > $+ < @ $+ > $: $>Recurse $1
1336
1337
1338
1339# short circuit local delivery so forwarded email works
1340
1341
1342
1343
1344
1345R$=L < @ $=w . > $#local $: @ $1 special local names
1346
1347R$+ < @ $=w . > $#local $: $1 regular local name
1348
1349
1350
1351# not local -- try mailer table lookup
1352
1353R$* <@ $+ > $* $: < $2 > $1 < @ $2 > $3 extract host name
1354
1355R< $+ . > $* $: < $1 > $2 strip trailing dot
1356
1357R< $+ > $* $: < $(mailertable $1 $) > $2 lookup
1358
1359R< $~[ : $* > $* $>MailerToTriple < $1 : $2 > $3 check -- resolved?
1360
1361R< $+ > $* $: $>Mailertable <$1> $2 try domain
1362
1363
1364
1365# resolve remotely connected UUCP links (if any)
1366
1367
1368
1369# resolve fake top level domains by forwarding to other hosts
1370
1371
1372
1373
1374
1375
1376
1377# pass names that still have a host to a smarthost (if defined)
1378
1379R$* < @ $* > $* $: $>MailerToTriple < $S > $1 < @ $2 > $3 glue on smarthost name
1380
1381
1382
1383# deal with other remote names
1384
1385R$* < @$* > $* $#esmtp $@ $2 $: $1 < @ $2 > $3 [email protected] in
1386
1387
1388
1389# handle locally delivered names
1390
1391R$=L $#local $: @ $1 special local names
1392
1393R$+ $#local $: $1 regular local names
1394
1395
1396
1397###########################################################################
1398
1399### Ruleset 5 -- special rewriting after aliases have been expanded ###
1400
1401###########################################################################
1402
1403
1404
1405SLocal_localaddr
1406
1407Slocaladdr=5
1408
1409R$+ $: $1 $| $>"Local_localaddr" $1
1410
1411R$+ $| $#ok $@ $1 no change
1412
1413R$+ $| $#$* $#$2
1414
1415R$+ $| $* $: $1
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425# deal with plussed users so aliases work nicely
1426
1427R$+ + * $#local $@ $&h $: $1
1428
1429R$+ + $* $#local $@ + $2 $: $1 + *
1430
1431
1432
1433# prepend an empty "forward host" on the front
1434
1435R$+ $: <> $1
1436
1437
1438
1439
1440
1441
1442
1443R< > $+ $: < > < $1 <> $&h > nope, restore +detail
1444
1445
1446
1447R< > < $+ <> \+ $* > $: < > < $1 + $2 > check whether +detail
1448
1449R< > < $+ <> $* > $: < > < $1 > else discard
1450
1451R< > < $+ + $* > $* < > < $1 > \+ $2 $3 find the user part
1452
1453R< > < $+ > \+ $* $#local $@ $2 $: @ $1 strip the extra +
1454
1455R< > < $+ > $@ $1 no +detail
1456
1457R$+ $: $1 <> $&h add +detail back in
1458
1459
1460
1461R$+ <> \+ $* $: $1 + $2 check whether +detail
1462
1463R$+ <> $* $: $1 else discard
1464
1465R< local : $* > $* $: $>MailerToTriple < local : $1 > $2 no host extension
1466
1467R< error : $* > $* $: $>MailerToTriple < error : $1 > $2 no host extension
1468
1469
1470
1471R< $~[ : $+ > $+ $: $>MailerToTriple < $1 : $2 > $3 < @ $2 >
1472
1473
1474
1475R< $+ > $+ $@ $>MailerToTriple < $1 > $2 < @ $1 >
1476
1477
1478
1479
1480
1481###################################################################
1482
1483### Ruleset 90 -- try domain part of mailertable entry ###
1484
1485###################################################################
1486
1487
1488
1489SMailertable=90
1490
1491R$* <$- . $+ > $* $: $1$2 < $(mailertable .$3 $@ $1$2 $@ $2 $) > $4
1492
1493R$* <$~[ : $* > $* $>MailerToTriple < $2 : $3 > $4 check -- resolved?
1494
1495R$* < . $+ > $* $@ $>Mailertable $1 . <$2> $3 no -- strip & try again
1496
1497R$* < $* > $* $: < $(mailertable . $@ $1$2 $) > $3 try "."
1498
1499R< $~[ : $* > $* $>MailerToTriple < $1 : $2 > $3 "." found?
1500
1501R< $* > $* $@ $2 no mailertable match
1502
1503
1504
1505###################################################################
1506
1507### Ruleset 95 -- canonify mailer:[user@]host syntax to triple ###
1508
1509###################################################################
1510
1511
1512
1513SMailerToTriple=95
1514
1515R< > $* $@ $1 strip off null relay
1516
1517R< error : $-.$-.$- : $+ > $* $#error $@ $1.$2.$3 $: $4
1518
1519R< error : $- : $+ > $* $#error $@ $(dequote $1 $) $: $2
1520
1521R< error : $+ > $* $#error $: $1
1522
1523R< local : $* > $* $>CanonLocal < $1 > $2
1524
1525R< $~[ : $+ @ $+ > $*<$*>$* $# $1 $@ $3 $: $2<@$3> use literal user
1526
1527R< $~[ : $+ > $* $# $1 $@ $2 $: $3 try qualified mailer
1528
1529R< $=w > $* $@ $2 delete local host
1530
1531R< $+ > $* $#relay $@ $1 $: $2 use unqualified mailer
1532
1533
1534
1535###################################################################
1536
1537### Ruleset CanonLocal -- canonify local: syntax ###
1538
1539###################################################################
1540
1541
1542
1543SCanonLocal
1544
1545# strip local host from routed addresses
1546
1547R< $* > < @ $+ > : $+ $@ $>Recurse $3
1548
1549R< $* > $+ $=O $+ < @ $+ > $@ $>Recurse $2 $3 $4
1550
1551
1552
1553# strip trailing dot from any host name that may appear
1554
1555R< $* > $* < @ $* . > $: < $1 > $2 < @ $3 >
1556
1557
1558
1559# handle local: syntax -- use old user, either with or without host
1560
1561R< > $* < @ $* > $* $#local $@ $1@$2 $: $1
1562
1563R< > $+ $#local $@ $1 $: $1
1564
1565
1566
1567# handle local:user@host syntax -- ignore host part
1568
1569R< $+ @ $+ > $* < @ $* > $: < $1 > $3 < @ $4 >
1570
1571
1572
1573# handle local:user syntax
1574
1575R< $+ > $* <@ $* > $* $#local $@ $2@$3 $: $1
1576
1577R< $+ > $* $#local $@ $2 $: $1
1578
1579
1580
1581###################################################################
1582
1583### Ruleset 93 -- convert header names to masqueraded form ###
1584
1585###################################################################
1586
1587
1588
1589SMasqHdr=93
1590
1591
1592
1593
1594
1595# do not masquerade anything in class N
1596
1597R$* < @ $* $=N . > $@ $1 < @ $2 $3 . >
1598
1599
1600
1601R$* < @ *LOCAL* > $@ $1 < @ $j . >
1602
1603
1604
1605###################################################################
1606
1607### Ruleset 94 -- convert envelope names to masqueraded form ###
1608
1609###################################################################
1610
1611
1612
1613SMasqEnv=94
1614
1615R$* < @ *LOCAL* > $* $: $1 < @ $j . > $2
1616
1617
1618
1619###################################################################
1620
1621### Ruleset 98 -- local part of ruleset zero (can be null) ###
1622
1623###################################################################
1624
1625
1626
1627SParseLocal=98
1628
1629
1630
1631# addresses sent to [email protected] RECT will give a 551 error code
1632
1633R$* < @ $+ .REDIRECT. > $: $1 < @ $2 . REDIRECT . > < ${opMode} >
1634
1635R$* < @ $+ .REDIRECT. > <i> $: $1 < @ $2 . REDIRECT. >
1636
1637R$* < @ $+ .REDIRECT. > < $- > $#error $@ 5.1.1 $: "551 User has moved; please try " <$1@$2>
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647######################################################################
1648
1649### D: LookUpDomain -- search for domain in access database
1650
1651###
1652
1653### Parameters:
1654
1655### <$1> \-- key (domain name)
1656
1657### <$2> \-- default (what to return if not found in db)
1658
1659### <$3> \-- mark (must be <(!|+) single-token> )
1660
1661### ! does lookup only with tag
1662
1663### + does lookup with and without tag
1664
1665### <$4> \-- passthru (additional data passed unchanged through)
1666
1667######################################################################
1668
1669
1670
1671SD
1672
1673R<$*> <$+> <$- $-> <$*> $: < $(access $4:$1 $: ? $) > <$1> <$2> <$3 $4> <$5>
1674
1675R<? > <$+> <$+> <\+ $-> <$*> $: < $(access $1 $: ? $) > <$1> <$2> <\+ $3> <$4>
1676
1677R<? > <[$+.$-]> <$+> <$- $-> <$*> $@ $>D <[$1]> <$3> <$4 $5> <$6>
1678
1679R<? > <[$+::$-]> <$+> <$- $-> <$*> $: $>D <[$1]> <$3> <$4 $5> <$6>
1680
1681R<? > <[$+:$-]> <$+> <$- $-> <$*> $: $>D <[$1]> <$3> <$4 $5> <$6>
1682
1683R<? > <$+.$+> <$+> <$- $-> <$*> $@ $>D <$2> <$3> <$4 $5> <$6>
1684
1685R<? > <$+> <$+> <$- $-> <$*> $@ <$2> <$5>
1686
1687R<$* <tmpf>> <$+> <$+> <$- $-> <$*> $@ <<tmpf>> <$6>
1688
1689R<$*> <$+> <$+> <$- $-> <$*> $@ <$1> <$6>
1690
1691
1692
1693######################################################################
1694
1695### A: LookUpAddress -- search for host address in access database
1696
1697###
1698
1699### Parameters:
1700
1701### <$1> \-- key (dot quadded host address)
1702
1703### <$2> \-- default (what to return if not found in db)
1704
1705### <$3> \-- mark (must be <(!|+) single-token> )
1706
1707### ! does lookup only with tag
1708
1709### + does lookup with and without tag
1710
1711### <$4> \-- passthru (additional data passed through)
1712
1713######################################################################
1714
1715
1716
1717SA
1718
1719R<$+> <$+> <$- $-> <$*> $: < $(access $4:$1 $: ? $) > <$1> <$2> <$3 $4> <$5>
1720
1721R<? > <$+> <$+> <\+ $-> <$*> $: < $(access $1 $: ? $) > <$1> <$2> <\+ $3> <$4>
1722
1723R<? > <$+::$-> <$+> <$- $-> <$*> $@ $>A <$1> <$3> <$4 $5> <$6>
1724
1725R<? > <$+:$-> <$+> <$- $-> <$*> $@ $>A <$1> <$3> <$4 $5> <$6>
1726
1727R<? > <$+.$-> <$+> <$- $-> <$*> $@ $>A <$1> <$3> <$4 $5> <$6>
1728
1729R<? > <$+> <$+> <$- $-> <$*> $@ <$2> <$5>
1730
1731R<$* <tmpf>> <$+> <$+> <$- $-> <$*> $@ <<tmpf>> <$6>
1732
1733R<$*> <$+> <$+> <$- $-> <$*> $@ <$1> <$6>
1734
1735
1736
1737######################################################################
1738
1739### CanonAddr -- Convert an address into a standard form for
1740
1741### relay checking. Route address syntax is
1742
1743### crudely converted into a %-hack address.
1744
1745###
1746
1747### Parameters:
1748
1749### $1 -- full recipient address
1750
1751###
1752
1753### Returns:
1754
1755### parsed address, not in source route form
1756
1757######################################################################
1758
1759
1760
1761SCanonAddr
1762
1763R$* $: $>Parse0 $>canonify $1 make domain canonical
1764
1765
1766
1767
1768
1769######################################################################
1770
1771### ParseRecipient -- Strip off hosts in $=R as well as possibly
1772
1773### $* $=m or the access database.
1774
1775### Check user portion for host separators.
1776
1777###
1778
1779### Parameters:
1780
1781### $1 -- full recipient address
1782
1783###
1784
1785### Returns:
1786
1787### parsed, non-local-relaying address
1788
1789######################################################################
1790
1791
1792
1793SParseRecipient
1794
1795R$* $: <? > $>CanonAddr $1
1796
1797R<? > $* < @ $* . > <? > $1 < @ $2 > strip trailing dots
1798
1799R<? > $- < @ $* > $: <? > $(dequote $1 $) < @ $2 > dequote local part
1800
1801
1802
1803# if no $=O character, no host in the user portion, we are done
1804
1805R<? > $* $=O $* < @ $* > $: <no> $1 $2 $3 < @ $4>
1806
1807R<? > $* $@ $1
1808
1809
1810
1811
1812
1813R<no> $* < @ $* $=R > $: <relay> $1 < @ $2 $3 >
1814
1815R<no> $* < @ $+ > $: $>D <$2> <no> <\+ To> <$1 < @ $2 >>
1816
1817R<$+> <$+> $: <$1> $2
1818
1819
1820
1821
1822
1823
1824
1825R<relay> $* < @ $* > $@ $>ParseRecipient $1
1826
1827R<$+> $* $@ $2
1828
1829
1830
1831
1832
1833######################################################################
1834
1835### check_relay -- check hostname/address on SMTP startup
1836
1837######################################################################
1838
1839
1840
1841SLocal_check_relay
1842
1843Scheck_relay
1844
1845R$* $: $1 $| $>"Local_check_relay" $1
1846
1847R$* $| $* $| $#$* $#$3
1848
1849R$* $| $* $| $* $@ $>"Basic_check_relay" $1 $| $2
1850
1851
1852
1853SBasic_check_relay
1854
1855# check for deferred delivery mode
1856
1857R$* $: < $&{deliveryMode} > $1
1858
1859R< d > $* $@ deferred
1860
1861R< $* > $* $: $2
1862
1863
1864
1865R$+ $| $+ $: $>D < $1 > <? > <\+ Connect> < $2 >
1866
1867R $| $+ $: $>A < $1 > <? > <\+ Connect> <> empty client_name
1868
1869R<? > <$+> $: $>A < $1 > <? > <\+ Connect> <> no: another lookup
1870
1871R<? > <$*> $: OK found nothing
1872
1873R<$={Accept}> <$*> $@ $1 return value of lookup
1874
1875R<reject> <$*> $#error $@ 5.7.1 $: "550 Access denied"
1876
1877R<discard> <$*> $#discard $: discard
1878
1879R<error:$-.$-.$-:$+> <$*> $#error $@ $1.$2.$3 $: $4
1880
1881R<error:$+> <$*> $#error $: $1
1882
1883R<$* <tmpf>> <$*> $#error $@ 4.3.0 $: "451 Temporary system failure. Please try again later."
1884
1885R<$+> <$*> $#error $: $1
1886
1887
1888
1889
1890
1891
1892
1893######################################################################
1894
1895### check_mail -- check SMTP `MAIL FROM:' command argument
1896
1897######################################################################
1898
1899
1900
1901SLocal_check_mail
1902
1903Scheck_mail
1904
1905R$* $: $1 $| $>"Local_check_mail" $1
1906
1907R$* $| $#$* $#$2
1908
1909R$* $| $* $@ $>"Basic_check_mail" $1
1910
1911
1912
1913SBasic_check_mail
1914
1915# check for deferred delivery mode
1916
1917R$* $: < $&{deliveryMode} > $1
1918
1919R< d > $* $@ deferred
1920
1921R< $* > $* $: $2
1922
1923
1924
1925# authenticated?
1926
1927R$* $: $1 $| $>"tls_client" $&{verify} $| MAIL
1928
1929R$* $| $#$+ $#$2
1930
1931R$* $| $* $: $1
1932
1933
1934
1935R<> $@ <ok> we MUST accept <> (RFC 1123)
1936
1937R$+ $: <? > $1
1938
1939R<? ><$+> $: <@> <$1>
1940
1941R<? >$+ $: <@> <$1>
1942
1943R$* $: $&{daemon_flags} $| $1
1944
1945R$* f $* $| <@> < $* @ $- > $: < ? $&{client_name} > < $3 @ $4 >
1946
1947R$* u $* $| <@> < $* > $: <? > < $3 >
1948
1949R$* $| $* $: $2
1950
1951# handle case of @localhost on address
1952
1953R<@> < $* @ localhost > $: < ? $&{client_name} > < $1 @ localhost >
1954
1955R<@> < $* @ [127.0.0.1] >
1956
1957$: < ? $&{client_name} > < $1 @ [127.0.0.1] >
1958
1959R<@> < $* @ localhost.$m >
1960
1961$: < ? $&{client_name} > < $1 @ localhost.$m >
1962
1963R<@> < $* @ localhost.UUCP >
1964
1965$: < ? $&{client_name} > < $1 @ localhost.UUCP >
1966
1967R<@> $* $: $1 no localhost as domain
1968
1969R<? $=w> $* $: $2 local client: ok
1970
1971R<? $+> <$+> $#error $@ 5.5.4 $: "553 Real domain name required for sender address"
1972
1973R<? > $* $: $1
1974
1975R$* $: <? > $>CanonAddr $1 canonify sender address and mark it
1976
1977R<? > $* < @ $+ . > <? > $1 < @ $2 > strip trailing dots
1978
1979# handle non-DNS hostnames (*.bitnet, *.decnet, *.uucp, etc)
1980
1981R<? > $* < @ $* $=P > $: <okr> $1 < @ $2 $3 >
1982
1983R<? > $* < @ $j > $: <okr> $1 < @ $j >
1984
1985R<? > $* < @ $+ > $: <okr> $1 < @ $2 > ... unresolvable OK
1986
1987
1988
1989# check sender address: user@address, user@, address
1990
1991R<$+> $+ < @ $* > $: @<$1> <$2 < @ $3 >> $| <f:$2@$3> <u:$2@> <d:$3>
1992
1993R<$+> $+ $: @<$1> <$2> $| <u:$2@>
1994
1995R@ <$+> <$*> $| <$+> $: <@> <$1> <$2> $| $>SearchList <\+ From> $| <$3> <>
1996
1997R<@> <$+> <$*> $| <$*> $: <$3> <$1> <$2> reverse result
1998
1999# retransform for further use
2000
2001R<? > <$+> <$*> $: <$1> $2 no match
2002
2003R<$+> <$+> <$*> $: <$1> $3 relevant result, keep it
2004
2005
2006
2007# handle case of no @domain on address
2008
2009R<? > $* $: $&{daemon_flags} $| <? > $1
2010
2011R$* u $* $| <? > $* $: <okr> $3
2012
2013R$* $| $* $: $2
2014
2015R<? > $* $: < ? $&{client_addr} > $1
2016
2017R<? > $* $@ <okr> ...local unqualed ok
2018
2019R<? $+> $* $#error $@ 5.5.4 $: "553 Domain name required for sender address " $&f
2020
2021...remote is not
2022
2023# check results
2024
2025R<? > $* $: @ $1 mark address: nothing known about it
2026
2027R<$={ResOk}> $* $@ <okr> domain ok: stop
2028
2029R<temp> $* $#error $@ 4.1.8 $: "451 Domain of sender address " $&f " does not resolve"
2030
2031R<perm> $* $#error $@ 5.1.8 $: "553 Domain of sender address " $&f " does not exist"
2032
2033R<$={Accept}> $* $# $1 accept from access map
2034
2035R<discard> $* $#discard $: discard
2036
2037R<reject> $* $#error $@ 5.7.1 $: "550 Access denied"
2038
2039R<error:$-.$-.$-:$+> $* $#error $@ $1.$2.$3 $: $4
2040
2041R<error:$+> $* $#error $: $1
2042
2043R<<tmpf>> $* $#error $@ 4.3.0 $: "451 Temporary system failure. Please try again later."
2044
2045R<$+> $* $#error $: $1 error from access db
2046
2047
2048
2049######################################################################
2050
2051### check_rcpt -- check SMTP `RCPT TO:' command argument
2052
2053######################################################################
2054
2055
2056
2057SLocal_check_rcpt
2058
2059Scheck_rcpt
2060
2061R$* $: $1 $| $>"Local_check_rcpt" $1
2062
2063R$* $| $#$* $#$2
2064
2065R$* $| $* $@ $>"Basic_check_rcpt" $1
2066
2067
2068
2069SBasic_check_rcpt
2070
2071# empty address?
2072
2073R<> $#error $@ nouser $: "553 User address required"
2074
2075R$@ $#error $@ nouser $: "553 User address required"
2076
2077# check for deferred delivery mode
2078
2079R$* $: < $&{deliveryMode} > $1
2080
2081R< d > $* $@ deferred
2082
2083R< $* > $* $: $2
2084
2085
2086
2087
2088
2089######################################################################
2090
2091R$* $: $1 $| @ $>"Rcpt_ok" $1
2092
2093R$* $| @ $#TEMP $+ $: $1 $| T $2
2094
2095R$* $| @ $#$* $#$2
2096
2097R$* $| @ RELAY $@ RELAY
2098
2099R$* $| @ $* $: O $| $>"Relay_ok" $1
2100
2101R$* $| T $+ $: T $2 $| $>"Relay_ok" $1
2102
2103R$* $| $#TEMP $+ $#error $2
2104
2105R$* $| $#$* $#$2
2106
2107R$* $| RELAY $@ RELAY
2108
2109R T $+ $| $* $#error $1
2110
2111# anything else is bogus
2112
2113R$* $#error $@ 5.7.1 $: "550 Relaying denied. Proper authentication required."
2114
2115
2116
2117
2118
2119######################################################################
2120
2121### Rcpt_ok: is the recipient ok?
2122
2123######################################################################
2124
2125SRcpt_ok
2126
2127R$* $: $>ParseRecipient $1 strip relayable hosts
2128
2129
2130
2131
2132
2133
2134
2135# blacklist local users or any host from receiving mail
2136
2137R$* $: <? > $1
2138
2139R<? > $+ < @ $=w > $: <> <$1 < @ $2 >> $| <f:$1@$2> <u:$1@> <d:$2>
2140
2141R<? > $+ < @ $* > $: <> <$1 < @ $2 >> $| <f:$1@$2> <d:$2>
2142
2143R<? > $+ $: <> <$1> $| <u:$1@>
2144
2145R<> <$*> $| <$+> $: <@> <$1> $| $>SearchList <\+ To> $| <$2> <>
2146
2147R<@> <$*> $| <$*> $: <$2> <$1> reverse result
2148
2149R<? > <$*> $: @ $1 mark address as no match
2150
2151R<$={Accept}> <$*> $: @ $2 mark address as no match
2152
2153
2154
2155R<reject> $* $#error $@ 5.2.1 $: "550 Mailbox disabled for this recipient"
2156
2157R<discard> $* $#discard $: discard
2158
2159R<error:$-.$-.$-:$+> $* $#error $@ $1.$2.$3 $: $4
2160
2161R<error:$+> $* $#error $: $1
2162
2163R<<tmpf>> $* $#error $@ 4.3.0 $: "451 Temporary system failure. Please try again later."
2164
2165R<$+> $* $#error $: $1 error from access db
2166
2167R@ $* $1 remove mark
2168
2169
2170
2171# authenticated via TLS?
2172
2173R$* $: $1 $| $>RelayTLS client authenticated?
2174
2175R$* $| $# $+ $# $2 error/ok?
2176
2177R$* $| $* $: $1 no
2178
2179
2180
2181R$* $: $1 $| $>"Local_Relay_Auth" $&{auth_type}
2182
2183R$* $| $# $* $# $2
2184
2185R$* $| NO $: $1
2186
2187R$* $| $* $: $1 $| $&{auth_type}
2188
2189R$* $| $: $1
2190
2191R$* $| $={TrustAuthMech} $# RELAY
2192
2193R$* $| $* $: $1
2194
2195# anything terminating locally is ok
2196
2197R$+ < @ $=w > $@ RELAY
2198
2199R$+ < @ $* $=R > $@ RELAY
2200
2201R$+ < @ $+ > $: $>D <$2> <? > <\+ To> <$1 < @ $2 >>
2202
2203R<relay> $* $@ RELAY
2204
2205R<$* <tmpf>> $* $#TEMP $@ 4.3.0 $: "451 Temporary system failure. Please try again later."
2206
2207R<$*> <$*> $: $2
2208
2209
2210
2211
2212
2213
2214
2215# check for local user (i.e. unqualified address)
2216
2217R$* $: <? > $1
2218
2219R<? > $* < @ $+ > $: <remote> $1 < @ $2 >
2220
2221# local user is ok
2222
2223R<? > $+ $@ RELAY
2224
2225R<$+> $* $: $2
2226
2227
2228
2229######################################################################
2230
2231### Relay_ok: is the relay/sender ok?
2232
2233######################################################################
2234
2235SRelay_ok
2236
2237# anything originating locally is ok
2238
2239# check IP address
2240
2241R$* $: $&{client_addr}
2242
2243R$@ $@ RELAY originated locally
2244
2245R0 $@ RELAY originated locally
2246
2247R127.0.0.1 $@ RELAY originated locally
2248
2249RIPv6:::1 $@ RELAY originated locally
2250
2251R$=R $* $@ RELAY relayable IP address
2252
2253R$* $: $>A <$1> <? > <\+ Connect> <$1>
2254
2255R<relay> $* $@ RELAY relayable IP address
2256
2257
2258
2259R<<tmpf>> $* $#TEMP $@ 4.3.0 $: "451 Temporary system failure. Please try again later."
2260
2261R<$*> <$*> $: $2
2262
2263R$* $: [ $1 ] put brackets around it...
2264
2265R$=w $@ RELAY ... and see if it is local
2266
2267
2268
2269
2270
2271# check client name: first: did it resolve?
2272
2273R$* $: < $&{client_resolve} >
2274
2275R<temp> $#TEMP $@ 4.7.1 $: "450 Relaying temporarily denied. Cannot resolve PTR record for " $&{client_addr}
2276
2277R<forged> $#error $@ 5.7.1 $: "550 Relaying denied. IP name possibly forged " $&{client_name}
2278
2279R<fail> $#error $@ 5.7.1 $: "550 Relaying denied. IP name lookup failed " $&{client_name}
2280
2281R$* $: <@> $&{client_name}
2282
2283# pass to name server to make hostname canonical
2284
2285R<@> $* $=P $:<? > $1 $2
2286
2287R<@> $+ $:<? > $[ $1 $]
2288
2289R$* . $1 strip trailing dots
2290
2291R<? > $=w $@ RELAY
2292
2293R<? > $* $=R $@ RELAY
2294
2295R<? > $* $: $>D <$1> <? > <\+ Connect> <$1>
2296
2297R<relay> $* $@ RELAY
2298
2299R<$* <tmpf>> $* $#TEMP $@ 4.3.0 $: "451 Temporary system failure. Please try again later."
2300
2301R<$*> <$*> $: $2
2302
2303
2304
2305
2306
2307######################################################################
2308
2309### F: LookUpFull -- search for an entry in access database
2310
2311###
2312
2313### lookup of full key (which should be an address) and
2314
2315### variations if +detail exists: +* and without +detail
2316
2317###
2318
2319### Parameters:
2320
2321### <$1> \-- key
2322
2323### <$2> \-- default (what to return if not found in db)
2324
2325### <$3> \-- mark (must be <(!|+) single-token> )
2326
2327### ! does lookup only with tag
2328
2329### + does lookup with and without tag
2330
2331### <$4> \-- passthru (additional data passed unchanged through)
2332
2333######################################################################
2334
2335
2336
2337SF
2338
2339R<$+> <$*> <$- $-> <$*> $: <$(access $4:$1 $: ? $)> <$1> <$2> <$3 $4> <$5>
2340
2341R<? > <$+> <$*> <\+ $-> <$*> $: <$(access $1 $: ? $)> <$1> <$2> <\+ $3> <$4>
2342
2343R<? > <$+ + $* @ $+> <$*> <$- $-> <$*>
2344
2345$: <$(access $6:$1+*@$3 $: ? $)> <$1+$2@$3> <$4> <$5 $6> <$7>
2346
2347R<? > <$+ + $* @ $+> <$*> <\+ $-> <$*>
2348
2349$: <$(access $1+*@$3 $: ? $)> <$1+$2@$3> <$4> <\+ $5> <$6>
2350
2351R<? > <$+ + $* @ $+> <$*> <$- $-> <$*>
2352
2353$: <$(access $6:$1@$3 $: ? $)> <$1+$2@$3> <$4> <$5 $6> <$7>
2354
2355R<? > <$+ + $* @ $+> <$*> <\+ $-> <$*>
2356
2357$: <$(access $1@$3 $: ? $)></tmpf></relay></fail></forged></temp></tmpf></relay></remote></tmpf></relay></tmpf></error:$+></error:$-.$-.$-:$+></discard></reject></u:$1@></d:$2></f:$1@$2></d:$2></u:$1@></f:$1@$2></tmpf></error:$+></error:$-.$-.$-:$+></reject></discard></perm></temp></okr></okr></okr></u:$2@></d:$3></u:$2@></f:$2@$3></okr></okr></okr></ok></tmpf></error:$+></error:$-.$-.$-:$+></discard></reject></relay></no></no></relay></no></no></tmpf></tmpf></tmpf></tmpf></i></route-addr></list:;></user@d></list:;></addr></tmpf>