[sendmail] Impossible de se connecter depuis un poste client

Impossible de se connecter depuis un poste client [sendmail] - Linux et OS Alternatifs

Marsh Posté le 18-05-2004 à 15:49:57    

Salut à tous !
 
J'ai sendmail qui tourne sur un serveur Linux sur mon réseau local.
En local j'arrive à faire un telnet localhost 25 et à me connecter. Par contre depusi un poste du réseau, impossible !
C'est aussi impossible si je tape l'ip du serveur et non pas localhost.
telnet localhost 25 fonctionne, mais pas telnet 192.168.1.3
 
J'ai vidé toutes les rêgles du firewall en ne laissant que les ACCEPT pour l'INPUT, l'OUTPUT et le FORWARD.
 
A votre avis, d'où vient le problème ?
 
mes iptables :
 

Code :
  1. [root@serve2 root]# iptables -L
  2. Chain INPUT (policy ACCEPT)
  3. target     prot opt source               destination
  4. Chain FORWARD (policy ACCEPT)
  5. target     prot opt source               destination
  6. Chain OUTPUT (policy ACCEPT)
  7. target     prot opt source               destination


 
 
Merci d'avance


Message édité par coolboarder le 18-05-2004 à 15:52:36

---------------
“You want weapons? We’re in a library! Books! The best weapons in the world!”
Reply

Marsh Posté le 18-05-2004 à 15:49:57   

Reply

Marsh Posté le 18-05-2004 à 18:26:07    

par défaut sendmail écoute en local seulement (sur loopback), il faut le configurer si tu veux qu'il écoute sur d'autres interfaces, pour vérifier ceci :
 
netstat -lptn | grep sendmail

Reply

Marsh Posté le 18-05-2004 à 22:33:39    

netstat -an | grep ":25"

Reply

Marsh Posté le 19-05-2004 à 10:08:59    

Haaaaan, bon, je vais essayer de trouver comment le faire écouter autre chose que le local alors... Merci !
 
Voici le résultat des deux commandes :
 
[root@serve2 root]# netstat -lptn | grep sendmail
[root@serve2 root]# netstat -an | grep ":25"
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN
[root@serve2 root]#


---------------
“You want weapons? We’re in a library! Books! The best weapons in the world!”
Reply

Marsh Posté le 19-05-2004 à 10:12:16    

/etc/host.allow
/etc/host.deny
/etc/inetd.conf

Reply

Marsh Posté le 19-05-2004 à 10:16:52    

Je n'ai pas les deux premiers fichiers
 
xinetd.conf :

Code :
  1. #
  2. # Simple configuration file for xinetd
  3. #
  4. # Some defaults, and include /etc/xinetd.d/
  5. defaults
  6. {
  7.         instances               = 60
  8.         log_type                = SYSLOG authpriv
  9.         log_on_success          = HOST PID
  10.         log_on_failure          = HOST
  11.         cps                     = 25 30
  12. }
  13. includedir /etc/xinetd.d


---------------
“You want weapons? We’re in a library! Books! The best weapons in the world!”
Reply

Marsh Posté le 19-05-2004 à 10:20:50    

dans xinetd.d
 
as tu qqch pour sendmail?

Reply

Marsh Posté le 19-05-2004 à 10:27:05    

non...
 
xinetd.d :  
 

Code :
  1. " Press ? for keyboard shortcuts
  2. " Sorted by name (.bak,~,.o,.h,.info,.swp,.obj at end of list)
  3. "= /etc/xinetd.d/
  4. ../
  5. chargen
  6. chargen-udp
  7. daytime
  8. daytime-udp
  9. echo
  10. echo-udp
  11. finger
  12. imap
  13. imaps
  14. ipop2
  15. ipop3
  16. pop3s
  17. rexec
  18. rlogin
  19. rsh
  20. rsync
  21. servers
  22. services
  23. sgi_fam
  24. telnet
  25. time
  26. time-udp


---------------
“You want weapons? We’re in a library! Books! The best weapons in the world!”
Reply

Marsh Posté le 19-05-2004 à 10:32:05    

tu peux poster tes fichiers de conf de sendmail?

Reply

Marsh Posté le 19-05-2004 à 10:42:07    

/etc/mail/sendmail.mc

