The client.cf File
In Part I of this tutorial a configuration file that always forwards to the hub was partly developed. This appendix presents it in annotated and cross-referenced form, but please use this file only to learn about sendmail. If you really need a client file that always forwards to a hub, use the nullclient feature described in The null.mc File and m4.
V7 The sendmail.cf File # Defined macros Macros Note that in the next two lines you should replace mailhost with the real internal name of your mail hub and mail.us.edu with the real canonical name of your mail hub. D{REMOTE}mailhost # The name of the mail hub D{HUB}mail.us.edu # Hub as known to the outside world Rule Sets 1 and S= Cw localhost # My other names Class Fw -o /etc/sendmail.cw # A file of other names Ct root daemon Headers, Precedence, and Trust # Options Setting Options Note that you must change the next line to the path for your queue directory before putting this configuration file into use. O QueueDirectory=/tmp # Use /var/spool/mqueue upon release O Timeout.queuewarn=4h O Timeout.queuereturn=5d O DeliveryMode=background O TempFileMode=0600 O DefaultUser=1:1 O LogLevel=9 O OldStyleHeaders=True O BlankSub=. # Replace unquoted spaces # Headers HFrom: <$g> # Added only if missing Note that this is a minimal Received: header. See Received: for a more complete version of this header. HReceived: by $j; $b # Always added H?x?Full-Name: $?x$x$. # Add full name if available H?D?Date: $a # Add if F=D H?M?Message-Id: <$t.$i@$j> # Add if F=M # Precedence Pspecial-delivery=100 Pfirst-class=0 Plist=-30 Pbulk=-60 Pjunk=-100 # Delivery agent definition to forward mail to hub The Mail Hub and Delivery Agents Mhub, P=[IPC], S=Hubset, R=0, F=xmDFMuXa, T=DNS/RFC822/SMTP, A=IPC $h , , # Sendmail requires this, but we won't use it. Mlocal, P=/bin/mail, F=lsDFMAw5:/|@rmn, S=0, R=0, A=mail -d $u S0 # select delivery agent Rule Set 0 R@ $+ $#error $: Missing user name R$+ $#hub $@${REMOTE} $:$1 forward to hub S3 # preprocessing for all rule sets Rule Set 3 R$* <> $* $n handle <> error address R$* < $* <$*> $* > $* $2<$3>$4 de-nest brackets R$* < $* > $* $2 basic RFC822 parsing SHubset # Rewrite the sender for the hub R$- $@ $1@${HUB} user -> user@hub R$- @ $=w $@ $1@${HUB} user@local -> user@hub , R$- @ $=w . $m $@ $1@${HUB} user@local.domain -> user@hub