mark bixby hp csy r&d lab april 4, 2002 getting started with sendmail on mpe/ix 7.
Major functionality: •send SMTP e-mail •receive SMTP e-mail to local mailboxes, programs, or files product overview •aliases can be created which map to local mailboxes, programs, files, or remote mailboxes •powerfully flexible configuration language Built from: •Sendmail 8.12.1 •Sleepycat Berkeley DB library 3.3.
•will be released as a 7.0 patch •will ship in 7.
•Sendmail A.01.00 for MPE/iX will be fully supported by RC and WTEC support April 4, 2002 •Customers who call with questions regarding unsupported bixby.org freeware Sendmail 8.9.1 will be encouraged to upgrade to Sendmail A.01.
•Apache-like VUUFF -- CURRENT -PUB file layout •/SENDMAIL/PUB/JDAEMON – batch job for running the server daemon distribution highlights •/SENDMAIL/PUB/SENDMAIL – symlink to /SENDMAIL/CURRENT/SENDMAIL •/SENDMAIL/CURRENT/SENDMA IL – combined server daemon and local mail submission program •/SENDMAIL/CURRENT/bin – dnscheck, hoststat, m4, mailq, newaliases, purgestat, vacation •/SENDMAIL/CURRENT/sbin – editmap, mailstats, makemap, praliases, sendmail, smrsh April 4, 2002 Solution Symposium Page 5
•/SENDMAIL/CURRENT/cf – directory tree for building *.cf config files; see the README file! •/SENDMAIL/CURRENT/doc/op/ op.ps – Sendmail Installation and Operation Guide – READ IT! distribution highlights (cont.) •/SENDMAIL/CURRENT/etc – contains the POSIX shell profile for Sendmail along with the sample config files installed to /etc/mail •/SENDMAIL/CURRENT/man – man page documentation, I.e.
/usr/bin/m4 /usr/bin/mailq /usr/bin/mailstats /usr/bin/newaliases /usr/bin/praliases /usr/bin/vacation hpux compatibility symbolic links /usr/lib/sendmail /usr/sbin/editmap /usr/sbin/hoststat /usr/sbin/mailstats /usr/sbin/makemap /usr/sbin/newaliases /usr/sbin/purgestat /usr/sbin/sendmail /usr/sbin/smrsh April 4, 2002 Solution Symposium Page 7
•all config files live in /etc/mail which is populated from /SENDMAIL/CURRENT/etc/mail.sa mple at installation time if the /etc/mail files do not already exist config files •all config files must be owned by the user SERVER.SENDMAIL and the POSIX group SENDMAIL •the server daemon must be stopped and restarted for config file changes to take effect •sendmail.cf (mail server), submit.
• submit.cf and sendmail.cf are created from macro files expanded by the m4 utility • you can edit submit.cf and sendmail.cf directly to make MINOR parameter changes: # "Smart" relay host DSmy.relay.host.name configuring *.cf files • major functionality changes REQUIRE you to edit the macro files and expand with m4 • so just play it safe and ALWAYS edit the macro files and expand with m4 for ALL changes: define(`SMART_HOST', `my.relay.host.
To generate sendmail.cf: 1. :HELLO SERVER.SENDMAIL 2. :XEQ SH.HPBIN.SYS –L 3. shell/iX> cd /SENDMAIL/CURRENT/cf/cf configuring *.cf files (sendmail.cf for the mail server program) 4. shell/iX> cp genericmpeix.mc.sample genericmpeix.mc 5. edit generic-mpeix.mc with the bytestream file editor (i.e. vi) of your choice to make your changes 6. shell/iX> m4 ../m4/cf.m4 generic-mpeix.mc >genericmpeix.cf 7. shell/iX> cp generic-mpeix.cf /etc/mail/sendmail.
OSTYPE(mpeix)dnl DOMAIN(generic)dnl define(`confFORWARD_PATH', `$z/.forward')dnl configuring *.cf files (genericmpeix.mc.
•typically used by optional sendmail features like access_db •Berkeley DB database hash or btree files containing extra configuration data in key/value pairs configuring database map files •maintained with the makemap and editmap utilities •by convention, a map file named “foo” contains the ASCII input data, whereas “foo.db” contains the compiled binary database structures •in commands and *.cf files, a map file reference of “foo” actually refers to “foo.
MPETEST:/BIXBY/PUB> cat - >foo key1 value1 two abcdef abra cadabra :eod MPETEST:/BIXBY/PUB> makemap hash foo ls -l foo* -rw-r--r-BIXBY foo 1 MGR.BIXBY 36 Feb 25 13:52 -rw-r--r-1 MGR.BIXBY BIXBY 49152 Feb 25 13:52 foo.
•defining a smart relay host in sendmail.cf to route all outbound email via a single mail gateway common non-default config changes •define alternate routing for certain outbound mail domains via the mailertable feature •creating aliases for inbound e-mail instead of using the basic USER.ACCT@host.
•a special type of map file containing one or more commadelimited values per key •/etc/mail/aliases and aliases.db aliases database map •maintained by SERVER.SENDMAIL with the newaliases and praliases commands •defines username aliases for mail being delivered to the local machine, I.e. postmaster@local.host.name •installation default entries: postmaster: SERVER.
•left-hand side is the user alias •separated by a colon •right-hand side is one or more delivery destinations: aliases database map (cont.) – USER.ACCOUNT or user@host.name or another alias – /path/to/local/file for appending – :include: /file/of/aliases (plaintext ASCII file) – “|/program/file parm1 parm2 parm3 …” • local usernames may be escaped with a backslash (I.e. \USER.
•an optional ASCII file named .forward residing in the local user’s home group which tells sendmail where to forward the user’s mail .forward files •format is the same as the righthand side of an aliases entry, I.e. one or more comma-separated destinations •can be used to invoke the vacation autoresponder: \USER.ACCOUNT, "|/SENDMAIL/CURRENT/bin/vacation USER.
access_db feature – accept or reject incoming e-mail based on envelope address or relaying mail server name April 4, 2002 1. :HELLO SERVER.SENDMAIL 2. :XEQ SH.HPBIN.SYS –L 3. /bin/cat - >/etc/mail/access imaspammer.com REJECT :EOD 4.
1. :HELLO SERVER.SENDMAIL 2. :XEQ SH.HPBIN.SYS –L domaintable feature – rewrite domain names in e-mail headers 3. /bin/cat >/etc/mail/domaintable oldcompany.com newcompany.com :EOD 4.
1. :HELLO SERVER.SENDMAIL 2. :XEQ SH.HPBIN.SYS –L genericstable feature – rewrite user and/or domain addresses in outgoing e-mail headers April 4, 2002 3. /bin/cat >/etc/mail/genericstable USER.ACCOUNT@my.local.host customer_servce@company.com :EOD 4. makemap hash /etc/mail/genericstable
1. :HELLO SERVER.SENDMAIL mailertable feature – override default mail routing in sendmail.cf April 4, 2002 2. :XEQ SH.HPBIN.SYS –L 3. /bin/cat >/etc/mail/mailertable .bitnet smtp:relay.bit.net :EOD 4.
1. :HELLO SERVER.SENDMAIL 2. :XEQ SH.HPBIN.SYS –L virtusertable feature – remap incoming user and hostnames to local users 3. /bin/cat >/etc/mail/virtusertable info@bar.com INFO.BAR info@foo.com INFO.FOO :EOD 4. makemap hash /etc/mail/virtusertable
starting the mail daemon •Make sure a syslog daemon is running before you start the mail daemon! •To start the MPE FOS syslog daemon, :STREAM JSYSLOGD.PUB.SYSLOG •To start the mail daemon, :STREAM JDAEMON.PUB.
stopping the mail daemon •Use the POSIX kill signal from SERVER.SENDMAIL or any user with SM capability: kill $(head -n 1 /etc/mail/sendmail.
•interactively: mailx someuser@some.host Subject: hello world Hi, How are you doing? :EOD EOT sending e-mail with mailx •from a pipe: echo "How are you doing?" | mailx -s "hello world" someuser@some.host •from a disk file: mailx -s "hello world" someuser@some.
1. /bin/cat - >message.txt To: someuser@some.host Cc: otheruser@other.host Bcc: secretuser@another.host Subject: hello world Hi there! :EOD sending e-mail with SENDMAIL 2. /SENDMAIL/CURRENT/SENDMAIL -t
1. /bin/cat - >message.txt From: forger@foobar.com To: someuser@some.host Cc: otheruser@other.host Bcc: secretuser@another.host Subject: hello world Hi there! :EOD sending e-mail with forged headers 2. /SENDMAIL/CURRENT/SENDMAIL -t –f forger@foobar.com
•invoke /bin/mailx with no parameters, and it will read e-mail from /usr/mail/USER.
•incoming e-mail will be delivered to programs specified in the aliases database or .
•must create new JDAEMON from /SENDMAIL/CURRENT/JDAEMON .sample •all config files reside in /etc/mail instead of /SENDMAIL/PUB/etc migrating from freeware 8.9.1 •8.9.1 sendmail.cf is NOT compatible with 8.12.1 •copy all 8.9.1 ASCII map files to /etc/mail and rebuild with makemap and newaliases •8.9.1 queued messages won’t be seen by 8.12.1 •8.12.1 uses two queues (/var/spool/clientmqueue and mqueue) instead of 8.9.
•8.9.1 would submit new messages directly to the queue disk files, but 8.12.1 speaks SMTP to localhost port 25 migrating from freeware 8.9.1 (cont.) •8.12.1 uses two main config files, /etc/mail/submit.cf for submitting new messages, and sendmail.cf for general mail routing •8.12.1 does not include the Majordomo mailing list software that was bundled with 8.9.1.
•Sendmail programs don’t read stdin terminal keyboard input correctly. Workarounds: – /bin/cat - | makemap hash mymap – makemap hash mymap
• the #1 sendmail problem! • before using sendmail, run the dnscheck script: 1. :HELLO SERVER.SENDMAIL dns issues 2. :XEQ SH.HPBIN.SYS –L 3.
• single-token hostname? I.e. uname –n returns “jazz”? • domain name in /SYS/NET/RESLVCNF? I.e. “domain external.hp.com”? • one or more nameserver entries in RESLVCNF? dns issues (cont.
•the #2 sendmail problem! •your 3000 needs to query port 53 on DNS servers to resolve the destination mail server hostname •your 3000 needs to receive DNS query answers firewall issues •your 3000 listens on its port 25 for incoming e-mail •your 3000 needs to connect to port 25 on destination mail servers •does your firewall allow your 3000 to talk to the Internet? •does your firewall allow the Internet to talk to your 3000? •firewall blocking results in connection refused, timeouts, or just no activity!
•check syslog first! •if nothing in syslog: troubleshooting – if your third-party spooling package has an embedded syslog daemon, you will probably need to use that one instead of Syslog/iX – is the syslog daemon running? – does the syslog daemon have read access to the config file and write access to the log file? – is syslog configured to log mail events? •if syslog or e-mail message headers show strange timestamps, verify TZ is set properly, preferably in your system logon UDC April 4, 2002 Solution
•if syslog shows DNS lookup failures: – run the dnscheck script to verify DNS is configured properly – verify that your firewall allows your 3000 to talk to DNS servers on port 53 troubleshooting (cont.) •if syslog shows connection failures to remote mail servers, verify that your firewall allows your 3000 to connect to port 25; if it does not, you may need to configure sendmail.
•if local users are submitting messages that aren’t being delivered: troubleshooting (cont.) April 4, 2002 – verify that JDAEMON is running; if it is not, messages will be queued in /var/spool/clientmqueue – transient network problems may cause a backlog in the mail daemon queue /var/spool/mqueue; run /SENDMAIL/CURRENT/bin/mailq as SERVER.
•if remote users are sending messages that aren’t being delivered to the local 3000: troubleshooting (cont.) April 4, 2002 – check syslog for remote connection attempts; if there are none, does your firewall allow connections to port 25 on your 3000, and are your 3000’s DNS entries visible to the remote users? – verify that the remote users are using valid e-mail addresses for your 3000, I.e. USER.
•if a sendmail config change doesn’t appear to take effect: troubleshooting (cont.) April 4, 2002 – stop and restart the mail daemon when making *.cf changes – if you changed an ASCII database map file, don’t forget to run makemap or editmap to compile the binary *.db file – if you changed ASCII /etc/mail/aliases, don’t forget to run newaliases to compile the binary /etc/mail/aliases.
•7.5 Communicator •7.5 Configuring & Managing MPE/iX Internet Services for further information •http://jazz.external.hp.com/src/s endmail/ •http://www.sendmail.org/ •http://www.sleepycat.
join the hp3000-L community! • Available as a mailing list and as the Usenet newsgroup comp.sys.hp.mpe • In-depth discussions of all things HP e3000 • Talk with other people using Sendmail on MPE • seek advice, exchange tips & techniques • Keep up with the latest HP e3000 news • Interact with CSY • http://jazz.external.hp.com/papers/hp3000-info.