Sendmail+UUCP Mini HOWTO: by Jamal Hadi Salim 25 October 1996 Initial edition July/96: works only with non-bind edition of sendmail Update Oct 01 /96: works with the redhat supplied binary Update Oct 07 /96: added/modified a tip on how to compile non-bind sendmail Update Oct 25 /96: added/modified a tip on how to keep sendmail happy via a dummy /etc/hosts entry After finally settling down and properly reading TFM (the Bat Book, to be precise) i have solved the Caramilk secret! The steps below will work with the binary supplied by RedHat. Perharps i should send this tip to the maintainer of the Sendmail FAQ too since there is absolutely no mention of it. This is for a system whose mail is sent out only via UUCP. mysmarthost is the ISPs hostname as set up in the uucp sys file and me.com is the hostname we use. pre-requisites ============== 1) If you are on a machine using uucp for mail then you dont really need to compile bind into DNS; Sendmail would normally insist on doing name look ups. How to survive name canonicalization on a standalone machine with no DNS ------------------------------------------------------------------------ If you get a pre-compiled sendmail with BIND in it you can still live with it (As is the case with Redhat supplied sendmail). a) Refer to my solution for this based on the m4 file described. or b)If you talk to me i could supply you with a non-BIND compiled version (8.7.6). Perhaps RedHat should consider supplying two sendmail binaries (like slakware) One with BIND and the other with no BIND. or c) The quickest solution to get sendmail with no bind is to edit src/conf.h lines below to read as i have shown: conf.h:# ifndef NAMED_BIND conf.h:# define NAMED_BIND 0 /* use Berkeley Internet Domain Server */ or d) use an RFC1597 IP address (10.0.0.0-10.255.255.255, 172.16.0.0-172.31.255.255, 192.168.0.0-192.168.255.255) to make sendmail happy. Edit /etc/hosts and add the following as a sample for the host myhost 10.0.0.1 myshost 2) Ensure that you have makemap and it is capable of supporting hash and or the more common dbm format (The Redhat version does not support dbm). In the examples below i will use hash as the standard. SETUP ====== 1) create your .mc file using your favorite editor; i'll call this file my.mc ============== file my.mc ======================= include(`../m4/cf.m4') VERSIONID(`me.com's setup with uucp created by xxxx')dnl OSTYPE(linux) FEATURE(nodns)dnl FEATURE(nocanonify)dnl FEATURE(always_add_domain)dnl FEATURE(mailertable, dbm /etc/mailertable)dnl MAILER(local)dnl MAILER(smtp)dnl MAILER(uucp) define(`SMART_HOST', uucp-dom:mysmarthost) =============================================== Let's dissect this: include(`../m4/cf.m4') requests for the m4 macro found in ../m4/cf.m4 to be include to resolve some things VERSIONID(`me.com's setup with uucp created by xxxx')dnl This is used to distinguish the different versions of .cf file you might end up creating. OSTYPE(linux) This is used to define/redefine linux specific stuff. It is safe to have it here. FEATURE(nodns)dnl This says we dont have a DNS server (so in effect we are using uucp only for mail. Sendmail must be compiled not to use bind) FEATURE(nocanonify)dnl This says Don't pass addresses to $[ ... $] for canonification. Normally if you have BIND compiled in sendmail would try and expand the alias/IP address to a canonical name using DNS. You dont wanna do this if all you have are feeds which connect to you via UUCP. FEATURE(always_add_domain)dnl This adds the local domain host name even on locally delivered mail Not neccessary i just like it; FEATURE(mailertable, hash /etc/mailertable)dnl the file /etc/mailertable is going to be a hash database where we will store routing information of certain sites. If you dont have anyone who you feed uucp to then you dont need this. More on this later. MAILER(local)dnl MAILER(smtp)dnl MAILER(uucp) These are the mailers we use. define(`SMART_HOST', uucp-dom:mysmarthost) Our smart host is our ISP who is defined in the uucp sys file as system mysmarthost. Any messages that we cant handle (i.e ones for domains or mailers we dont understand) will be passed on to our smarthost/ISP to figure out. note we use uucp-dom as the uucp mailer. This particular mailer uses smtp rewriting rules. 2) create your sendmail.cf file a) backup your old /etc/sendmail.cf file b) overwrite the sendmail.cf with the new one: m4 my.mc > /etc/sendmail.cf c) verify that the sendmail.cf file was correctly created based on your specifications. Some of the gotchas that i came across were: - missing uucp-dom mailer This was because i didnt have the smtp mailer entry. Actually, i understand it is important to have it defined before the uucp 4) create your /etc/mailertable if you dont have uucp sites feeding off you skip this step a) create/edit the file /etc/mailertable --------- sample /etc/mailertable ---------- system1.org uucp-dom:system1 .system1.org uucp-dom:system1 ------ This says anything that is addressed to system1.org or to *.system1.org that we receive either from our ISP or locally will be sent using the uucp-dom mailer to system1 (defined in the the uucp sys file) in other words we are doing the mail routing for *.system1.org b) create the database with makemap makemap hash /etc/mailertable