home *** CD-ROM | disk | FTP | other *** search
/ ftp.pasteur.org/FAQ/ / ftp-pasteur-org-FAQ.zip / FAQ / unix-faq / unixware / email < prev    next >
Encoding:
Text File  |  1997-09-14  |  86.6 KB  |  2,385 lines

  1. Path: senator-bedfellow.mit.edu!bloom-beacon.mit.edu!peerfeed!newsfeed.internetmci.com!194.72.7.126!news-peer.bt.net!btnet!dispatch.news.demon.net!demon!tamarix.demon.co.uk!tamarix!andrew
  2. From: andrew@#nospam#tamarix.demon.co.uk (Andrew Josey)
  3. Newsgroups: comp.unix.unixware.misc,comp.answers,news.answers
  4. Subject: UnixWare Frequently Asked Questions (The Email system)
  5. Supersedes: <EEotHD.rv@tamarix.demon.co.uk>
  6. Followup-To: comp.unix.unixware.misc
  7. Date: Sun, 14 Sep 1997 08:31:41 GMT
  8. Organization: Home.
  9. Sender: news@tamarix.demon.co.uk
  10. Approved: news-answers-request@MIT.EDU
  11. Expires: Mon, 13 Oct 1997 00:00:00 GMT
  12. Message-ID: <EGHp0t.1HD@tamarix.demon.co.uk>
  13. NNTP-Posting-Host: localhost
  14. Summary: Answers to questions frequently asked about SCO's UnixWare product
  15. X-NNTP-Posting-Host: tamarix.demon.co.uk [158.152.252.110]
  16. X-Newsreader: TIN [version 1.2 PL2]
  17. Lines: 2365
  18. Xref: senator-bedfellow.mit.edu comp.unix.unixware.misc:24271 comp.answers:28049 news.answers:112202
  19.  
  20. Archive-name: unix-faq/unixware/email
  21. Posting-Frequency: monthly
  22. Last-modified: Jul 9 1997
  23. Version: 2.12
  24.  
  25. UnixWare« Frequently Asked Questions List ( The Email system )
  26.  
  27. For more information about the files which make up the total UnixWare FAQ,
  28. see the "FAQ Overview" file posted regularly on the Internet newsgroup
  29. comp.unix.unixware.misc.
  30.  
  31. INTRODUCTION
  32.  
  33. This is the Email section of the UnixWare Frequently Asked Questions file
  34. maintained on the Internet. Its maintainers is Andrew Josey
  35. (andrew(a)tamarix.demon.co.uk). Suggestions and contributions are always
  36. welcome.
  37.  
  38. The purpose of this document is to give answers to frequently asked
  39. questions on Email configuration in UnixWare 2.x for the "mailsurr"
  40. subsystem.
  41.  
  42. This document in this revision does not cover sendmail in detail. There is a
  43. package included on the freebird archive at
  44. ftp://ftp.freebird.org/unixware/freebird/mailtools/sendmail that will
  45. automatically update the system to use sendmail.
  46.  
  47. If you have UnixWare 2.1.2, please note that the Sendmail version included
  48. with the Internet FastStart is known to have some security problems and is
  49. not covered by this FAQ - contact SCO for configuration information.
  50.  
  51. If you are setting up Email for the first time, please check Questions M2
  52. and M15 first, which document known problems in the Email system and give an
  53. overview of key steps to setup for internet mail. If you use dialup PPP see
  54. M52.
  55.  
  56. This document and the other FAQ files may be found on the world wide web at
  57. http://www.freebird.org/faq/
  58.  
  59. This document may also be obtained by anonymous ftp from the freebird
  60. archive at
  61.  
  62.    * ftp.freebird.org:/unixware/freebird/hints/FAQ/email
  63.    * ftp1.freebird.org:/pub/mirror/freebird/hints/FAQ/email
  64.    * ftp2.freebird.org:/pub/unixware/freebird/hints/FAQ/email
  65.  
  66. Small print: This file is Copyright 1997 freebird.org. Permission is granted
  67. for copying for non-commercial use. Many proper names of companies and
  68. software mentioned in these files are trademarks of their respective owners.
  69. All views are those of the individual contributors and not of their
  70. employers.
  71.  
  72. ----------------------------------------------------------------------------
  73.  
  74. TABLE OF CONTENTS
  75.  
  76. M1) What is the default Mailer on UnixWare ?
  77. M2) Are there any mail related bug fixes for UnixWare 2 ?
  78. M3) Is there any documentation describing the mail subsystem?
  79. M4) I've seen mention of the createSurr command and autoconfiguration
  80.     of the mail subsystem - what is this and what does it do?
  81. M5) Where are the configuration files used by the mail subsystem?
  82. M6) How do I set the domain name used in the From: line?
  83. M7) What other configuration parameters can I set in the
  84.     /etc/mail/mailcnfg file?
  85. M8) How does mail get delivered and how does the /etc/mail/mailsurr file work?
  86. M9) How can I setup mail aliasing?
  87. M10) How are uucp and smtp handled by the mailsurr file?
  88. M10.1) How do I setup uucp over TCP between two UnixWare machines?
  89. M11) I want to setup uucp outbound over a modem, how do I setup
  90.      the uucp files?
  91. M12) How do i restart smtp - do I need to reboot?
  92. M13) How do I setup mail logging?
  93. M14) How do I setup Smart Routing - using pathrouter ?
  94.  
  95. M15) What do I need to do to Set Up an Internet/Uucp Mail Gateway on UnixWare2?
  96. M15.1) Setup mail alias lookups via DNS, NIS or MHS (/etc/mail/lookupLibs)
  97. M15.2) Set the mail domain information in /etc/mail/mailcnfg
  98. M15.3) Setup any header rewrite rules (/etc/mail/rewrite)
  99. M15.4) Customizing /etc/mail/mailsurr (/usr/lib/mail/mailsurr.proto)
  100. M15.5) Setting up delivery lines to mail-servers, list-processors etc
  101. M15.6) Activating mail logging
  102. M15.7) Setting up suitable defaults for mailx users
  103. M15.8) If you have local users, then add other mail-user agents
  104. M15.9) Update /etc/profile
  105. M15.10) Setting up smart routing between uucp and internet zones
  106. M15.11) Add a rule to mailsurr.proto to catch mail to unknown local users.
  107. M15.12) Setup uucp over the connection server for  uucp over
  108. M15.13) Setup mail alias files
  109. M15.14) Install an alternate incoming smtpd
  110. M15.15) Install the TCP/SPX wrappers so as to monitor who is connecting.
  111. M16) I have UW2 and my inbound smtpd keeps dying. Is there a fix?
  112. M17) I have UW2 - smtpd now runs as a daemon - is there a way to run
  113.      it from inetd? Running from inetd makes it more reliable and also
  114.      can be wrapped.
  115. M18) I have UW2  and my outbound smtp  does incorrect routing to MX
  116.      record sites and also continually bounces mail when sending
  117.      to an unknown user when it should only bounce once - is there a fix?
  118. M19) I'm having trouble routing email from my local machine to the net.
  119.      I'm connected to a local internet provider and can run Mosaic etc
  120.      but can't send email. What do i need to do to make this work?
  121. M20) Mail sent to my domain mydom.com does not arrive locally on the
  122.      machine. It gets here but the local mailsystem does not recognise it
  123.      as local.
  124. M20.1) How can I set other mail domains besides my real domain
  125.             to be treated as local?
  126. M21) I'm using UnixWare2 and when mail arrives locally the Return-Path:
  127.      header has the format @myprovider:remotedomain!user or @domain:user or
  128.      @domain:user@domain.  Is there someway to put this into normal
  129.      domain address format?
  130. M22) Large mail alias lists don't seem to work on UnixWare 2. Is this
  131.      a known problem?
  132. M23) smtp mail to hosts which only have MX records and no valid A
  133.      records never gets there? This is with the 2.0 developer release.
  134. M24) How do I make the mailsystem send mail for local addresses off
  135.      to another host if they are not found locally without setting up
  136.      aliases?
  137. M25) How can I get mailx/dtmail to add fullname information to
  138.      the From: line?
  139. M26) How can I set the From: line  (hiding the internal hosts to a
  140.      mail domain)?
  141. M27) I want to setup a cluster of machines, with a single mail
  142.      gateway machine.
  143. M28) How can i make bounced email go to the postmaster if the user
  144.      address is invalid?
  145. M29) How can i debug mail delivery?
  146. M30) How can i debug the /etc/mail/rewrite rules?
  147. M31) How can I use the rewrite rules to rewrite a To: header
  148.      of the format uunet!domain!user to user@domain?
  149. M32) I have  tcp installed yet i only want to do transfers over
  150.      uucp. How do i make the mailsurr file exclude the smtpqer delivery lines?
  151. M33) I'm sending to a SCO system over uucp which only understands
  152.      RFC822. The UnixWare mailsystem inserts an extra From line which
  153.      upsets the SCO mailer.
  154. M34) Where are outgoing messages stored for smtp?
  155. M35) Mail is bouncing back with problems about an invalid
  156.      From header line, what should I do?
  157. M36) After changing the system owner to another user and
  158.      deleting the original user, mail is still being sent to the original
  159.      system owner for example when a new package is installed,
  160.      and errors stating "unable to send to " appear after adding a package.
  161. M37) Why when I send local mail does my PPP link get established, for
  162.      example when I pkgadd or pkgrm a package?
  163. M38) Is it possible to change the sender address with
  164. mailsurr's translation facilities?  The man page indicates
  165. that only the recipient address can be changed.
  166. Am I going to have to move to sendmail?
  167. M39) How do I setup a POP3 server on UnixWare ?
  168. M40) I'm using UnixWare 1.x and  I can't find the createSurr command,
  169.      what should i do?
  170. M41) How do I setup my mail to be autoanswered?
  171. M42) How do I setup my mail to be forwarded?
  172. M43) How do I setup a mail-server?
  173. M44) How do I  setup a mailing list - such as Listproc ?
  174. M45) How do I  make sendmail the default mailer?
  175. M46) Mail of the address format @mylocal.domain:user@mylocal.domain is not
  176.      delivered locally, how can I fix this?
  177. M47) dtmail won't restart after my machine was switched off.
  178. M48) Inbound mail is addressed to <@site.demon.co.uk:user@domain.co.uk>
  179.      and does not get delivered to the local user.
  180. M49) I'm using PPP but don't have the interface up when the system
  181.     creates the mailsurr file, and thus it does not detect my IP
  182.     link - what can I do?
  183. M50) How can I set mailalias in the form : user@site  maps to local user?
  184. M51) What is the /etc/mail/smtpcnfg file in tf2100/UW2.1?
  185. M52) How should I setup Mail via PPP?
  186. M53) How can I setup mail to handle virtual hosts's mail?
  187. M54) I need to print all incoming mail as well as send it to local users.
  188. M55) Mail loops - its forwarded by my provider but then goes into a loop - any ideas?
  189. M56) Mail delivery does not seem to be case insensitive - any ideas?
  190.  
  191. ----------------------------------------------------------------------------
  192.  
  193. Subject: M1) What is the default Mailer on UnixWare?
  194.  
  195. The default mailer on UnixWare is based on SVR4 mail and was originally
  196. developed at AT&T Bell Labs.  This mailer uses a regular-expression
  197. based parser (/etc/mail/mailsurr) to deliver mail - this is similar in
  198. format to sendmail but is not sendmail.
  199. It supports SMTP, UUCP mail, mailing list directories,
  200. mail aliases and an MHS gateway.
  201.  
  202. Sendmail is also included on the system and can be used instead
  203. of the mailsurr subsystem  but is not the officially
  204. supported mailer (see question M45 for how to make sendmail
  205. the default mailer). If you do decide to use sendmail you are recommended
  206. to get the latest version, the ones included by default are known
  207. to be out of date and may have some security problems.
  208.  
  209. Subject: M2) Are there any mail related bug fixes for UnixWare2 ?
  210.  
  211. If you have UnixWare 2.01/2.02/2.03 you SHOULD install tf2100.tar.
  212. (IGNORE THE RELEASE NOTES for tf2100 that say the fixes are in 2.03,
  213. the final version of tf2100 was after 2.03, so you do need it).
  214.  
  215. If you have UnixWare 2.1 or Later you DO NOT need to install tf2100.tar,
  216. but you are recommended to upgrade to 2.1.1 or 2.1.2 as that
  217. contains further mail related fixes.
  218.  
  219. Other alternatives are to install sendmail or smap/smapd. See
  220. the freebird archive for details.
  221.  
  222. Subject: M3) Is there any documentation describing the mail subsystem?
  223.  
  224. Please read the on-line Dynatext documentation provided with UnixWare.
  225.  
  226. Subject: M4) I've seen mention of the createSurr command and autoconfiguration
  227. of the mail subsystem - what is this and what does it do?
  228.  
  229. The createSurr script is an attempt to autoconfigure the /etc/mail/mailsurr
  230. file based on the running configuration.
  231.  
  232. createSurr is run automatically on each reboot in /etc/rc2.d/S81smtp.
  233.  
  234. To make permanent changes to the mail configuration you must edit
  235. the /usr/lib/mail/mailsurr.proto file rather than the /etc/mail/mailsurr
  236. file - or disable the call to createSurr in /etc/rc2.d/S81smtp by
  237. commenting it out.
  238.  
  239. The first thing you might want to try prior to any other changes is
  240. to run the new GUI admin tool for Mail Setup, in Admin_Tools/Mail_Setup,
  241. select extended and save the selection.
  242.  
  243. The next section describes in some detail how createSurr works.
  244.  
  245. The mail autoconfiguration routine invoked by
  246. /usr/lib/mail/surrcmd/createSurr consults the perl script  (note that
  247. UnixWare includes a cut down version of perl 4.036 in /usr/gnu/bin)
  248. /usr/lib/mail/surrcmd/configCheck to probe the system configuration, followed
  249. by /usr/lib/mail/surrcmd/configMail to update the /etc/mail/mailsurr file.
  250.  
  251. In detail the sequence is as follows:
  252.  
  253.         createSurr
  254.                 calls-> configCheck
  255.                                 opens-> /etc/mail/mailflgs
  256.                                         /etc/mail/mailcnfg
  257.                                         /etc/mail/smfcnfg
  258.                                         /etc/resolv.conf
  259.                                         /etc/uucp/Systems
  260.                                         /etc/confnet.d/inet/interface
  261.                                 updates-> /etc/mail/mailflgs
  262.                 calls-> configMail
  263.                                 opens-> /etc/mail/mailflgs
  264.                                         /etc/mail/mailsurr.proto
  265.                                 updates-> /etc/mail/mailsurr
  266.  
  267. Subject: M5) What are the configuration files used by the mail subsystem?
  268.  
  269. The configuration files are stored in /etc/mail and in /usr/lib/mail.
  270.  
  271. The key files in /etc/mail are:
  272.         mailcnfg        mailsurr        rewrite         lookupLibs
  273.  
  274. The key files in /usr/lib/mail are:
  275.         mailsurr.proto lookupLibs.proto
  276.  
  277. The /etc/mail/mailcnfg file:
  278.  
  279. This file  is used to initialise the mail configuration;
  280. in UnixWare 2 the GUI Mail_setup tool edits this file.
  281. The fields DOMAIN and SMARTERHOST are of particular importance.
  282.  
  283. DOMAIN  - string used to supply the domain name for the From: line
  284.  
  285. SMARTERHOST - can be set to a machine that has better routing information
  286. in case the local machine does not understand the address. Its
  287. possible and desirable for some workstations to route all mail
  288. to the SMARTERHOST; if you are connecting to the internet you probably
  289. want to set SMARTERHOST to the name of your ISP.
  290.  
  291. The /etc/mail/mailsurr file:
  292.  
  293. This file contains a set of rules for routing and transport of mail.
  294. This is further described later in this document.
  295.  
  296. The /etc/mail/rewrite file:
  297.  
  298. This is new in UnixWare 2 and allows mail header rewriting (see
  299. rewrite(4) and the Dynatext documents referred to in section M3) .
  300.  
  301. The /etc/mail/rewrite contains functions to rewrite mail headers for
  302. local (called in the local() function) and remote delivery (called in
  303. the main() function).
  304.  
  305. An example  of changing the From: lines to hide internal
  306. hosts is given in question M15  section 3.
  307.  
  308. The /etc/mail/lookupLibs files:
  309.  
  310. This is new in UnixWare 2 and is a file containing the names of the
  311. shared libraries to be opened when the mailalias command (which is
  312. run by mail when parsing the mailsurr file). This determines where
  313. aliases should be found. Its possible using this for alias lookup to
  314. use the DNS and NIS.
  315. This file is autoconfigured.
  316.  
  317. The /usr/lib/mail/mailsurr.proto file:
  318.  
  319. This contains the default mailsurr rules for different configurations.
  320. This file is used to create the file /etc/mail/mailsurr. Permanent
  321. changes to /etc/mail/mailsurr should be made by editing this file.
  322. This is further described later in this document.
  323.  
  324. The /usr/lib/mail/lookupLibs.proto file:
  325.  
  326. This is new in UnixWare 2.
  327. This contains the default mailalias lookup rules. This file is used
  328. to create the file /etc/mail/lookupLibs. Permanent changes to that
  329. file should be made by editing this file.
  330. This is further described later in this document.
  331.  
  332. The /etc/mail/smtpcnfg file:
  333.  
  334. This is new in tf2100 and UnixWare 2.1.
  335. The contains initialisation information for the behaviour of smtp.
  336. See M51 for details of the default values in this file.
  337.  
  338. Subject: M6) How do I set the domain name used in the From: line?
  339.  
  340. In UnixWare2 the Mail_setup GUI tool can be used to set the domain
  341. address. This edits a file called /etc/mail/mailcnfg and adds
  342. a line, for example to set the domain to "mydomain.com"
  343.  
  344. DOMAIN=mydomain.com
  345.  
  346. Subject: M7) What other configuration parameters can I set in the
  347. /etc/mail/mailcnfg file?
  348.  
  349. CLUSTER - can be used to name a group of machines. The string supplied
  350. is used instead of the domain name when mail supplies the
  351. remote from line. (with the /etc/mail/rewrite file included
  352. in UnixWare 2 - i no longer use this field but add a rewrite
  353. function instead)
  354.  
  355. FAILSAFE - can be used to denote a machine to which delivery should
  356. be made in case local delivery fails - useful when using
  357. mail in a networked environment
  358.  
  359. DEL_EMPTY_FILE - if value set to no empty mailfiles are not deleted by
  360. mail or mailx
  361.  
  362. ADD_DATE - if set to true, i.e ADD_DATE=true, the mailer will add a Date:
  363. line if one does not already exit
  364.  
  365. ADD_FROM - if set to true, i.e ADD_FROM=true, the mailer will add a From:
  366. line if one does not already exit
  367.  
  368. Subject: M8) How does mail get delivered and how does the /etc/mail/mailsurr
  369.              file work?
  370.  
  371. Incoming mail over smtp is received over TCP/IP on port 25.
  372. In UnixWare 2.x an smtpd daemon process listens on port 25 to receive mail
  373.  
  374. Once mail is received by the smtp receiver it is passed to
  375. the rmail process which then uses the regular expression based
  376. parser (/etc/mail/mailsurr) to decide how to do deliver the mail.
  377.  
  378. Incoming mail over uucp is queued in /var/spool/uucp/sitename and then
  379. uux scans that directory and passes the mail off to the
  380. rmail process for delivery.
  381.  
  382. Outgoing mail is handed to rmail which based on the address and
  383. the mailsurr rules in place  delivers the mail accordingly.
  384.  
  385. The file /etc/mail/mailsurr contains a set of rules for routing and
  386. transport of mail.
  387.  
  388. This file is automatically created by the command
  389. /usr/lib/mail/surrcmd/createSurr by scanning the system configuration
  390. and a template mailsurr prototype file in /usr/lib/mail/mailsurr.proto.
  391.  
  392. To make permanent changes to this file edit the mailsurr.proto file
  393. and then rerun the createSurr command.
  394.  
  395. The mail autoconfiguration routine invoked by /usr/lib/mail/surrcmd/createSurr
  396. consults the perl script /usr/lib/mail/surrcmd/configCheck to probe the system
  397. configuration.
  398.  
  399. After scanning the system the file /etc/mail/mailflgs
  400. contains flags for the configuration options autoconfigured. Examination of the
  401. mailsurr.proto shows the same flags with conditional mailsurr entries.
  402.  
  403. The possible flags in /etc/mail/mailflgs are SMTR, MHS, DNS, UUCP and IP:
  404.  
  405. SMTR if SMARTERHOST is set in /etc/mail/mailcnfg
  406.  
  407. MHS is set if %g is set in /etc/mail/mailcnfg (MHS gateway )
  408. This may be set off if MHSINTERVAL is set to 0 in /etc/mail/smfcnfg
  409.  
  410. DNS is set if there is a resolver set in /etc/resolv.conf
  411. UUCP is set if there are entries in /etc/uucp/Systems
  412. IP is set if it determines there is a valid device in
  413. /etc/confnet.d/inet/interface
  414.  
  415.  
  416. The createSurr command the invokes /usr/lib/mail/surrcmd/configMail to
  417. produce the updated /etc/mail/mailsurr file.
  418.  
  419. Looking at the file created (see mailsurr(4) for full details).
  420. Each entry in the /etc/mail/mailsurr file consists of three fields.
  421.  
  422. 'sender'          'recipient'   'command'
  423.  
  424. The sender and recipient fields are regular expressions.  If
  425. these first two fields match those of the mail message being
  426. processed, the associated command is run.
  427.  
  428. Some sample mailsurr entries follow - don't worry if you don't
  429. understand these, for a full explanation you can refer to the
  430. UnixWare man page for mailsurr(4).
  431.  
  432. # mail-server, mailing lists and information distribution handling section
  433. '.+'    'mail-server'   '<      /opt/lib/mserv/listener'
  434. '.+'    'listproc'      '<S=0;      /home/listserv/catmail -r -f'
  435.  
  436. #    Send mail for `laser' to   attached laser printer
  437. #    Make certain that failures are reported via return mail.
  438. '.+' 'laser'     '< S=0;F=*; lp -dlaser'
  439.  
  440. #    For remote mail via uucp
  441. '.+' '([^!@]+)!(.+)'     '< /usr/bin/uux - \\1!rmail (\\2)'
  442.  
  443. Examples of mailsurr/mailsurr.proto/mailcnfg files for a uucp/internet
  444. gateway  and client workstation in cluster configurations
  445. are available from the Freebird archive in the directory hints:
  446.         Mail/README
  447.         Mail/mailsurr
  448.         Mail/mailcnfg
  449.         Mail/client.mailcnfg
  450.         Mail/client.mailsurr
  451.         Mail/client.mailcnfg.uw2
  452.         Mail/client.mailsurr.uw2
  453.         Mail/mailcnfg.uw2
  454.         Mail/mailsurr.proto.uw2
  455.  
  456. Subject: M9) How can I setup mail aliasing?
  457.  
  458. UnixWare mail has a convenient method of alias processing, and the
  459. mailer calls a utility called mailalias.
  460.  
  461. The mailalias utility if it cannot find a user locally or a mailbox
  462. (UnixWare mail delivers to mailfiles as well as users - so
  463. you can just places a mailbox into /var/mail without setting
  464. up a user account) looks for a list
  465. of alias files in the configuration file /etc/mail/namefiles.
  466.  
  467. Note that mailsurr does not use any of the sendmail aliasing
  468. files (i.e. /usr/ucblib/aliases).
  469.  
  470. The default files are /etc/mail/lists and /etc/mail/names. In our
  471. local installation we've added added a couple of local files,
  472. /etc/mail/groups for internal groups, /etc/mail/localiases for
  473. internal distribution and /etc/mail/fullnames
  474. which has alternate  long names; so this file looks like:
  475.  
  476. # --- example /etc/mail/namefiles -----
  477. /etc/mail/lists
  478. /etc/mail/names
  479. # Local add-ons
  480. /etc/mail/groups
  481. /etc/mail/localiases
  482. /etc/mail/fullnames
  483. # -----end example ----
  484.  
  485. /etc/mail/groups could be:
  486.  
  487. # ---- example /etc/mail/groups -----
  488. #       All the local groups within Sitename.This is the definitive copy used by
  489. #       all the mail interfaces (it's totally transparent to them all).
  490. #
  491.  
  492. managers        john fred wendy june
  493. staff           joan michelle rita \
  494.                 sarah brendan
  495. all             managers staff
  496. # --- end example --
  497.  
  498. /etc/mail/localiases could be:
  499.  
  500. # ----- example /etc/mail/localiases ----
  501. #       localiases:
  502. #               These are purely local, readily changeable aliases for mapping
  503. #       user@site.domain to internal host!user
  504. #
  505. # This file is for the gateway
  506.  
  507. john            argus!john
  508. fred            argus!fred
  509. wendy           woolco!wendy
  510. june            sun4!june
  511. rita            olim380!rita
  512. sarah           olim380!sarah
  513. brendan         sun4!brendan
  514. # -- end example --
  515.  
  516. /etc/mail/fullnames could be:
  517.  
  518. # --- example /etc/mail/fullnames ---
  519. j.williams      john
  520. john.williams   john
  521. f.jones         fred
  522. fred.jones      fred
  523. w.jones         wendy
  524. wendy.jones     wendy
  525. r.arnold        rita
  526. rita.arnold     rita
  527. # common misspellings can also be included
  528. sara            sarah
  529. brendon         brendan
  530. # --- end example ----
  531.  
  532. Subject: M10) How are uucp and smtp handled by the mailsurr file?
  533.  
  534. Delivery by uucp is driven off the /etc/uucp files. If you wish to
  535. do some smart routing see the later section on pathrouter..
  536.  
  537. Use of smtp can we be done either using DNS lookup or not.
  538. Typically for internal hosts in a cluster, we set smarterhost
  539. (in /etc/mail/mailcnfg) to our internet gateway, and then
  540. that host does the DNS lookup.
  541.  
  542. # UnixWare 2 example: The mail transports go here.
  543. # smtp delivery first followed by uucp
  544. # If DNS is not used, use "smtpqer -N". If DNS is used, remove the "-N".
  545. #
  546. '.+'    '([^@,:]+)@(.+)'        '< B=4096; /usr/lib/mail/surrcmd/smtpqer -f %R -s %X' '\\1@\\2'
  547. '.+'    '(@[^@,:]+[,:].+)'      '< B=4096; /usr/lib/mail/surrcmd/smtpqer -f %R -s %X' '\\1'
  548. '.+'    '([^@,:]+)@(.+)%D'      '< H=add_from_header;B=1024; uux -a %R -p -- \\2 !rmail' '(\\1)'
  549. '.+'    '@([^@,:]+)%D[,:](.+)'  '< H=add_from_header;B=1024; uux -a %R -p -- \\1 !rmail' '(\\2)'
  550.  
  551. Tip: If you are using dialup uucp you may want to change the uux command
  552. invoked to add the "-r" flag so that mail will be queued for delivery,
  553. rather than attempting delivery at the time the mail is sent. The mail
  554. can then be sent when the uucp system polls the site which is more
  555. efficient. An example of a uucp delivery line with the -r flag added
  556. follows:
  557.  
  558. # invoke uux with -r flag to queue mail for delivery
  559. '.+'    '([^@,:]+)@(.+)%D'      '< H=add_from_header;B=1024; uux -a %R -p -- \\2 !rmail' '(\\1)'
  560. '.+'    '@([^@,:]+)%D[,:](.+)'  '< H=add_from_header;B=1024; uux -r -a %R -p -- \\1 !rmail' '(\\2)'
  561.  
  562. Since your mailsurr file was created by the createSurr command then remember
  563. to make the changes permanent by editing the file
  564. /usr/lib/mail/mailsurr.proto (the template prototype file).
  565.  
  566. Subject: M10.1) How do I setup uucp over TCP between two UnixWare machines?
  567.  
  568. Step 1. Edit /etc/uucp/Devices and uncomment the following line
  569.  
  570. CS  - - - CS
  571.  
  572. This then uses the connection server to make connections.
  573.  
  574. Step 2. Edit /etc/uucp/Systems , add a line for each system you
  575. want to talk to, for example to system raven
  576.  
  577. raven     Any CS - -,listen:10103
  578.  
  579. This entry makes "uucico" run over the TCP network.
  580. It causes the Connection Server to connect to the "10103" service
  581. through the "listen" service. The "10103" service invokes uucico.
  582.  
  583. Step 3. Edit /etc/uucp/Permissions, to allow remote systems
  584. connecting over the connection server to send and request files (note
  585. that remote systems also need an entry in /etc/uucp/Systems).
  586.  
  587. LOGNAME=nuucp SENDFILES=yes REQUEST=yes
  588.  
  589. M11) I want to setup uucp outbound over a modem, how do I setup
  590. the uucp files?
  591.  
  592. In UnixWare2 you can do this using the Dialup_setup GUI tool.
  593.  
  594. Alternately I carry a floppy with the following files from /etc/uucp
  595. that I install when I want to setup my laptop to call outbound:
  596.  
  597.         Config  Devices Devices.tcp Dialers Systems
  598.  
  599. This configuration is for a Hayes compatible modem, and is known
  600. to work with Supra modems, Multitech ZDX modems and US Robotics.
  601. These files can be obtained from the freebird archive in the file
  602.  
  603.         hints/Mail/uucp.quick.tar.Z
  604.  
  605. Subject: M12) How do i restart smtp - do I need to reboot?
  606.  
  607. You can stop and restart smtp without rebooting as follows:
  608.         $ su
  609.         # sh /etc/rc2.d/S81smtp stop
  610.         # sh /etc/rc2.d/S81smtp start
  611.  
  612. Subject: M13) How do I setup mail logging?
  613.  
  614. The following mailsurr entries log successful and failed deliveries in
  615. /var/mail/:log and /var/mail:errors respectively.  In UnixWare 1.x these
  616. are files, in UnixWare 2 these are directories.
  617.  
  618. # Log mail delivery
  619. #
  620. '.+'    '.+'    '> W=1;B=*; maillog -o /var/mail/:log' '-O %O %R %n %H %l --'
  621. '.+'    '.+'    'Errors W=1;B=*; maillog -o /var/mail/:errors' '-O %O %R %n %H %l --'
  622.  
  623. #/usr/lib/mail/surrcmd/createSurr -l on
  624.  
  625. In UnixWare 2 you can also select the appropriate part of the GUI setup
  626. to turn logging on.
  627.  
  628. In UnixWare 2 logs are now kept in directories with a different log being
  629. stored each day in a file denoted by the day name, ie. Monday,....Sunday
  630. for the 7 days. If you prefer the old style format of logging to
  631. just a single file , its very simple just to replace the logging tool
  632. with either your own or the one from UnixWare 1.x. (from the Freebird
  633. archive ...freebird/hints/Mail/maillog.alt).
  634.  
  635. To determine problems with outgoing mail, check the /var/spool/smtpq/LOG file.
  636. Each time a mail message is sent, a log of the delivery command is appended
  637. to this log file.  A cron entry located in /var/spool/cron/crontabs/smtp
  638. recycles daily backup copies of the mail message deliveries on a 7 day
  639. cycle.  This is useful for debugging mail problems.
  640.  
  641. In UnixWare 2 daily logs for smtp delivery are now kept in the directory
  642. /var/spool/mailq/Logs.
  643.  
  644. Subject: M14) How do I setup Smart Routing - using pathrouter ?
  645.  
  646. Sometimes you may wish to override routing via MX records,
  647. for  example if you want to route mail privately over a modem
  648. link rather than the internet.
  649.  
  650. The utility suitable for use with UnixWare is pathrouter.
  651.  
  652. Pathrouter can be used to lookup route information for uucp and
  653. domain addresses.
  654.  
  655. The /etc/uucp/paths file is the routing database for the pathrouter command
  656. (see paths(4), and pathrouter(1M)) .  Each line of the file provides
  657. routing information to either a host or to a domain (designated by a
  658. leading ".").  Each line should have either two or three tab characters
  659. (ascii 0x9) as separated fields.  The format of each line in the
  660. paths file is:
  661.  
  662.         key  route   [cost]
  663.  
  664. Note that the cost field is a delivery weighting field
  665. which is not used by the mail subsystem (smail would use it).
  666.  
  667. An example paths (/etc/uucp/paths) file for a gateway machine.
  668.  
  669. The following paths file is an example of setup for a gateway machine.
  670. This example prefixes the destination routes with an exclamation
  671. mark (!) to reduce the number of translations done by the rmail(1).
  672.  
  673. This example is used to rewrite the domain addresses france.fr;
  674. and any uk domain address (matched by the .uk rule) to be routed
  675. via the uel machine.
  676.  
  677. The usg.com domain address is converted to !usg!%s in order to utilise
  678. the uucp transport rather than smtp.
  679.  
  680. france.fr       !uel!france.fr!%s       0
  681. uel     !uel!%s 0
  682. usg     !usg!%s 0
  683. windsor !uel!windsor!%s 0
  684. .uk     !uel!%s 0
  685. .usg.com        !usg!%s 0
  686.  
  687. Prefixing a name by a dot as in ".usg.com" can be used to match
  688. domains, and so this rule would match site1.usg.com to be routed
  689. thru usg!.
  690.  
  691. Note that this example does not have "smart-host" defined, and so
  692. any addresses that are not matched by pathrouter are left unchanged. In this
  693. example it is assumed that the DNS lookup will resolve the
  694. address and perform delivery over smtp.
  695.  
  696. If you don't have DNS lookup, or you decide to route unknown
  697. addresses to the nearest backbone then add an entry
  698.  
  699. smart-host      !backbone!%s    0
  700.  
  701. An example we use here to send mail to a particular route follows; this
  702. for various internal routing to an internal gateway within the company,
  703. and allows mail to be addressed as user@fpk, user@fpk.mycomp.com or
  704. user@mycomp.com with all mail going to the one gateway.
  705.  
  706. fpk     !nj-ums.fpk.mycomp.com!%s       0
  707. fpk.mycomp.com  !nj-ums.fpk.mycomp.com!%s       0
  708. mycomp.com      !nj-ums.fpk.mycomp.com!%s       0
  709.  
  710. This is then combined with a delivery line within mailsurr.proto
  711. to send this over smtp:
  712.  
  713. '.+'    '!(nj-ums.fpk.mycomp.com)!(.+)' '< B=4096; /usr/lib/mail/surrcmd/smtpqer -f %R -s \\1' '\\2'
  714.  
  715. Subject: M15) What do I need to do to Set Up an Internet/Uucp Mail Gateway
  716.               on UnixWare 2?
  717.  
  718. The following section details the steps taken to setup up an email
  719. gateway on UnixWare 2 - the email gateway is connected to the internet
  720. and also has direct uucp connections over tcp and serial lines.
  721.  
  722. Subject: M15.1) Setup mail alias lookups via DNS, NIS or MHS
  723.                 (/etc/mail/lookupLibs)
  724.  
  725. Do you want mailalias to use  DNS, NIS or MHS to lookup for aliases?
  726. If you don't then by disabling the feature (by commenting out
  727. lines in usr/lib/mail/lookupLibs.proto) you can speed mailalias
  728. lookup - this is also useful if you are a dialup user who
  729. wants to only send mail periodically when connected.
  730.  
  731. In /usr/lib/mail is the file lookupLibs.proto; by default this contains:
  732.  
  733. /usr/lib/mail/libalias/file.so
  734. /usr/lib/mail/libalias/passwd.so
  735. <DNS>   /usr/lib/mail/libalias/dns.so
  736. <NIS>   /usr/lib/mail/libalias/nis.so
  737. <MHS>   /usr/lib/mail/libalias/extract.so
  738.  
  739. When createSurr is run to auto-discover the machine configuration
  740. and create a suitable mailsurr file, it will auto include the
  741. lines for the features it discovers, for example DNS being
  742. configured auto includes the line beginning <DNS>
  743.  
  744. You can insert a comment into this file to disable the line, or
  745. you can delete the line; for example to disable DNS, NIS and MHS
  746. mailalias lookup  on this machine;
  747.  
  748. /usr/lib/mail/libalias/file.so
  749. /usr/lib/mail/libalias/passwd.so
  750. <DNS>   #/usr/lib/mail/libalias/dns.so
  751. <NIS>   #/usr/lib/mail/libalias/nis.so
  752. <MHS>   #/usr/lib/mail/libalias/extract.so
  753.  
  754. Alternately you can replace mailalias with the UW1.x version of mailalias
  755. which then only uses the aliases as defined in /etc/mail/namefiles.
  756. Since I'm not using any aliases in the DNS/NIS presently I install
  757. the UW1.x version as /usr/lib/mail/surrcmd/mailalias.alt and edit the line in
  758. mailsurr.proto accordingly.
  759.  
  760. The changes are as follows:
  761.  
  762. # Run all (apparently) local names through the mail alias processor.
  763. # This version uses mailalias.alt which is the 1.x version
  764. #
  765. '.+'    '.+'                    'Translate T=1;B=*; R=|/usr/lib/mail/surrcmd/mailalias.alt -P%L! -P%U! -P%L\%D! -P%U\%D! -S@%U\%D -S@%L\%D -S@%L -S@%U -r -p' '%n'
  766.  
  767. A copy of the UW1.x version of mailalias is available on the Freebird
  768. archive.
  769.  
  770. Subject: M15.2) Set the mail domain information in /etc/mail/mailcnfg
  771.  
  772. You can establish many of the mail configuration parameters  by using
  773. the Admin_Tools/Mail_Setup GUI Tool. One of the things this does is
  774. to enter parameters into the file /etc/mail/mailcnfg - a file that does
  775. not exist by default.
  776.  
  777. A typical file is as follows:
  778.  
  779. ADD_DATE=1
  780. ADD_FROM=1
  781. ADD_RECEIVED=1
  782. DOMAIN=novell.co.uk
  783. SMARTERHOST=usl.com
  784. ADD_MESSAGE_ID=1
  785. FORCE_7BIT_HEADERS=1
  786. FORCE_7BIT_MIME=1
  787. ADD_TO=1
  788. FORCE_MIME=1
  789.  
  790. Important parameters here are:
  791.  
  792. SMARTERHOST - where to send mail in the event that you are
  793. unable to resolve or have no uucp route to a host. Typically this
  794. is your IP provider or another friendly site.
  795.  
  796. DOMAIN - is the mail domain for the From: line in mail. Typically
  797. mail will have the form From: user@nodename.domain. The next section
  798. in this document shows a mail rewrite rule which rewrites
  799. the From: lines so as to make all mail  seem to have come from
  800. just the domain name.
  801.  
  802. Subject: M15.3) Setup any header rewrite rules (/etc/mail/rewrite)
  803.  
  804. Using the default setup with DOMAIN=novell.co.uk, mail will appear
  805. as if it comes from the machinename.novell.co.uk. Many installations
  806. prefer to make it appear as if they have just one email address, their
  807. domain name.
  808.  
  809. The /etc/mail/rewrite file contains functions to rewrite mail headers for
  810. local and remote delivery. The following is a rewrite function
  811. to search for occurrences of node.novell.co.uk and replace them with
  812. just novell.co.uk.
  813.  
  814. function check_headers()
  815. {
  816. var hdr;
  817. # loop through ALL headers
  818. for (hdr from headers_pattern("From:"))
  819.    # if we match a header that has something like foo.xyz.com in it
  820.    if (hdr ~ "[a-zA-Z]\\.novell\\.co\\.uk")
  821.      # then substitute the shorter version in its place
  822.      hdr=gsubstitute(hdr, "[a-zA-Z0-9.]+\\.novell\\.co\\.\\uk", "novell.co.uk");
  823. }
  824.  
  825. So this function should be added to the file /etc/mail/rewrite.
  826. There are two pre-defined special functions within this file - main()
  827. and local().
  828.  
  829. You need to add  this to the function main() which is executed before
  830. any rules in the /etc/mail/mailsurr file are executed.
  831.  
  832. Other functions may be executed from mailsurr via Rewrite rules or
  833. H= invocations  on delivery lines.
  834.  
  835. The function local() is executed for local delivery.
  836.  
  837. An example function to be executed by a H= invocationm is add_from_header.
  838. This is a modified version we use for uucp connections
  839. (this works for us below)
  840.  
  841. # function add_from_header
  842. #
  843. # Add a >From line.
  844.  
  845. function add_from_header()
  846. {
  847.     # Create the From header.
  848.     var retpath, elementArray, newHeader;
  849.     retpath = returnpath();
  850.     if(strstr(retpath, "!") != 0)
  851.         {
  852.         # uucp incoming case
  853.         #retpath = substitute(retpath, "^(.+)!([^!]+)$", "\\1:\\2");
  854.         elementArray = split(retpath, ":");
  855.         elementArray[0] = substitute(elementArray[0], "^@", "");
  856.         newHeader = elementArray[1] @ " " @ fromdate(time()) @ " remote from " @ elementArray[0];
  857.         }
  858.     else if(strstr(retpath, "@") == 0)
  859.         {
  860.         # local delivery so add this machine's domain
  861.         newHeader = retpath @ " " @ fromdate(time()) @ " remote from " @ usefuldomain();
  862.         }
  863.     else
  864.         {
  865.         # over smtp?
  866.         retpath = gsubstitute(retpath, ":@", "!");
  867.         retpath = substitute(retpath, "^@", "");
  868.         if(strstr(retpath, ":") == 0)
  869.             {
  870.             retpath = substitute(retpath, "([^!@]+)@([^@]+)$", "\\2:\\1");
  871.             }
  872.         else
  873.             {
  874.             retpath = substitute(retpath, "([^:]*)[:]([^!@]+)@([^@]+)$", "\\1!\\3:\\2");
  875.             }
  876.  
  877.         elementArray = split(retpath, ":");
  878.         elementArray[0] = substitute(elementArray[0], "^@", "");
  879.         newHeader = elementArray[1] @ " " @ fromdate(time()) @ " remote from " @ elementArray[0];
  880.         }
  881.  
  882.     prepend_header(">From", ">From", newHeader);
  883.  
  884. }
  885.  
  886. function usefuldomain() {
  887. var dom = domain();
  888.   dom = substitute(dom, "^\.", "");
  889.   return dom;
  890. }
  891.  
  892. Also see section M21 for a rewrite function for changing the
  893. Return-Path: mail header.
  894.  
  895. Subject: M15.4) Customizing /etc/mail/mailsurr (/usr/lib/mail/mailsurr.proto)
  896.  
  897. To customize the /etc/mail/mailsurr file and make the changes
  898. permanent you need to make the changes to the file
  899. /usr/lib/mail/mailsurr.proto.
  900.  
  901. Some example changes are below:
  902.  
  903. To see mail to the address "novell.co.uk" as local when the nodename is
  904. mailgate.novell.co.uk add the following entry to /etc/mail/mailcnfg
  905.  
  906. %d=novell.co.uk
  907.  
  908. Add the following line to /usr/lib/mail/surrcmd/ (just after the ACCDOM
  909. line in Part 2 and before the mailalias line)
  910.  
  911. '.+'    '([^@]+)@%d'            'Translate R=\\1'
  912.  
  913. To do this change in a more generic manner add a capital D to the NODOT entry
  914. in mailsurr.proto. (The NODOT was a typo)
  915.  
  916. An alternate to adding %d into the mailcnfg is to put the explicit
  917. line in the mailsurr.proto file; for example:
  918.  
  919. '.+'    '([^@]+)@(uel.co.uk)'            'Translate R=\\1'   # our old domain
  920.  
  921. Subject: M15.5) Setting up delivery lines to mail-servers, list-processors
  922.                 etc (mailsurr.proto)
  923.  
  924. Entries can also be added to setup special delivery lines into
  925. programmes such as the mail-server.
  926.  
  927. Add the entry in part 3 after the ckbinarsys line:
  928.  
  929. '.+'    'mail-server'   '<      /opt/lib/mserv/listener'
  930.  
  931. Subject: M15.6) Activating mail logging
  932.  
  933. You won't get too far without being able to determine whats
  934. going on. The command to switch mail logging on follows:
  935.  
  936. /usr/lib/mail/surrcmd/createSurr -l on
  937.  
  938. Subject: M15.7) Setting up suitable defaults for mailx users
  939.  
  940. Edit the file /etc/mail/mailx.rc and add some suitable site
  941. defaults:
  942.  
  943. set autoprint askcc bang crt=20 dot showto
  944. set metoo cmd=/opt/bin/mailPR page hold
  945. set sendmail=/bin/rmail
  946. set from
  947.  
  948. ignore Message-Id Received Status Content-Type Content-Length Default-Options Auto-Forwarded-From Auto-Forward-Count
  949.  
  950. Subject: M15.8)  If you have local users, then add other mail-user agents :
  951. for example, mush, elm, pine etc
  952.  
  953. If you are using the version of Elm from the mail-server, system
  954. wide defaults are contained in /opt/lib/elm/elm.rc, a sample is below
  955. for our site.
  956.  
  957. ## /opt/lib/elm/elm.rc -- system wide defaults for elm
  958.  
  959. ## default hostname to override uname in From: line
  960. ## for example.
  961. ##   hostname = uel.co.uk
  962. ## If not set, the From: line defaults to the uname
  963. ## hostname = uel.co.uk
  964. hostname = novell.co.uk
  965. hostdomain = novell.co.uk
  966. hostfullname = novell.co.uk
  967.  
  968. ## weedout unwanted mail headers
  969. weedout via Default-Options Auto-Forwarded-From Auto-Forward-Count X-Nvlenv-01DL-Expanded Original-Content-Type Content-Type Content-Length X-Nvlenv-01Date-Transferred X-Nvlenv-01Date-Posted References
  970.  
  971. Subject: M15.9) Update /etc/profile
  972.  
  973.         EDITOR=vi
  974.         postmark="`grep '^'$LOGNAME':' /etc/passwd | cut -d: -f5`"
  975.         ORGANIZATION="Novell Europe."
  976.         export EDITOR postmask ORGANIZATION
  977.  
  978. Subject: M15.10) Setting up smart routing between uucp and internet zones
  979.  
  980. As a mail gateway that has both uucp connections and an internet
  981. connection we need to be able to smart route between the zones.
  982. A utility called pathrouter is provided with UnixWare 2 to enable
  983. this.
  984.  
  985. To enable the pathrouter utility, find the lines beginning
  986. <PATHS> in mailsurr.proto :
  987.  
  988. <PATHS> # Reroute using pathrouter.
  989. <PATHS> #
  990. <PATHS> '.+' '[^@]+' 'Translate R=|/usr/lib/mail/surrcmd/pathrouter %n'
  991. <PATHS>
  992.  
  993. And change these to:
  994.  
  995. # Reroute using pathrouter.
  996. #
  997. #'.+' '[^@]+' 'Translate R=|/usr/lib/mail/surrcmd/pathrouter %n'
  998. '.+'    '.*[!@].*'              'Translate T=1;B=*; R=|pathrouter -p' '%n'
  999.  
  1000. Also add a uucp delivery line (before or after the smtp delivery
  1001. lines depending on your preference)
  1002.  
  1003. #Added for pathrouter
  1004. '.+'    '!([^!]+)!(.+)'         '< B=1024; uux -r -a %R -p -- \\1!rmail' '(\\2)'
  1005.  
  1006. #before <UUCP>
  1007.  
  1008. One thing I also found was to comment out calls to localmail in mailsurr.proto.
  1009.  
  1010. Install paths routing database in /etc/uucp/paths
  1011.  
  1012. Subject: M15.11) Add a rule to mailsurr.proto to catch mail to unknown local users.
  1013.  
  1014. # mailgate setup:
  1015. # This rule included for catching email sent to an unknown local user.
  1016. # This combined with  the use of pathrouter allows unknown local mail
  1017. # to be sent to user@uknown which pathrouter expands to postmaster and the
  1018. # unknown address so an error mesg still gets sent to the originator.
  1019. '.+'    '[^!@]+'                'Translate T=1;B=*; R=|localmail -p -S @unknown' '%n'
  1020.  
  1021. In /etc/uucp/paths add:
  1022.  
  1023. unknown !windsor!postmaster %s  0
  1024.  
  1025. (Note windsor is where the postmast mailbox lives)
  1026.  
  1027. For localdelivery to postmaster this would simply be:
  1028.  
  1029. unknown postmaster %s   0
  1030.  
  1031. Subject: M15.12) Setup uucp over the connection server for  uucp over
  1032. the network (rather than dialup uucp)
  1033.  
  1034. Edit /etc/uucp/Systems.tcp, add entries:
  1035.  
  1036. usl Any CS - -,listen:10103
  1037. usle Any CS - -,listen:10103
  1038. waterloo Any CS - -,listen:10103
  1039. carrera Any CS - -,listen:10103
  1040. marlow Any CS - -,listen:10103
  1041.  
  1042. Edit /etc/uucp/Devices; enable CS - - - CS entry
  1043.  
  1044. Edit /etc/uucp/Permissions
  1045.  
  1046. Subject: M15.13) Setup mail alias files
  1047.  
  1048. Typically, you will want to edit /etc/mail/namefiles and add any filenames
  1049. that you wish to contain your mailing lists. See section M9 for
  1050. examples.
  1051.  
  1052. Subject: M15.14) Install an alternate incoming smtpd so that incoming
  1053. mail connections can be controlled using the TCP/SPX wrappers.
  1054.  
  1055. (see M17 for further details)
  1056.  
  1057. Subject: M15.15) Install the TCP/SPX wrappers so as to monitor who is
  1058.                 connecting.
  1059.  
  1060. If you're paranoid (or security conscious) and want to keep logs of who is
  1061. connecting to your machine, install the TCP/SPX wrappers. If you're
  1062. on the internet you should consider installing this package or the
  1063. netacl's from the TIS Firewall Toolkit in order to control access
  1064. to all TCP services.
  1065.  
  1066. Subject: M16) I have UW2 and my inbound smtpd keeps dying. Is there a fix?
  1067.  
  1068. If you are running 2.0x apply tf2100.tar - although the release
  1069. notes say tf2100 is included  in 2.03 you still need to apply it.
  1070.  
  1071. If you are running 2.1.x update to 2.1.1 or later.
  1072.  
  1073. If these don't work reliably, then an alternative is to use smap/smapd
  1074. from the TIS Firewall toolkit (see the next question on running
  1075. smtpd from inetd on UW2). Another alternative is to
  1076. install sendmail , see elsewhere in this FAQ.
  1077.  
  1078. Subject: M17) I have UW2 - smtpd now runs as a daemon - is there a way to run
  1079. it from inetd? Running from inetd makes it more reliable and also
  1080. can be wrapped.
  1081.  
  1082. You can run the smap/smapd programmes from the TIS Firewall Toolkit V1.3
  1083. as replacements for the inbound smtpd. These have been ported
  1084. to UnixWare2 /rmail subsystem - binaries can be found in the
  1085. internet/server/fwtk/smap directory on the Freebird archive.
  1086.  
  1087. smap is a simple incoming smtp daemon invoked from inetd.
  1088. Its job in life is to store incoming mail for processing by
  1089. smapd. It runs chroot'd in the incoming mail spool area.
  1090.  
  1091. smapd reads mail from the incoming spool area, and hands it
  1092. off to the real mail subsystem
  1093.  
  1094. The idea behind this mailer is that smap is simple and understandable
  1095. and robust, and can be run on a firewall - you can also run
  1096. it as a replacement to the stock smtpd daemon if you prefer -
  1097. and this allows you to use tcp wrappers if you wish.
  1098.  
  1099. The files provided on the server with smap contain a new /etc/rc2.d/S81smtp
  1100. script that auto detects if smapd is in place and runs smapd
  1101. on system startup - this assumes you'll reconfigure
  1102. your inetd to include the smap and restart it.
  1103.  
  1104. Subject: M18) I have UW2  and my outbound smtp  does incorrect routing to MX
  1105. record sites and also continually bounces mail when sending
  1106. to an unknown user when it should only bounce once - is there a fix?
  1107.  
  1108. If you are running UW2.0x apply tf2100 - or update to 2.1.1 or later.
  1109. Alternately consider installing the sendmail package from the
  1110. freebird archive.
  1111.  
  1112. Subject: M19) I'm having trouble routing email from my local machine to the net.
  1113. I'm connected to a local internet provider and can run Mosaic etc
  1114. but can't send email. What do i need to do to make this work?
  1115.  
  1116. Either (1) use them as a SMARTERHOST (for mail forwarding if
  1117. they are agreeable),  by setting
  1118.         SMARTERHOST=ipprovider.domain
  1119. in /etc/mail/mailcnfg
  1120.  
  1121. and  updating the /etc/mail/mailsurr mail configuration file (best to
  1122. back it up first) by the following:
  1123.  
  1124.         su
  1125.         /usr/lib/mail/surrcmd/createSurr
  1126.  
  1127. CreateSurr looks at the system configuration
  1128. and using the /usr/lib/mail/mailsurr.proto file creates a new
  1129. /etc/mail/mailsurr file , in this case it enables a section of the
  1130. mailsurr file to forward all mail to unknown sites to the site
  1131. specified by SMARTERHOST. You may want to make sure that the IP
  1132. address of the site specified by SMARTERHOST is in your /etc/hosts
  1133. files.
  1134.  
  1135. Alternately (2) if you have DNS working  backup /usr/lib/mail/mailsurr.proto
  1136. and then edit it changing the smtpqer lines to remove the -N flag,
  1137. which tells smptqer to do a DNS lookup.
  1138.  
  1139. And then create a new /etc/mail/mailsurr file:
  1140.  
  1141.         su
  1142.         /usr/lib/mail/surrcmd/createSurr
  1143.  
  1144. If you create the /etc/mail/mailcnfg file (btw check the manual page for details
  1145. on mailcnfg) the permissions should be  444 bin mail.
  1146. On my UnixWare 1.x machines we have the following.
  1147.  
  1148. SMARTERHOST=usg
  1149. ADD_DATE=true
  1150. ADD_FROM=true
  1151. REMOTEFROM=novell.co.uk
  1152.  
  1153. You should change SMARTERHOST and REMOTEFROM accordingly.
  1154.  
  1155. If you choose to have SMARTERHOST set to a fully qualified domain name
  1156. i.e. usg.novell.com
  1157.  
  1158. Then toggle two lines in part 3 of the /etc/mail/mailsurr to use
  1159. smtp delivery first...
  1160.  
  1161. You'll have something like this in part 3 (for UnixWare 1.x),
  1162.  
  1163. '.+'    '!([^!]+)!(.+)'         '< B=512; uux -a %R -p -- \\1!rmail' '(\\2)'
  1164. '.+'    '!([^!]+)!(.+)'         '< B=4096; smtpqer -N %R \\1' '\\2'
  1165.  
  1166. Swap the two lines around.
  1167.  
  1168.  
  1169. Subject: M20)Mail sent to my domain mydom.com does not arrive locally on the
  1170. machine. It gets here but the local mailsystem does not recognise it
  1171. as local.
  1172.  
  1173. The Mail Setup GUI has a button to select to catch mail to the domain
  1174. for local delivery. This activates the NODOT entry in the mailsurr file.
  1175. This in fact should be  DNODOT  (edit /usr/lib/mail/mailsurr.proto and
  1176. change the occurrence of NODOT to DNODOT, re-run createSurr and this
  1177. should work correctly).
  1178.  
  1179. (Note that this is fixed in update2.03 and tf2100.tar)
  1180.  
  1181. Subject: M20.1) How can I set other mail domains besides my real domain
  1182. to be treated as local?
  1183.  
  1184. If you have multiple domain names that you want to
  1185. receive mail, you can add an entry to /etc/mail/mailcnfg
  1186.  
  1187. %d=myotherdom.com
  1188.  
  1189. Edit /usr/lib/mail/mailsurr.proto
  1190. to create a translation entry in  that file.  The user@domain
  1191. entry is shown below from the mailsurr.proto file:
  1192.  
  1193. # Map all names of the form user@local-machine -> user
  1194. # Map all names of the form user@uname -> user
  1195. # Map all names of the form user@domain
  1196. # Then loop back through from the top.
  1197. #
  1198. '.+'  '(.+)@%L'    'Translate R=\\1'
  1199. '.+'  '(.+)@%U'    'Translate R=\\1'
  1200. '.+'  '(.+)@%d'    'Translate R=\\1'   #This is the added entry for user@domain
  1201.  
  1202. Then run the script /usr/lib/mail/surrcmd/createSurr.
  1203.  
  1204. If mail is coming in via the internet you'll also need to
  1205. setup an MX record for the other domain to tell it to send mail
  1206. to this host.
  1207.  
  1208. Subject: M21) I'm using UnixWare2 and when mail arrives locally the Return-Path:
  1209. header has the format @myprovider:remotedomain!user or @domain:user or
  1210. @domain:user@domain.  Is there someway to put this into normal
  1211. domain address format?
  1212.  
  1213. The following rewrite function edits the Return-path: header
  1214. for locally delivered email into normal domain address format.
  1215. Add the following functions to the file /etc/mail/rewrite.
  1216.  
  1217. function local()
  1218. {
  1219.         fix_return_path();
  1220. }
  1221.  
  1222. function fix_return_path()
  1223. {
  1224.     var hdr;
  1225.     # loop through the headers of this name
  1226.     for (hdr from headers("Return-path"))
  1227.         {
  1228.         if (hdr ~ "@([a-zA-Z0-9.]+):([a-zA-Z0-9.]+)!([a-zA-Z0-9.]+)" )
  1229.             {
  1230.             hdr = gsubstitute(hdr, "@([a-zA-Z0-9.]+):([a-zA-Z0-9.]+)!([a-zA-Z0-9.]+)", "\\3@\\2");
  1231.             }
  1232.         if (hdr ~ "@([a-zA-Z0-9.]+):([a-zA-Z0-9.]+)@([a-zA-Z0-9.]+)" )
  1233.             {
  1234.             hdr = gsubstitute(hdr, "@([a-zA-Z0-9.]+):([a-zA-Z0-9.]+)@([a-zA-Z0-9.]+)", "\\2@\\3");
  1235.             }
  1236.         if (hdr ~ "@([a-zA-Z0-9.]+):([a-zA-Z0-9.]+)" )
  1237.             {
  1238.             hdr = gsubstitute(hdr, "@([a-zA-Z0-9.]+):([a-zA-Z0-9.]+)", "\\2@\\1");
  1239.             }
  1240.         }
  1241. }
  1242.  
  1243. Subject: M22) Large mail alias lists don't seem to work on UnixWare 2. Is this
  1244. a known problem?
  1245.  
  1246. This is a bug. To fix this you need to apply one of the mail updates in
  1247. section M2.
  1248.  
  1249. An alternative workaround is to use the UnixWare 1.x version of mailalias.
  1250. This loses some functionality , i.e. is not driven off the
  1251. /etc/mail/lookupLibs file and only looks up aliases based
  1252. off the files referenced in /etc/mail/namefiles; but then is
  1253. thus faster.
  1254.  
  1255. I have installed this on my UW2 mail gateway as
  1256. /usr/lib/mail/surrcmd/mailalias.alt
  1257.  
  1258. and adjusted the /usr/lib/mail/mailsurr.proto file as:
  1259.  
  1260. '.+'    '.+'                    'Translate T=1;B=*; R=|/usr/lib/mail/surrcmd/mailalias.alt -P%L! -P%U! -P%L\%D! -P%U\%D! -S@%U\%D -S@%L\%D -S@%L -S@%U -r -p' '%n'
  1261.  
  1262. And then recreated the /etc/mail/mailsurr file with
  1263.  
  1264. /usr/lib/mail/surrcmd/createSurr -l on
  1265.  
  1266. A copy of the UW1.x version of mailalias is on the Freebird archive
  1267. as mailalias.bin.UW1.Z.
  1268.  
  1269. Subject: M23) smtp mail to hosts which only have MX records and no valid A
  1270. records never gets there? This is with the 2.0 developer release.
  1271.  
  1272. This is  a bug fixed in the 2.01 version of smtpd. Update to 2.01,2.02 or 2.03
  1273. or apply tf2100.tar.
  1274.  
  1275. Subject: M24) How do I make the mailsystem send mail for local addresses off
  1276. to another host if they are not found locally without setting up
  1277. aliases?
  1278.  
  1279. Enable the following line in the mailsurr file, replacing the HOST.DOMAIN
  1280. field by the appropriate values.
  1281.  
  1282. # If you have a flat name space across multiple machines, but user-names only
  1283. # exist on disjoint machines, this entry will forward any name not known
  1284. # locally off to the given host.
  1285. #
  1286. #'.+'   '[^!@]+'                'Translate T=1;B=*; R=|localmail -p -S @HOST.DOMAIN' '%n'
  1287.  
  1288. Subject: M25) How can I get mailx/dtmail to add fullname information to
  1289. the From: line?
  1290.  
  1291. UnixWare rmail/mail adds additional information to the From: line based
  1292. on the postmark environment variable. On our systems we typically
  1293. add the following to /etc/profile:
  1294.  
  1295.         postmark="`grep '^'$LOGNAME':' /etc/passwd | cut -d: -f5`"
  1296.         export postmark
  1297.  
  1298. Subject: M26) How can I set all the From: line  (hiding the internal hosts to a
  1299. mail domain)?
  1300.  
  1301. This can be done either in the mail user agent , that is mailx, dtmail ,
  1302. elm or mush , which are described here , or alternately using the
  1303. rewrite rules in /etc/mail/rewrite (only in UnixWare 2 - see question
  1304. M15 section 3 for details on this feature).
  1305.  
  1306. ==>mailx/dtmail:
  1307.  
  1308. In your .mailrc for mailx,dtmail
  1309.  
  1310. set  postmark="myname@my.domian (My Fullname)"
  1311.  
  1312. From the mailx man page:
  1313.  
  1314.              postmark=string
  1315.                    The specified string is included in the comment field of
  1316.                    the From: header of messages that you send.  The string
  1317.                    is usually set to your name.  See from and translate.
  1318.                    If the string includes an @, it will be used for the
  1319.                    entire From: header.
  1320.  
  1321. ==>For elm, edit /opt/lib/elm/elm.rc
  1322.  
  1323. ## /opt/lib/elm/elm.rc -- system wide defaults for elm
  1324.  
  1325. ## default hostname to override uname in From: line
  1326. ## for example.
  1327. ##   hostname = uel.co.uk
  1328. ## If not set, the From: line defaults to the uname
  1329. ## hostname = uel.co.uk
  1330. hostname = my.domain
  1331. hostdomain = my.domain
  1332. hostfullname = my.domain
  1333.  
  1334. ==>For mush
  1335.  
  1336. in your system mushrc file
  1337.  
  1338. set hostname=my.domain
  1339.  
  1340. Subject: M27) I want to setup a cluster of machines, with a single mail
  1341. gateway machine.
  1342.  
  1343. (for UW1) Use the sample files client.mailcnfg and client.mailsurr to
  1344. make the internal hosts forward all mail to the gateway. And then
  1345. just configure the mail gateway to be a smarthost for mail.
  1346.  
  1347. On UnixWare 2 setup a client machine with the GUI so that all
  1348. mail is forwarded to a smarter host - which can be your local
  1349. email gateway. Copy the resulting /etc/mail/mailsurr and /etc/mail/mailcnfg
  1350. files - install on each machine in the cluster - and edit S81smtp so
  1351. as not to call createSurr and rewrite the /etc/mail/mailsurr file on
  1352. each reboot.
  1353.  
  1354. Subject: M28) How can i make bounced email go to the postmaster if the user
  1355. address is invalid?
  1356.  
  1357. A simple way just to send the message to the postmaster follows:
  1358. '.+'    '[^!@]+'                'Translate T=1;B=*; R=postmaster'
  1359.  
  1360. You should add these lines to the /usr/lib/mail/mailsurr.proto file
  1361. before part 4 (postprocessing commands),
  1362. and use the command /usr/lib/mail/surrcmd/createSurr to create a new
  1363. mailsurr file (best to backup your existing mailsurr file first).
  1364. CreateSurr looks at the system configuration
  1365. and using the /usr/lib/mail/mailsurr.proto file creates a new
  1366. /etc/mail/mailsurr file .
  1367.  
  1368. Subject: M29) How can i debug mail delivery?
  1369.  
  1370. There are two commands you can execute to see whats happening:
  1371.  
  1372. /bin/mail -d address
  1373. message
  1374. <ctrl-d>
  1375.  
  1376. Will show you a short list of translations and delivery commands
  1377. (and will deliver the message).
  1378.  
  1379. /bin/mail -T "" address
  1380.  
  1381. will show you in gorey detail the translations taken from the
  1382. default mailsurr file.  This can be used to determine whether a problem
  1383. can be isolated to the address translation.
  1384.  
  1385. Subject: M30) How can i debug the /etc/mail/rewrite rules?
  1386.  
  1387. Set the following environment variable:
  1388.  
  1389. MAILR_DEBUG=10
  1390. export MAILR_DEBUG
  1391.  
  1392. /bin/mail -d email-address
  1393. msg
  1394. <ctrl-d>
  1395.  
  1396. This lets you see what the rewrite rules are doing.
  1397.  
  1398. Subject: M31)How can I use the rewrite rules to rewrite a To: header
  1399. of the format uunet!domain!user to user@domain?
  1400.  
  1401. Add a call to the function fix_to_line() in the main() function of
  1402. /etc/mail/rewrite so this is called for remote mail delivery.
  1403.  
  1404. function main()
  1405. {
  1406.         ...
  1407.         fix_to_line("To");
  1408. }
  1409.  
  1410. function fix_to_line(var hdrname)
  1411. {
  1412.     var hdr;
  1413.     # loop through the headers of this name
  1414.     for (hdr from headers(hdrname))
  1415.         {
  1416.         # if the header has uunet!domain!user in it
  1417.         if (hdr ~ "uunet!([a-zA-Z0-9.]+)!([a-zA-Z0-9.]+)" )
  1418.             {
  1419.             # then convert !uunet!domainr!user to user@domain
  1420.             hdr = gsubstitute(hdr, "uunet!([a-zA-Z0-9.]+)!([a-zA-Z0-9.]+)", "\\2@\\1");
  1421.             }
  1422.         }
  1423. }
  1424.  
  1425. Subject: M32) I have  tcp installed yet i only want to do transfers over
  1426. uucp. How do i make the mailsurr file exclude the smtpqer delivery lines?
  1427.  
  1428. Comment out the smtpqer entries in the /usr/lib/mail/mailsurr.proto and
  1429. execute /usr/lib/mail/surrcmd/createSurr to eliminate the smtp delivery command.
  1430.  
  1431. Subject: M33) I'm sending to a SCO system over uucp which only understands
  1432. RFC822. The UnixWare mailsystem inserts an extra From line which upsets the SCO
  1433. mailer.
  1434.  
  1435. (for UW1)
  1436.  
  1437. To have the From line stripped when sending mail via UUCP
  1438. an I=1; would need to be prepended to  the uux delivery command lines in the
  1439. mailsurr.proto file, otherwise the mail will bounce because of this
  1440. postmark line. Then execute /usr/lib/mail/surrcmd/createSurr to update the
  1441. /etc/mail/mailsurr file.
  1442.  
  1443. Subject: M34) Where are outgoing messages stored for smtp?
  1444.  
  1445. (for UW1)All outgoing mail messages for SMTP are located in /var/spool/smtpq
  1446. under the domain/host directories.
  1447.  
  1448. (for UW2) Mail msgs are now stored in /var/spool/mailq .
  1449.  
  1450. Subject: M35) Mail is bouncing back with problems about an invalid
  1451. From header line, what should I do?
  1452.  
  1453. (for UnixWare 2.0x)
  1454. Please apply patch tf2100.tar. This symptom is often seen
  1455. when communicating with Microsoft Mail or cc:Mail.
  1456.  
  1457. Subject: M36) After changing the system owner to another user and
  1458. deleting the original user, mail is still being sent to the original
  1459. system owner for example when a new package is installed,
  1460. and errors stating "unable to send to " appear after adding a package.
  1461.  
  1462.  
  1463. This is caused since the files
  1464.  
  1465. /var/sadm/install/admin/check and
  1466. /var/sadm/install/admin/default contain a line
  1467. "mail=username username2 etc.
  1468.  
  1469. These files do not get updated when some users are deleted from the system.
  1470. The fix is to manually take out the names of the non existing user
  1471. from the mail= line in /var/sadm/install/admin/check and
  1472. default.
  1473.  
  1474. Subject: M37) Why when I send local mail does my PPP link get established, for
  1475. example when I pkgadd or pkgrm a package?
  1476.  
  1477. On UnixWare 2 this is triggered by the mailalias program.
  1478. There is a file in /etc/mail called lookupLibs (built from
  1479. /usr/lib/mail/lookupLibs.proto) that contains references to shared
  1480. libraries used to lookup aliases.  By default if you have DNS defined
  1481. in your mailflgs file, mailalias will connect to your name server to
  1482. ask it about aliases.  To work around this just comment out the <DNS> line
  1483. /usr/lib/mail/lookupLibs.proto and /etc/mail/lookupLibs.
  1484.  
  1485. Subject: M38) Is it possible to change the sender address with
  1486. mailsurr's translation facilities?  The man page indicates
  1487. that only the recipient address can be changed.
  1488. Am I going to have to move to sendmail?
  1489.  
  1490. For UnixWare 2.x we add functions to the file /etc/mail/rewrite
  1491. to rewrite mail headers.
  1492.  
  1493. Subject: M39) How do I setup a POP3 server on UnixWare ?
  1494.  
  1495. The POP server is included in UW2 in /usr/lib/mail/surrcmd/popper,
  1496. however there's a problem with truncation of the last mail
  1497. message with that version.
  1498.  
  1499. Either pick up tf2100 from ftp.sco.com:/UW20
  1500.  
  1501. or get one of the freeware versions from ftp.abs.net|ftp.novell.co.uk
  1502. in /pub/unixware/freebird/mailtools/popper  (source and binaries
  1503. available).
  1504.  
  1505. To make operational, you need to do the following:
  1506.  
  1507.  (i) edit /etc/services, ensure there is an entry
  1508.  
  1509. pop3            110/tcp                         # Post Office
  1510.  
  1511.  (ii) edit /etc/inetd.conf, add an entry
  1512.  
  1513.  pop3   stream  tcp     nowait  root    /replace_with_Path_to_popper/popper             popper
  1514.  
  1515.  (iii) Restart inetd, by sending a kill -HUP to the inetd PID.
  1516.  
  1517. Subject: M40) I'm using UnixWare 1.x and  I can't find the createSurr command,
  1518. what should i do?
  1519.  
  1520. This occurs because you did not install the nuc package.
  1521.  
  1522. Subject: M41) How do I setup my mail to be autoanswered?
  1523.  
  1524. This is done by using the vacation command.
  1525. To setup the default autoanswering message just type
  1526.  
  1527.         vacation
  1528.  
  1529. For example:
  1530.  
  1531.         $ vacation
  1532.         UX:vacation: INFO: Vacation notification installed
  1533.         UX:vacation: INFO: Logging will go to '/opt/lib/mserv/.maillog'
  1534.         UX:vacation: INFO: '/usr/share/lib/mail/std_vac_msg' will be used for the canned message
  1535.  
  1536. This will cause the system to send the following standard reply:
  1537.  
  1538.         Subject: AUTOANSWERED!!!
  1539.  
  1540.         I am on vacation. I will read (and answer if necessary)
  1541.         your e-mail message when I return.
  1542.  
  1543.         This message was generated automatically and you will
  1544.         receive it only once, although all messages you send
  1545.         me while I am away WILL be saved.
  1546.  
  1547. A list of senders is kept in the file $HOME/.maillog, and
  1548. incoming mail is kept in your normal mailbox by default,
  1549. since the UnixWare mailer keeps the forwarding information in
  1550. /var/mail/:forward and not in the mailbox file as in earlier SVR4.0 releases.
  1551.  
  1552. If you would prefer to customise the reply, prepare a message in a
  1553. file and then give the filename as an option to the vacation utility,
  1554. for example:
  1555.  
  1556.         vacation -M message
  1557.  
  1558. For example:
  1559.         $ vacation -M Msg
  1560.         Forwarding to |/usr/lib/mail/vacation2 -o %R -M Msg
  1561.         $
  1562.  
  1563. For example the message might contain (Note: the ``From:'' line is the address
  1564. for folks to reply to -- this should be of the form username@domain_addr, this
  1565. may not be needed if your mail subsystem puts a From: line for you, there
  1566. should be an entry ADD_FROM=true in /etc/mail/mailcnfg if using the default
  1567. mailer [/bin/mail])
  1568.  
  1569.         Subject: AUTOANSWERED!!!
  1570.         From: postmast@novell.co.uk (Postmaster)
  1571.  
  1572.         I am permanently on vacation. I will read (and answer if necessary)
  1573.         your e-mail message when and if  I return, and if I can be bothered.
  1574.  
  1575.         This message was generated automatically and you will
  1576.         receive it only once, although all the messages you send
  1577.         me while I am away WILL be saved.
  1578.  
  1579.         If your mail is really for the attention of somebody else, then why
  1580.         did n't you send it to them in the firstplace :-) Alternately try
  1581.         sysadmin@novell.co.uk :-)
  1582.  
  1583.           -- The Postmaster
  1584.  
  1585. To  read your mail while vacation is in effect:
  1586.  
  1587. You can use your normal mail user agent (elm, mush, mailx or whatever),
  1588. since the UnixWare mailer keeps the forwarding information in
  1589. /var/mail/:forward and not in the mailbox file as in earlier SVR4.0 releases.
  1590.  
  1591.  
  1592. To remove the vacation facility:
  1593.  
  1594.         /bin/mail -F ""
  1595.  
  1596. or
  1597.         vacation -n
  1598.  
  1599. For example:
  1600.         $ /bin/mail -F ""
  1601.         UX:mail: INFO: Forwarding removed
  1602.         $
  1603.  
  1604. Subject: M42) How do I setup my mail to be forwarded?
  1605.  
  1606. To forward all your mail to another person or another mailbox use
  1607. the following command :
  1608.  
  1609. To forward to a single person, e.g.
  1610.  
  1611.         /bin/mail -F andrew
  1612.  
  1613. To forward to more than one person use a quoted string:
  1614.  
  1615.         /bin/mail -F "andrew plord"
  1616.  
  1617. for example:
  1618.  
  1619.         $ /bin/mail -F "andrew plord"
  1620.         UX:mail: INFO: Installing forwarding to local address: andrew
  1621.         UX:mail: INFO: Installing forwarding to local address: plord
  1622.         UX:mail: INFO: Forwarding to andrew plord
  1623.  
  1624. It is also possible to combine a forward with the vacation programme:
  1625.  
  1626. for example
  1627.  
  1628.  
  1629.         $ vacation -M $HOME/.MSG -f andrew
  1630.         UX:vacation: INFO: Vacation notification installed
  1631.         UX:vacation: INFO: Logging will go to '/opt/lib/mserv/.maillog'
  1632.         UX:vacation: INFO: '/opt/lib/mserv/.MSG' will be used for the canned message
  1633.  
  1634. To confirm the forward is in effect, cat the :forward/user-id file:
  1635.  
  1636.         $ cat /var/mail/:forward/mserv
  1637.         Forward to andrew | C=0;S=2;F=*; /usr/lib/mail/vacation2 -o %R -M /opt/lib/mserv/.MSG
  1638.  
  1639. Note that you should not edit the /var/mail/:forward files directly
  1640. else they will loose the correct permissions and email delivery will
  1641. fail.
  1642.  
  1643. Subject: M43) How do I setup a mail-server?
  1644.  
  1645. The mail-server we use at novell.co.uk is the Squirrel mail-server
  1646. version 3.01 . This is written by Johan Vromans and is mainly
  1647. written in perl.
  1648.  
  1649. A binary version ready for use with UW1.x or UW2 is on the
  1650. Freebird archive
  1651. ftp.abs.net:/unixware/freebird/mailtools/mail-server.bin.tar.Z.
  1652.  
  1653. The steps to install this are as follows:
  1654.  
  1655. Create an account mserv, with the home directory rooted in
  1656. /opt/lib/mserv.  We assume the mail-server archive tree is in
  1657. /home/mserv-archive, if its elsewhere make a symlink.
  1658.  
  1659.         useradd -s /usr/bin/ksh -d /opt/lib/mserv mserv
  1660.         (mkdir /opt/lib if it does not exist)
  1661.         cd /opt/lib
  1662.         zcat mserv.tar.Z|tar xvf -
  1663.         chown -R mserv mserv
  1664.         chown root mserv/listener
  1665.  
  1666. To run the mail-server, you need to install ALL the following packages:
  1667. utils/perl-4.0pl36.pkg.tar, archivers/gzip-1.2.4.pkg.tar,
  1668. utils/gnufind-3.7.pkg.tar.  All these packages are on the
  1669. novell.co.uk mail-server archive.
  1670.  
  1671. You also need to allow  the mserv account to use cron,
  1672. edit  /usr/lib/cron/cron.allow and add the mserv user.
  1673.  
  1674. To test prior to running out of cron, login as user mserv
  1675.  
  1676.         ./listener -noqueue
  1677.  
  1678. You can then type interactive requests
  1679.  
  1680. Once you are happy, edit the file
  1681.  
  1682.         mserv.hints
  1683.  
  1684. Place the files you want to serve in /home/mserv-archive,
  1685. run some of the indexing commands by hand
  1686.  
  1687.         ./makeindex
  1688.         ./makels
  1689.         ./changes
  1690.  
  1691. Then enable the crons
  1692.  
  1693.         crontab ctab
  1694.  
  1695. Next stage, enable in the mailsubsystem. This can be done
  1696. by editing /usr/lib/mail/mailsurr.proto and editing the following in
  1697. section 3 of the file after the ckbinarsys entry.
  1698.  
  1699. # mail-server, mailing lists and information distribution handling section
  1700. '.+'    'mail-server'   '<      /opt/lib/mserv/listener'
  1701.  
  1702. Then run /usr/lib/mail/surrcmd/createSurr -l on.
  1703.  
  1704. #       /etc/mail/extaliases
  1705.  
  1706. Then run /usr/lib/mail/surrcmd/createSurr -l on.
  1707.  
  1708. On the system that the mail-server runs I have a mailbox called
  1709. bit-bucket, which as long as it exists in /var/mail/bit-bucket
  1710. and is mode 660 owner mserv, group mail is used to catch
  1711. all admin mail.
  1712.  
  1713. System aliases are added a file in /etc/mail, /etc/mail/names
  1714.  
  1715. ### Mailserver ###
  1716. # if you want mail to go to real people
  1717. #mserv          plord andrew
  1718. # else put it in a mailbox
  1719. mserv           bit-bucket
  1720.  
  1721. # various typos on mail-server
  1722. mailserv        mail-server
  1723. mailserver      mail-server
  1724. mail_server     mail-server
  1725. mail-serverl    mail-server
  1726. mail-serv       mail-server
  1727. mail-serve      mail-server
  1728. mail-sarver     mail-server
  1729. mailx-server    mail-server
  1730. mailer-server   mail-server
  1731. ftpmail         mail-server
  1732.  
  1733. # various strange things that requestors send, best to dump them in the
  1734. # bit-bucket mailbox
  1735.  
  1736. reply-address   bit-bucket
  1737. your-address-here       bit-bucket
  1738. your-mail-address-goes-here     bit-bucket
  1739. address-to-reply-to     bit-bucket
  1740. your-email-address      bit-bucket
  1741.  
  1742. File Permissions:
  1743.  
  1744. All files except listener can be owned by user mserv.
  1745. listener has to be owned by root and setuid.
  1746.  
  1747. Subject: M44) How do I  setup a mailing list - such as Listproc ?
  1748.  
  1749. A port of ListProcessor Version 6.0, Binary distribution for UnixWare
  1750. is available on ftp.novell.de:/pub/unixware/usle/mailtools/listproc.bin.tar.Z.
  1751.  
  1752. Please observe the copyright notice below:
  1753.  
  1754. ListProcessor version 6.0 by Anastasios Kotsikonas, Copyright (c) 1991-93.
  1755. Use, duplication or disclosure by the U.S. Federal Government is subject to the
  1756. restrictions set forth in FAR 52.227-19(c), Commercial Computer Software or,
  1757. for U.S. Department of Defense Users, by DFAR 252.227-7013(c)(1)(ii).
  1758.  
  1759. Note:
  1760. To make this work with the UnixWare mail subsystem (mailsurr), the
  1761. formail utility from procmail has been used as a front end to
  1762. the ListProcessor catmail utility, to edit the headers etc.
  1763.  
  1764. Installation instructions for this distribution
  1765.  
  1766. (1) Login as root
  1767.  
  1768. If you are running straight UnixWare 2.0 , 2.01 or 2.02
  1769. you need to apply a patch to the smtp subsystem.
  1770.  
  1771. The supported version can be obtained from
  1772. ftp.sco.com:/UW20/tf2100.tar
  1773.  
  1774. (2) Then install the listproc tools into /home/listserv as follows:
  1775.  
  1776. cd /home
  1777. zcat listproc.tar.Z|tar xvf -
  1778. useradd -d /home/listserv -s /usr/bin/ksh listserv
  1779. chown -R listserv listserv
  1780. vi /usr/lib/cron/cron.allow     append listserv to the end of this file
  1781.  
  1782. (3) Setup the mailaliases etc:
  1783.  
  1784. You need to add entries in the /etc/mail/mailsurr file
  1785. for your mailing lists. This can be done by editing the
  1786. file /usr/lib/mail/mailsurr.proto adding the lines below
  1787. (note xopen-testing is an example) and then running the
  1788. command:
  1789.  
  1790.         /usr/lib/mail/surrcmd/createSurr -l on
  1791.  
  1792. ####
  1793. #### Part 3
  1794. ####
  1795. #### Delivery commands should go here.
  1796. ####
  1797.  
  1798. # Check for binary mail. Uncomment this if you want to use it.
  1799. #
  1800. #'.+'   '!([^!]+)!.+'           '< F=*;C=0; /usr/lib/mail/surrcmd/ckbinarsys -t %C -s \\1'
  1801.  
  1802. # mailgate setup:
  1803. # mail-server, mailing lists and information distribution handling section
  1804. # admin requests
  1805. '.+'    'listproc'      '<S=0;      /home/listserv/catmail -r -f'
  1806. # mailing lists
  1807. '.+'    'xopen-testing'         '<S=0;F=1-255;C=*;  /home/listserv/catmail -L XOPEN-TESTING -f'
  1808.  
  1809. (4) Edit /etc/mail/namefiles and add:
  1810. /etc/mail/listaliases
  1811.  
  1812. This tells mailalias to look in this file for additional aliases.
  1813. Add the following to that list, change the name (andrew)
  1814. as appropriate
  1815.  
  1816. ### Mailing Lists ###
  1817.  
  1818. # who is the overall admin for listproc
  1819. list-admin      andrew
  1820. # if you share this file on multiple machines enable the next line
  1821. # to get the mail to the right machine
  1822. #xopen-testing  lechladel!xopen-testing
  1823. xopen-testing-request   listproc
  1824.  
  1825. (5) Login as user listserv:
  1826.  
  1827. Edit the config file and change values in there as appropriate for
  1828. your configuration.
  1829.  
  1830. The organization line needs changing, as do the lists that
  1831. you define. In this example a list xopen-testing is shown.
  1832. This list requires all subscription requests to be approved
  1833. by the list owner.
  1834.  
  1835. Also in this example the lists are running on a machine called
  1836. lechlade, you want to change all email addresses to be those
  1837. of your mail domain.
  1838.  
  1839. Check out the documentation in the doc directory.
  1840.  
  1841. Lastly when you are ready and feel you have an understanding,
  1842. install a crontab entry .
  1843.  
  1844. Install a cron file to start the server:
  1845.         crontab crontab
  1846.  
  1847. This will start the server.
  1848.  
  1849. To test, send some mail to listproc, and also to xopen-testing.
  1850. It takes a while for the listproc to awake the first time, since
  1851. its only started on the hour, once awake the daemon keeps running.
  1852. Edit the crontab to start the daemon sooner.
  1853.  
  1854. To see where incoming requests go, if you configured the mailer
  1855. correctly, check the file /home/listserv/requests.
  1856.  
  1857. xopen-testing should say you are not subscribed, you can then
  1858. resend and subscribe. Check both the admin mail box and the
  1859. initiator.
  1860.  
  1861. Look at help/general and change the first line as required.
  1862.  
  1863. To add new lists you have to create a set of files in /home/listserv/lists
  1864. in a subdirectory as well as editing /home/listserv/config.
  1865. Check out the doc directory.
  1866.  
  1867. File & Directory Perms in /home/listserv
  1868.  
  1869. A couple of utilities have to be setuid listserv - see below:
  1870.  
  1871. total 4032
  1872. drwxr-xr-x    2 listserv other         96 Apr 12 14:56 News
  1873. drwx------    3 listserv other         96 Apr 12 14:56 arc
  1874. drwx------    5 listserv tech          96 Apr 12 14:55 archives
  1875. -rw-------    1 listserv tech           0 Jan 18  1994 batch
  1876. drwxr-xr-x    2 listserv other         96 Apr 12 14:56 bin
  1877. -rwsr-xr-x    1 listserv other         86 Apr 17 09:10 catmail
  1878. -rwsr-xr-x    1 listserv other     155400 Jan 26  1994 catmail.prog
  1879. -rw-------    1 listserv tech        6745 Feb 14 19:12 config
  1880. -rw-r--r--    1 listserv other         57 Feb 10  1994 crontab
  1881. drwx------    2 listserv tech        1024 Apr 12 14:55 doc
  1882. -rwx------    1 listserv other     175732 Jan 26  1994 farch
  1883. -rw-------    1 listserv tech          84 Jan 18  1994 flocks
  1884. -rwx------    1 listserv other      15208 Jan 26  1994 fwin
  1885. drwxr-xr-x    2 listserv tech          96 Apr 12 14:56 gateway
  1886. drwx------    2 listserv tech        1024 Apr 12 14:56 help
  1887. -rwxr-xr-x    1 listserv other      13892 Jan 26  1994 ilp
  1888. -rwx------    1 listserv other     321880 Jan 26  1994 list
  1889. -rwx------    1 listserv other     424760 Jan 26  1994 listproc
  1890. drwx------   11 listserv tech        1024 Apr 12 14:55 lists
  1891. -rwxr-xr-x    1 listserv other      45208 Jan 18  1994 make
  1892. -rw-r--r--    1 listserv tech         546 Jan 18  1994 makefile
  1893. drwxr-xr-x    4 listserv other         96 Apr 12 14:56 man
  1894. -rw-------    1 listserv other     251796 Jul  6 08:16 mbox
  1895. drwx------    2 listserv tech        1024 Jul 10 18:57 mqueue
  1896. -rwx------    1 listserv tech        1986 Jan 18  1994 news
  1897. -rw-------    1 listserv tech         892 Jul  5 10:18 owners
  1898. -rwx------    1 listserv tech        1888 Jan 18  1994 peer
  1899. -rwx------    1 listserv other     216956 Jan 26  1994 pqueue
  1900. -rwx------    1 listserv tech        1201 Jan 18  1994 queued
  1901. -rwxr-xr-x    1 listserv other        501 Jan 20  1994 rcp
  1902. -rw-------    1 listserv other         57 Jul  6 08:16 received
  1903. -rwx------    1 listserv tech         502 Jan 18  1994 redux
  1904. -rw-------    1 listserv other          0 Jul  6 08:16 requests
  1905. -rwx------    1 listserv other       4808 Jan 26  1994 rev
  1906. -rwxr-xr-x    1 listserv other       7420 Jan 26  1994 semset
  1907. -rw-------    1 listserv other          6 Jul  6 08:16 sent
  1908. -rwxr-xr-x    1 listserv other     172072 Jan 26  1994 serverd
  1909. -rwx------    1 listserv tech        6931 Jan 20  1994 setup
  1910. -rwx------    1 listserv other     169264 Jan 26  1994 start
  1911. -rwx------    1 listserv tech       23389 Jan 18  1994 systest
  1912. -rwx------    1 listserv other      22312 Jan 26  1994 tlock
  1913. -rwx------    1 listserv tech         133 Jan 18  1994 ulock
  1914. -rw-------    1 listserv tech         700 Jan 18  1994 unwanted.hosts
  1915. drwxr-xr-x    2 listserv tech        1024 Apr 12 14:56 util
  1916. -rw-r--r--    1 listserv tech         591 Jan 18  1994 welcome.live
  1917.  
  1918. Subject: M45) How do I  make sendmail the default mailer?
  1919.  
  1920. Note that this is for the default sendmail included with the base
  1921. system and is not for the Sendmail package included with the
  1922. Free UW212 IFS - please check with SCO for how to configure that.
  1923.  
  1924. On UnixWare 2:
  1925.  
  1926. (Step 1). rename /etc/rc2.d/S81smtp to /etc/rc2.d/s81stmp
  1927. (Step 2).  Start sendmail in /etc/inet/config. Like this:
  1928.  
  1929. # The next line can be read:
  1930. # If field 3 is a Y and /usr/sbin/in.gated was not run, then run
  1931. # /usr/sbin/in.routed -q
  1932. 4b:/usr/sbin/in.routed:/usr/sbin/in.gated:Y::-q:
  1933. ###4c:/usr/sbin/route::n::add default router_placeholder 1
  1934. ###6:/usr/sbin/in.xntpd::y:/etc/inet/ntp.conf::
  1935. 7:/usr/bin/sh::y:/etc/inet/rc.inet:/etc/inet/rc.inet start:
  1936. 4c:/usr/sbin/route::y::add default 129.123.1.254 1:
  1937. ## added by JRD
  1938. 8:/usr/ucblib/sendmail::y:/usr/ucblib/sendmail.cf:-bd -q24h:
  1939. 9:/usr/sbin/syslogd::y:/etc/syslog.conf::
  1940.  
  1941. (Step 3). copy the /etc/ucbmail/mailsurr file over the /etc/mail/mailsurr file.
  1942.  
  1943. Note that you should also check the mailtools/sendmail directory
  1944. on the ftp archive since  there is a binary pkgadd
  1945. version of sendmail there which does the setup automagically.
  1946.  
  1947. Subject: M46) Mail of the address format @mylocal.domain:user@mylocal.domain
  1948.               is not delivered locally, how can I fix this?
  1949.  
  1950. You need to add a line to /usr/lib/mail/mailsurr.proto
  1951. as follows:
  1952.  
  1953. After the uucollapse line add:
  1954.  
  1955. '.+'    '@(%DNODOT)[:,](.+)'               'Translate R=\\2'
  1956. '.+'    '@(%L%D)[:,](.+)'               'Translate R=\\2'
  1957. '.+'    '@(%U)[:,](.+)'         'Translate R=\\2'
  1958.  
  1959. Then run
  1960.  
  1961.         /etc/rc2.d/S81smtp stop
  1962.         /etc/rc2.d/S81smtp start
  1963.  
  1964. Subject: M47) dtmail won't restart after my machine was switched off.
  1965.  
  1966. One of our machines was switched off with a dtmail session active
  1967. and when restarted wont let the user back into mail, saying the mail
  1968. is already being read - any ideas?
  1969.  
  1970. Check /var/mail/:readlock for a file as in username.lock
  1971.  
  1972. Try removing that file. If that does not work and you can't get
  1973. in (due to a kernel lock) move the mailbox in /var/mail aside
  1974. and rename it, then copy it back to the original name (has to be
  1975. done quickly:-)
  1976.  
  1977. Subject: M48) Inbound mail is addressed to
  1978.      <@site.demon.co.uk:user@domain.co.uk>
  1979.      and does not get delivered to the local user.
  1980.  
  1981. Our  Internet provider is Demon, and we are using the mail forwarding service.
  1982. This allows use of user@domain.co.uk, rather than the usual
  1983. user@site.demon.co.uk.
  1984.  
  1985. The problem :-
  1986.  
  1987. The "RCPT TO:" line when receiving mail reads ( As seen in the osm log )
  1988.  
  1989. RCPT TO: <@site.demon.co.uk:user@domain.co.uk>
  1990.  
  1991. Instead of the mail being delivered to the user, it goes to root.  This is the
  1992. same for any user.  Outgoing mail is fine.
  1993.  
  1994. To fix:  edit the /usr/lib/mail/mailsurr.proto file and
  1995. try the following:
  1996.  
  1997. {after uucollapse }; add
  1998.  
  1999. # Strip off local routes to domain, local.domain, uname, uname.alternate
  2000. '.+'     '@(%DNODOT)[:,](.+)'     'Translate R=\\2'
  2001. '.+'     '@(%L%D)[:,](.+)'     'Translate R=\\2'
  2002. '.+'     '@(%U)[:,](.+)'     'Translate R=\\2'
  2003. # put our alternate domain here
  2004. '.+'     '@(%site.demon.co.uk)[:,](.+)'     'Translate R=\\2'
  2005.  
  2006.  
  2007. Subject: M49) I'm using PPP but don't have the interface up when the system
  2008.     creates the mailsurr file, and thus it does not detect my IP
  2009.     link - what can I do?
  2010.  
  2011. Bob Stewart writes:
  2012.  
  2013. If your only networking connection is via ppp, you will have to make
  2014. a change to /usr/lib/mail/surrcmd/configCheck if you want to use smtp
  2015. to send your mail.  Look for the section entitled "Check if IP is up
  2016. and running".  Add the following line immediately after the check to
  2017. just force IP as the mail transport:
  2018.  
  2019. $flaglist{IP} = 1;
  2020.  
  2021. Reboot your system, or alternately as root, type
  2022.  
  2023.         sh /etc/rc2.d/S81smtp stop
  2024.         sh /etc/rc2.d/S81smtp start
  2025.  
  2026. and verify that IP preceeds UUCP in /etc/mail/mailflgs.
  2027.  
  2028. Subject: M50) How can I set mailalias in the form : user@site  maps to
  2029.     local user?
  2030.  
  2031. I run multiple domains in my server and I want to map
  2032.  
  2033.         "sales@abc.com" to a user "andy"
  2034.         "editor@def.com" to a user "ron".
  2035.  
  2036. How should I do this?
  2037. Set up the mailsurr file in the following way...
  2038.  
  2039. Robert A Heller writes:
  2040.  
  2041. We have a script in /etc/mail/vdom that takes two command line
  2042. parameters as:
  2043.  
  2044. /etc/mail/vdom username domain
  2045.  
  2046. If the 'user' is one of a common set between domains like, info,
  2047. accounts, sales, webmaster etc (create your own list), it appends
  2048. an index number to the user name.
  2049.  
  2050. For example, sending to info@vdomain.com will result in mail
  2051. calling vdom as /etc/mail/vdom info vdomain.com
  2052.  
  2053. vdom will find the index number for vdomain.com (say 20) and it
  2054. will then print on the standard output info20, which is returned
  2055. to the mail delivery system.
  2056.  
  2057. The mailsurr file is modified with an entry like:
  2058.  
  2059. '.+'    '([^@]+)@(.*vdomain.com)'       'Translate T=1; R=|/etc/mail/vdom \\1 \\2'
  2060.  
  2061. somewhere before 'local' mail delivery.
  2062.  
  2063. If the username is not one of the 'common' names, but rather a real e-mail
  2064. at that address it simply puts the real name on the output.
  2065.  
  2066. Therefore, if michael is a real user at realdomain.com but owns the
  2067. virtual domain vdomain.com, mail program will...
  2068.  
  2069. /etc/mail/vdom michael vdomain.com
  2070.  
  2071. and the output returned to the mail program for further processing
  2072. will simply be 'michael'.
  2073.  
  2074. Notably,
  2075. '.+'    '([^@]+)@([^@]+)(vdomain.com)'  'Translate T=1; R=|/etc/mail/vdom \\1 \\2'
  2076. does not work.
  2077.  
  2078. Here are our samples:
  2079.  
  2080. -----mailsurr.proto----
  2081. <ACCDOM>        '.+'    '([^@]+)@%{DNODOT}'             'Translate R=\\1'
  2082.  
  2083. # INTERNET_XL begin
  2084. # This is to weed out any addresses of the form user@mail.xl.ca.
  2085.  
  2086. '.+'    '([^@]+)@(.*xl.ca)'             'Translate T=1; R=\\1'
  2087. '.+'    '([^@]+)@(.*xlent.net)'         'Translate T=1; R=\\1'
  2088.  
  2089. # Virtual domains hosted by this server
  2090.  
  2091. '.+'    '([^@]+)@(.*advancedcard.com)'  'Translate T=1; R=|/etc/mail/vdom \\1 \\2'
  2092. '.+'    '([^@]+)@(.*ames-bros.bc.ca)'   'Translate T=1; R=|/etc/mail/vdom \\1 \\2'
  2093. '.+'    '([^@]+)@(.*concerta.com)'      'Translate T=1; R=|/etc/mail/vdom \\1 \\2'
  2094.  
  2095. -------/etc/mail/vdom--
  2096. #!/bin/sh
  2097. vdomain=$2
  2098. #       COUNTER 23
  2099. case $vdomain in
  2100.         *advancedcard.com)      no=1;;
  2101.         *ames-bros.bc.ca)       no=2;;
  2102.         *concerta.com)          no=21;;
  2103.         *)      no=;;
  2104. esac
  2105.  
  2106. case $1 in
  2107.         admin | info | sales | support | accounts | accounting | webmaster | director | orders ) user=$1$no;;
  2108.         *)      user=$1;;
  2109. esac
  2110.  
  2111. printf $user
  2112.  
  2113. Subject: M51) What is the /etc/mail/smtpcnfg file in tf2100/UW2.1?
  2114.  
  2115. This file is read when smtp is started.
  2116.  
  2117. It contains fields of the format
  2118.         field=value
  2119.  
  2120. The default file with UW212 looks like
  2121.  
  2122. MX_FIRST=yes
  2123. USE_LOG_FILES=yes
  2124. USE_WRAPPERS=no
  2125. USE_OSM=no
  2126. TIMEOUT=3 days
  2127. LOG_MASK=incoming, outgoing, errors
  2128.  
  2129. MX_FIRST=yes : means smtp attempts delivery to a hosts
  2130. specified Mail Exchanger record (MX DNS record) rather than the
  2131. delivering directly to the host IP address. If set to no,
  2132. then it attempts delivery directly to the host IP address and
  2133. then any MX hosts if specified.
  2134.  
  2135. USE_LOG_FILES=yes : whether to log to /var/spool/mailq/Logs. If no
  2136. value is given this defaults to yes.
  2137.  
  2138. USE_WRAPPERS=no : whether to check to access using the /etc/hosts.allow
  2139. file (as in the tcp wrappers package). I've not been able to convince
  2140. myself that this works at the moment.
  2141.  
  2142. USE_OSM=no : whether to direct log messages to syslog (osmlog). If
  2143. yes these can be viewed using the Message_monitor GUI tool, or syslogd
  2144. can direct them to log files.
  2145.  
  2146. TIMEOUT=3 days : the time from original delivery attempt before the
  2147. mail is returned to the sender as being undeliverable. If a value of
  2148. "-1" is given the attempts continue indefinitely. An example of
  2149. 7 days timeout can also be specified as "TIMEOUT=1 week".
  2150.  
  2151. LOG_MASK=incoming, outgoing, errors : what events to be logged.
  2152. Other classes to be logged are:  "queued" - log info on msgs
  2153. placed on queues; "debug" - log debug info; "connection" - log
  2154. info on connections; "recipients" - log info about recipients.
  2155. Its possible to switch all this off with the value "nothing"
  2156. or to switch all logging on with "everything".
  2157.  
  2158. Subject: M52) How should I setup Mail via PPP?
  2159.  
  2160. Let's assume firstly that you have a PPP link up and working
  2161. and that tcp/ip services between your host and your ISP have
  2162. been established.
  2163.  
  2164. Lets also assume that you can obtain the Email FAQ  from
  2165. http://www.freebird.org/faq/email.html
  2166. since that explains the email subsystem in greater depth than here.
  2167.  
  2168. There are various scenarios:
  2169.  
  2170.         (1) You have your own domain name, for example
  2171.         tamarix.demon.co.uk and your ISP initiates an smtp
  2172.         transfer to your host when you start a ppp session
  2173.         (this is how demon work in the UK)
  2174.  
  2175. You need to establish your DOMAIN name for email. This can be
  2176. done by using the Mail_setup GUI tool or by editing(or creating)
  2177. the file: /etc/mail/mailcnfg
  2178.  
  2179. The mailcnfg file I use at home is
  2180.  
  2181. DOMAIN=demon.co.uk
  2182. FORCE_7BIT_HEADERS=1
  2183. FORCE_7BIT_MIME=1
  2184. ADD_TO=1
  2185. ADD_MESSAGE_ID=1
  2186. SMARTERHOST=post.demon.co.uk
  2187.  
  2188. By setting DOMAIN=demon.co.uk outbound mail from my home machine tamarix
  2189. has the From: line set to tamarix.demon.co.uk.
  2190.  
  2191. Since you are at home you  want to try and do all mail processing
  2192. while offline - hence the use of a SMARTERHOST, whose IP address
  2193. should be added to your /etc/hosts file so as not to require
  2194. an MX lookup when sending mail (see smtpqer line later)
  2195.  
  2196. You also want to edit the file /usr/lib/mail/lookupLibs.proto
  2197. and comment out some lines in there so as to reduce DNS lookups.
  2198.  
  2199. /usr/lib/mail/libalias/home.so
  2200. /usr/lib/mail/libalias/file.so
  2201. /usr/lib/mail/libalias/passwd.so
  2202. <DNS>   #/usr/lib/mail/libalias/dns.so
  2203. <NIS>   #/usr/lib/mail/libalias/nis.so
  2204. <MHS>   #/usr/lib/mail/libalias/extract.so
  2205.  
  2206. This proto file ends up creating the file /etc/mail/lookupLibs ,
  2207. (after running the /usr/lib/mail/surrcmd/createSurr command - ran
  2208. out of /etc/rc2.d/S81smtp).
  2209.  
  2210. The /etc/mail/mailsurr file is the key file for determining how
  2211. mail gets delivered, I customize this file and then make it permanent -
  2212. after all once you've set it up why let createSurr keep rewriting it!
  2213.  
  2214. A fixed mailsurr file appropriate for PPP can be
  2215. obtained from:
  2216.         ftp.abs.net:/unixware/freebird/hints/Mail/mailsurr.ppp
  2217.  
  2218.         (2) You have a POP mailbox on the ISP server, and your
  2219.         mail account is username@your_isp_address.dom. You'll need
  2220.         to use a POP client or equivalent to get the mail onto
  2221.         your local machine. You'll then need to reply using mail on
  2222.         the local machine and want to ensure that the mail headers
  2223.         look like mail is being sent from the ISP machine.
  2224.  
  2225. In this case your mailbox is held on the ISP's machine and they
  2226. have a POP server.  You need a popclient to retrieve the mail from
  2227. the server onto your local machine. A version of the Mail Users Shell
  2228. (Mush) is available on ftp.abs.net:/unixware/freebird/mailtools/popclient
  2229. that can be used. There has also been a tool posted in this group
  2230. that will retrieve the mailbox from your ISP into the local machine,
  2231. in which case you can then use your favourite mail user agent to read it
  2232. (i don't have a copy off-hand).
  2233.  
  2234. POP allows you to retrieve mail but most servers don't allow you
  2235. to send mail. You can use smtp to send mail from your local machine
  2236. using the above configuration with one exception, you need to
  2237. rewrite the From: line for outbound mail to hide your nodename
  2238. (so in my case, mail would appear to come from demon.co.uk and
  2239. not tamarix.demon.co.uk).
  2240.  
  2241. This can be done by editing the file /etc/mail/rewrite
  2242. and adding the routine (this will need editing for your
  2243. configuration)
  2244.  
  2245. function check_headers()
  2246. {
  2247. var hdr;
  2248. # loop through ALL headers
  2249. for (hdr from headers_pattern("From:"))
  2250.    # if we match a header that has something like foo.xyz.com in it
  2251.    if (hdr ~ "[a-zA-Z]\\.demon\\.co\\.uk")
  2252.      # then substitute the shorter version in its place
  2253.      hdr=gsubstitute(hdr, "[a-zA-Z0-9.]+\\.demon\\.co\\.\\uk", "demon.co.uk");
  2254. }
  2255.  
  2256. Add a call to this in the function main() in /etc/mail/rewrite, so this
  2257. looks like:
  2258.  
  2259. function main()
  2260. {
  2261.     add_missing_headers();
  2262.     check_headers();
  2263. }
  2264.  
  2265.         (3) When sending mail you'll want to consider whether you
  2266.         want to relay mail via a SMARTERHOST (recommended), usually
  2267.         your ISP or whether you want to send the mail directly
  2268.         across the internet to the remote recipient
  2269.  
  2270. In the mailsurr example above, I've assumed that this is what you'd
  2271. want to do. And in most cases this makes sense, since that way
  2272. you can let your ISP handle the routing and delivery issues.
  2273. For those odd occasions when you want to get mail somewhere quickly
  2274. or directly i use an i: prefix to say internet directly which you
  2275. may or may not find particularly useful.
  2276.  
  2277.         (4) Perhaps you have two PPP links in different domains (like
  2278.         my home box), and can switch between them. You want to receive mail
  2279.         to both domain addresses - this requires some level of customization
  2280.  
  2281. I have some scripts (written by Mike Convey) to swap between my ISP
  2282. and my work PPP links.  At home my machine is known as tamarix, at work
  2283. its known as voyager (now if i'd kept the names the same i would
  2284. not need this!).
  2285.  
  2286. When I send email i keep the tamarix.demon.co.uk
  2287. domain in there, but occasionally i want to forward mail over the work
  2288. link to my machine. In this case I have to add a line to the mailsurr
  2289. file so that it recognises the mail as local, otherwise it sends
  2290. it off to the SMARTERHOST
  2291.  
  2292. The trick is to add another delivery line to translate the mail
  2293. for local delivery, and add your alternate nodename in there
  2294.  
  2295. '.+'    '([^@]+)@(voyager)%D'           'Translate R=\\1'
  2296.  
  2297. The %D is needed since the inbound smtp adds the Domain info.
  2298.  
  2299.         (5) Perhaps your ISP relays mail to you over uucp over TCP/IP,
  2300.         perhaps by a mail forward? What then?
  2301.  
  2302. For incoming mail this is not a problem, and you can still send
  2303. mail outwards using smtp.
  2304.  
  2305. I'm sure there are other configurations not covered here, hopefully
  2306. this will be useful to some folks!
  2307.  
  2308. Subject: M53) How can I setup mail to handle virtual hosts's mail?
  2309.  
  2310. How do I handle virtual hosts' mail with mailsurr ?
  2311.  
  2312. Example: have machine           mydomain.net
  2313. have virtual machines           virtual1.ca
  2314.                                 virtual2.ca
  2315.                                 virtual3.ca
  2316. I want to have server handle mail for
  2317.  
  2318. sales@mydomain.net
  2319. sales@virtual1.ca
  2320. sales@virtual2.ca
  2321. sales@virtual3.ca
  2322.  
  2323. One way to handle this is to add explicit rules on the mailsurr.proto
  2324. file as follows:
  2325.  
  2326. Add this in just before the area where it deals with supposedly local names.
  2327.  
  2328. # Map all names addressed to alias@domain.com to appropriate users.
  2329. '.+'    '(sales)@(mydomain.net)'                  'Translate T=1; R=ron'
  2330. '.+'    '(sales)@(virtual1.ca)'    'Translate T=1; R=andy'
  2331. '.+'    '(sales)@(virtual2.ca)'       'Translate T=1; R=linda'
  2332. '.+'    '(sales)@(virtual3.ca)'                    'Translate T=1; R=bob'
  2333.  
  2334. In the above, all the R=names are local users or aliases (if they
  2335. are not local you can alias them to the real addresses).
  2336.  
  2337. Subject: M54) I need to print all incoming mail as well as send it to
  2338.    local users.
  2339.  
  2340. # Add this before any address translations to mailsurr.proto
  2341. #    Send all incomming mail to printer and to user.
  2342. #    Do a C=* so mail is sent to the user also.
  2343. '.+'    '([^@]+)@(mydomain.com)'                '< C=*; lp      -dtest'
  2344.  
  2345. Subject: M55) Mail loops - its forwarded by my provider but then goes into a loop - any ideas?
  2346.  
  2347. This usually occurs when the /etc/mail/mailsurr file is not
  2348. pattern matching a delivery line, specifically a line to translate the
  2349. address to a local address for delivery.
  2350.  
  2351. Examine the log file  in /var/mail/:log , look at the To
  2352. address of the bounced message. If its of the form
  2353.  
  2354.         @site.com:user@foo.domain
  2355.  
  2356. See M48.
  2357. Else check that your DOMAIN is defined in /etc/mail/mailcnfg and that any customisations
  2358. to /etc/mail/mailsurr have been done.
  2359.  
  2360. Subject: M56) Mail delivery does not seem to be case insensitive - any ideas?
  2361.  
  2362. Problem: Any mail that is received with a capitol letter in the
  2363. recipient field is returned to the originator.  Meaning, if you compose
  2364. mail to AUser@mydom,net, it will not get to me. Instead an
  2365. ambiguous/invalid recipient error is generated.
  2366.  
  2367. The problem occurs since the mailalias call with the mailsurr sees the
  2368. address with a domain still attached.  Translation to lower case is
  2369. handled by the mailalias line within /etc/mail/mailsurr, in this case
  2370. the mailalias call leaves this alone as its not local, and a later line
  2371. attempts local delivery. The fix is to add another mailalias call
  2372. by duplicating the existing line.
  2373. ----------------------------------------------------------------------------
  2374.  
  2375. Acknowledgements:
  2376.  
  2377. Many thanks to the following for feedback and comments on various
  2378. drafts of this FAQ: Steve Wootton, Pete Holsberg, Michael Tiernan,
  2379. Bob Stewart, Dan Daggett.
  2380.  
  2381. --
  2382. Andrew Josey,  Disclaimer: Any views expressed are not those of
  2383. my employer, either past, present or future.
  2384.  
  2385.