Code :
  1. divert(-1)dnl
  2. dnl #
  3. dnl # This is the sendmail macro config file for m4. If you make changes to
  4. dnl # /etc/mail/sendmail.mc, you will need to regenerate the
  5. dnl # /etc/mail/sendmail.cf file by confirming that the sendmail-cf package is
  6. dnl # installed and then performing a
  7. dnl #
  8. dnl #     make -C /etc/mail
  9. dnl #
  10. include(`/usr/share/sendmail-cf/m4/cf.m4')dnl
  11. VERSIONID(`setup for Red Hat Linux')dnl
  12. OSTYPE(`linux')dnl
  13. dnl #
  14. dnl # Uncomment and edit the following line if your outgoing mail needs to
  15. dnl # be sent out through an external mail server:
  16. dnl #
  17. dnl define(`SMART_HOST',`smtp.your.provider')
  18. dnl #
  19. define(`confDEF_USER_ID',``8:12'')dnl
  20. define(`confTRUSTED_USER', `smmsp')dnl
  21. dnl define(`confAUTO_REBUILD')dnl
  22. define(`confTO_CONNECT', `1m')dnl
  23. define(`confTRY_NULL_MX_LIST',true)dnl
  24. define(`confDONT_PROBE_INTERFACES',true)dnl
  25. define(`PROCMAIL_MAILER_PATH',`/usr/bin/procmail')dnl
  26. define(`ALIAS_FILE', `/etc/aliases')dnl
  27. dnl define(`STATUS_FILE', `/etc/mail/statistics')dnl
  28. define(`UUCP_MAILER_MAX', `2000000')dnl
  29. define(`confUSERDB_SPEC', `/etc/mail/userdb.db')dnl
  30. define(`confPRIVACY_FLAGS', `authwarnings,novrfy,noexpn,restrictqrun')dnl
  31. define(`confAUTH_OPTIONS', `A')dnl
  32. dnl #
  33. dnl # The following allows relaying if the user authenticates, and disallows
  34. dnl # plaintext authentication (PLAIN/LOGIN) on non-TLS links
  35. dnl #
  36. dnl define(`confAUTH_OPTIONS', `A p')dnl
  37. dnl #
  38. dnl # PLAIN is the preferred plaintext authentication method and used by
  39. dnl # Mozilla Mail and Evolution, though Outlook Express and other MUAs do
  40. dnl # use LOGIN. Other mechanisms should be used if the connection is not
  41. dnl # guaranteed secure.
  42. dnl #
  43. dnl TRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
  44. dnl define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
  45. dnl #
  46. dnl # Rudimentary information on creating certificates for sendmail TLS:
  47. dnl #     make -C /usr/share/ssl/certs usage
  48. dnl #
  49. dnl define(`confCACERT_PATH',`/usr/share/ssl/certs')
  50. dnl define(`confCACERT',`/usr/share/ssl/certs/ca-bundle.crt')
  51. dnl define(`confSERVER_CERT',`/usr/share/ssl/certs/sendmail.pem')
  52. dnl define(`confSERVER_KEY',`/usr/share/ssl/certs/sendmail.pem')
  53. dnl #
  54. dnl # This allows sendmail to use a keyfile that is shared with OpenLDAP's
  55. dnl # slapd, which requires the file to be readble by group ldap
  56. dnl #
  57. dnl define(`confDONT_BLAME_SENDMAIL',`groupreadablekeyfile')dnl
  58. dnl #
  59. dnl define(`confTO_QUEUEWARN', `4h')dnl
  60. dnl define(`confTO_QUEUERETURN', `5d')dnl
  61. dnl define(`confQUEUE_LA', `12')dnl
  62. dnl define(`confREFUSE_LA', `18')dnl
  63. define(`confTO_IDENT', `0')dnl
  64. dnl FEATURE(delay_checks)dnl
  65. FEATURE(`no_default_msa',`dnl')dnl
  66. FEATURE(`smrsh',`/usr/sbin/smrsh')dnl
  67. FEATURE(`mailertable',`hash -o /etc/mail/mailertable.db')dnl
  68. FEATURE(`virtusertable',`hash -o /etc/mail/virtusertable.db')dnl
  69. FEATURE(redirect)dnl
  70. FEATURE(always_add_domain)dnl
  71. FEATURE(use_cw_file)dnl
  72. FEATURE(use_ct_file)dnl
  73. dnl #
  74. dnl # The -t option will retry delivery if e.g. the user runs over his quota.
  75. dnl #
  76. FEATURE(local_procmail,`',`procmail -t -Y -a $h -d $u')dnl
  77. FEATURE(`access_db',`hash -T<TMPF> -o /etc/mail/access.db')dnl
  78. FEATURE(`blacklist_recipients')dnl
  79. EXPOSED_USER(`root')dnl
  80. dnl #
  81. dnl # The following causes sendmail to only listen on the IPv4 loopback address
  82. dnl # 127.0.0.1 and not on any other network devices. Remove the loopback
  83. dnl # address restriction to accept email from the internet or intranet.
  84. dnl #
  85. DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
  86. dnl #
  87. dnl # The following causes sendmail to additionally listen to port 587 for
  88. dnl # mail from MUAs that authenticate. Roaming users who can't reach their
  89. dnl # preferred sendmail daemon due to port 25 being blocked or redirected find
  90. dnl # this useful.
  91. dnl #
  92. dnl DAEMON_OPTIONS(`Port=submission, Name=MSA, M=Ea')dnl
  93. dnl #
  94. dnl # The following causes sendmail to additionally listen to port 465, but
  95. dnl # starting immediately in TLS mode upon connecting. Port 25 or 587 followed
  96. dnl # by STARTTLS is preferred, but roaming clients using Outlook Express can't
  97. dnl # do STARTTLS on ports other than 25. Mozilla Mail can ONLY use STARTTLS
  98. dnl # and doesn't support the deprecated smtps; Evolution <1.1.1 uses smtps
  99. dnl # when SSL is enabled-- STARTTLS support is available in version 1.1.1.
  100. dnl #
  101. dnl # For this to work your OpenSSL certificates must be configured.
  102. dnl #
  103. dnl DAEMON_OPTIONS(`Port=smtps, Name=TLSMTA, M=s')dnl
  104. dnl #
  105. dnl # The following causes sendmail to additionally listen on the IPv6 loopback
  106. dnl # device. Remove the loopback address restriction listen to the network.
  107. dnl #
  108. dnl # NOTE: binding both IPv4 and IPv6 daemon to the same port requires
  109. dnl #       a kernel patch
  110. dnl #
  111. dnl DAEMON_OPTIONS(`port=smtp,Addr=::1, Name=MTA-v6, Family=inet6')dnl
  112. dnl #
  113. dnl # We strongly recommend not accepting unresolvable domains if you want to
  114. dnl # protect yourself from spam. However, the laptop and users on computers
  115. dnl # that do not have 24x7 DNS do need this.
  116. dnl #
  117. FEATURE(`accept_unresolvable_domains')dnl
  118. dnl #
  119. dnl FEATURE(`relay_based_on_MX')dnl
  120. dnl #
  121. dnl # Also accept email sent to "localhost.localdomain" as local email.
  122. dnl #
  123. LOCAL_DOMAIN(`localhost.localdomain')dnl
  124. dnl #
  125. dnl # The following example makes mail from this host and any additional
  126. dnl # specified domains appear to be sent from mydomain.com
  127. dnl #
  128. dnl MASQUERADE_AS(`mydomain.com')dnl
  129. dnl #
  130. dnl # masquerade not just the headers, but the envelope as well
  131. dnl #
  132. dnl FEATURE(masquerade_envelope)dnl
  133. dnl #
  134. dnl # masquerade not just @mydomainalias.com, but @*.mydomainalias.com as well
  135. dnl #
  136. dnl FEATURE(masquerade_entire_domain)dnl
  137. dnl #
  138. dnl MASQUERADE_DOMAIN(localhost)dnl
  139. dnl MASQUERADE_DOMAIN(localhost.localdomain)dnl
  140. dnl MASQUERADE_DOMAIN(mydomainalias.com)dnl
  141. dnl MASQUERADE_DOMAIN(mydomain.lan)dnl
  142. MAILER(smtp)dnl
  143. MAILER(procmail)dnl


 
Tu as besoin du sendmail.cf ?


---------------
“You want weapons? We’re in a library! Books! The best weapons in the world!”
Reply

Marsh Posté le 19-05-2004 à 10:42:07   

Reply

Marsh Posté le 19-05-2004 à 10:50:35    

oui

Reply

Marsh Posté le 19-05-2004 à 10:56:34    

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


---------------
“You want weapons? We’re in a library! Books! The best weapons in the world!”
Reply

Marsh Posté le 19-05-2004 à 11:11:43    

DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl

Reply

Marsh Posté le 19-05-2004 à 11:13:09    

dans le sendmail.cf :
 

Citation :


# SMTP daemon options
 
O DaemonPortOptions=Port=smtp,Addr=127.0.0.1, Name=MTA


 
le sendmail.cm

Citation :


dnl #
  dnl # The following causes sendmail to only listen on the IPv4 loopback address
  dnl # 127.0.0.1 and not on any other network devices. Remove the loopback
  dnl # address restriction to accept email from the internet or intranet.
  dnl #
  DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl


 
 
tu as simplement à lire ce qui est écrit en commentaire

Reply

Marsh Posté le 19-05-2004 à 11:45:09    

Je pars me cacher...  :sweat:  
 
Merci  :jap:


---------------
“You want weapons? We’re in a library! Books! The best weapons in the world!”
Reply

Sujets relatifs:

Leave a Replay

Make sure you enter the(*)required information where indicate.HTML code is not allowed