Frequently Asked Questions about EXMH 1. Is it possible to get the cursor keys working in the editor? 1b. Can I paste with the middle mouse button? 2. How do I display ISO-8859 fonts so that my special characters show up? 2b. How do I insert special 8-bit characters (latin-1) 2c. How do I change FONTS? 2d. How do I get rid of encoded headers in the scan listing? 3. I can't get background incorporate to work. What am I doing wrong? 4a. How do I get Tk send to work? 4b. How do I start my X server so it does Xauthority right? 5. Where do I find Faces and Metamail packages? 6. How do you get an X-Face: line into your outgoing mail messages? 6b. How do you display an X-Face: header line? 6c. How do you create an X-Face: header line? 7. Can I use EXMH as a news reader? 8. How do I change those default wheat-colors for the widgets in EXMH? 9a. How do I get POP to work with exmh? 9b. What's the difference between presort and multidrop inc-styles? 9c. How do I set up my .maildelivery file to filter mail? 10. How do I fix the "exmh-bg lost UI {process XXXX}" message? 10b. What does "exmh-bg cannot rendez-vous with UI - exiting" mean? 11. How come messages are not really removed when I delete them? 12. Why doesn't the flag go up when there is new mail in the spool file? 13. Why isn't there a Reply button, but only a reply menu? 14. Are there newsgroups or mailing lists for discussion of exmh? 15. How do I set up the templates for mail messages? 16. How do I get a copy of mail I sent saved into a folder (easily)? 17. What is a good alternate Print command to get good formatting? 18. How do I change the folder table of contents listing? 18a. Remove the leading words of the message 18b. Handle message numbers > 9999 18c. Add annotations to messages that have been replied to. 18d. Colorize message headers. ------------------------------------------------------------------------- 1. Is it possible to get the cursor keys working in the editor? Use the Bind dialog to set additional keystroke bindings for various editing functions. For cursor keys, you first need to figure out what their X Keysyms are. I use the "xev" program for this. Assuming the keysyms are Up, Down, Left, and Right, then you'd add to the up1line function, etc. The Bind dialog lets you have multiple sequences for a function - just space separate them. You may have to drag the entry widget with the middle mouse button to make room to add stuff to the end. 1b. Can I paste with the middle mouse button? This is now the default after versions 1.5.1 Answer for older versions: Select Simple Edit from the Bindings menu and do two things. First, use the "Scroll Button" setting to change the drag scrolling binding from Middle to one of the other choices: ShiftMiddle, Right, or None. This binding lets you "drag" a text window around without having to hit the scrollbar. Second, change the selpaste binding to so you can paste with middle click. 2. How do I display ISO-8859 fonts so that my special characters show up? Put an Xresource specification into your ~/.exmh-defaults file: *Text*font: -*-courier-*-*-*-*-*-*-*-*-*-*-iso8859-* *Ftoc*Text*font: -*-courier-*-*-*-*-10-*-*-*-*-*-iso8859-* 2b. How do I insert special (8-bit) characters? There are many Compose key sequences that are defined to let you do this. Your X environment may also specially map some keys. For a list of the Compose key sequences, select the Compose Key menu entry under Bindings. Press the Compose key and then the two characters in the left list in order to get the special character on the right hand side. You can redefine what the Compose key is mapped to in the Simple Edit Bindings... dialog. 2c. How do I change FONTS? Use the Preferences Fonts interface to pick fonts. First you browse fonts in the interface, then you assign a chosen font to a particular resource, which in turn affects the widgets. Note also there are more font settings under MIME Preferences, and for really advanced cases of setting fonts for obscure character sets, you need to browse the app-defaults file to see how fonts are selected for MIME messages that specify a character set. 2d. How do I get rid of encoded headers in the scan listing? RFC 1522 specifies that 8-bit characters in mail headers are encoded. The scan listing may show something like this: From: "Christian =?iso-8859-1?Q?J=F6nsson?= FOA 72" This comes from the MH scan command, and there is a patch to this program that is distributed with exmh. It teaches scan about the RFC 1522 encoding. For the patch to work, make sure you are compiling with -funsigned-char if you use gcc. 3. I can't get background incorporate to work. What am I doing wrong? The most likely cause is that the TK send facility does not work for you because of Xauthority issues. See FAQ 4a & 4b. If you cannot get send working, you have two options. First, disable the background process so that all periodic activity is done in the front-end. Do this via the preferences entry for Background Processing. Another cause that might disable inc completely is lack of the MAILDROP environment variable. This should be set to the name of the spool file that contains incoming mail (unless you are using POP). The latest Exmh will warn you about this and try to choose a default value, but to be safe you should set this up properly. 4a. How do I get Tk send to work? Tk "send" lets two TCL interpreters issue commands to each other, and it uses the X server for communication. Beginning with TK 3.3, this also honors the Xauthority protocol, unless you compile TK with -DTK_NO_SECURITY. You can test this by running "wish" and trying out the following command: send exmh {Exmh_Status "Hello, world!"} If this fails you need to recompile or learn how to start your X server so that it does Xauthority right. Note that even if you set up Xauthority right, you need to make sure the old-fashioned xhost list is empty. Do this: xhost - 4b. How do I start my X server so it does Xauthority right? The general picture of whats going on is this: 1) some program generates a magic cookie (arbitrary string) and writes this to a file. 2) The name of this file (often ~/.Xauthority) is passed to the X server 3) The X server writes an entry for the DISPLAY into your ~/.Xauthority file. 4) Xlib reads ~/.Xauthority when you create a window, and passes the cookie value back to the X server. The specific details vary from server to server. Keven Kenny offers this Web page with details about Ultrix, X servers, X session managers, etc: http://ce-toolkit.crd.ge.com/tkxauth/ For SunOS and openwin, you should just be able to start up with: openwin -auth magic-cookie Another person had luck with: BTW, the Xauthority stuff seems to work now. All I did was declare and export XAUTHORITY from my .profile. I had't done it before since the value ($HOME/.Xauthority) is supposed to be the default. We're using XDM. In more detail, here is what happens under the covers... if [ ! \( -d $HOME -a -w $HOME \) ]; then echo "Warning: Can't write X authority file" 1>&2 ; auth_args="" else authfname=$HOME/.xnews.`uname -n`$DISPLAY ${OPENWINHOME}/lib/mkcookie $authfname -auth magic-cookie auth_args="-auth $authfname" fi ; ${OPENWINHOME}/bin/xnews $auth_args $server_args $xnews_config_args ;; There is a more lengthy example given in the misc/Xauthority file that comes with the exmh distribution. 5. Where do I find Faces and Metamail packages? There are pointers to these packages at the end of the man page. 6. How do you get an X-Face: line into your outgoing mail messages? The compface program that is part of the faces package will generate the X-Face hex string for you. Check its man page for details. If you have a 48x48 X bitmap image in X bitmap .xbm format, then you can convert that into an ikon format using some programs from the pbmplus package. The pipeline looks like xbmsize48 | xbm2ikon | compface If you put an X-Face header in your replcomps file (see FAQ #15) then you need to double any % and \ in the X-Face string. For example, abc%def\efg needs to be written as abc%%def\\xyz in the X-Face header of your replcomps files. 6b. How do you display an X-Face: header line? Under the Faces preferences, set the X-Face pipeline to be similar to: uncompface | ikon2xbm (You might need absolute pathnames if these programs are not otherwise on your PATH). uncompface comes with the faces package. ikon2xbm comes with exmh as misc/ikon2xbm.c Just compile it with cc -o ikon2xbm ikon2xbm.c Note, this is slower than I'd like, plus the results are not saved anywhere. The intended use of the X-Face header was that the mail agent would update the facesaver database in the background using it. 6c. How do you create an X-Face: header line? The pbmplus package of image manipulation programs can do it. Martin Wunderli uses the following script (giftopnm instead of xpmtoppm should work for you): #!/bin/sh xpmtoppm $1 | pnmscale -xysize 48 48 | ppmtopgm | pgmtopbm | pbmtoxbm | \ xbm2ikon | compface 7. Can I use EXMH as a news reader? Well, it actually works ok, but there are various things that would make it better at reading news. To get started, just make a symbolic link from your ~/Mail directory into the news spool file system. This requires access (e.g., NFS) to the news spool file system, of course. You can do it for a single newsgroup, i.e. clari.feature.dilbert. My symlink looks like: Mail/dilbert -> /net/news/news-1/news/spool/clari/feature/dilbert Or, you can link into the interior of the news hierarchy. You might run into a problem from the MH folders command that limits it to about 300 folders. Change the NFOLDERS constant in MH src/h/mh.h from 300 to 30,000 and you shouldn't have any more trouble ;-) 8. How do I change those default wheat-colors for the widgets in EXMH? (See also exmh.COLORS for more color schemes...) Here is a set of Xresources that I use to get a grey-family for my TK-based applications. You can put this into your ~/.exmh-defaults, or into your ~/.Xdefaults. This works ok on a monochrome screen, although buttons do not highlight when you pass the mouse over them. *activeBackground: #efefef *activeForeground: black *selector: black *background: #dfdfdf *foreground: black *selectBackground: #bfdfff *Scale.activeForeground: #efefef *Scale.sliderForeground: #dfdfdf *Scrollbar.foreground: #dfdfdf *Scrollbar.activeForeground: #efefef *Button.disabledForeground: #7f7f7f *Checkbutton.disabledForeground: #7f7f7f *Radiobutton.disabledForeground: #7f7f7f *Menu.disabledForeground: #7f7f7f 9a. How do I get POP to work with exmh? First, make sure that MH has been set up for POP. Type "inc -help" and look for the POP option. If MH doesn't use POP directly, there are several packages that can fetch mail from a POP server: popclient : but Archie will find many places. gwpop : or , thanks to Mark Lamourine popc : popmail : Second, you need to use "multidrop" or "presortmulti" Inc styles. For these you set up a .xmhcheck file that specifies all your "dropboxes" for mail. These can be spool files or POP servers, or both. Each line of your .xmhcheck file has two or three fields: folder dropname popname "folder" is the name of a folder, without the +. (e.g., inbox) If "dropname" begins with a /, then it is assumed to be a filename for your spool file (e.g., /usr/spool/mail/welch), and the last field is ignored. Otherwise, "dropname" is assumed to be the hostname of the POP server, and "popname" is your user account name on that server. You need to set up a .netrc file with the password for that account so that inc can run non-interactively. With "multidrop" inc style exmh will copy mail from the dropboxes into the corresponding folder. With "presortmulti" inc style, exmh will additionally sort anything that has been directed into the MyIncTmp folder. This is a special temporary folder used by the "presort" inc style. To do sorting, you need to set up a .maildelivery file. See FAQ 9c. 9b. What's the difference between presort and multidrop inc-styles? The main difference between presort and multidrop is: with presort, you don't need a ~/.forward that pipes your messages to slocal because exmh will run slocal for you. The second difference is that the presort scheme assumes that messages are completely routed into folders, either with the + syntax (slocal patch required) or by piping messages through rcvstore in the .maildelivery specification. The multidrop scheme assumes you append messages to dropbox files with the '>' or 'file' command in your .maildelivery file. Thus your options are: 1. use slocal in your .forward, pipe your messages to rcvstore in .maildelivery, and have exmh do background flist updates. 2. use slocal in your .forward, append messages to files in .maildelivery, specify files to folders mapping in .xmhcheck, and have exmh do background multidrop. 3. empty .forward, pipe your messages to rcvstore in your .maildelivery, and have exmh do background presort. 4. Note that the following DOES NOT WORK empty .forward, append messages to files in .maildelivery, specify file to folder mapping in .xmhcheck, and have exmh do background presort. WON'T WORK 9c. How do I set up my .maildelivery file to filter mail? You need to choose "presort" or "presortmulti" inc styles, and then set up a .maildelivery file. Alternatively, you can use "none" inc style and pipe things into slocal (or procmail) in your .forward file as discussed in FAQ 9b. Your .maildelivery file cannot be group or world writable, otherwise slocal just ignores it. chmod 644 ~/.maildelivery Here is a fragment of a .maildelivery file as an example: to b29@ + ? sunlabs cc b29@ + ? sunlabs to mtv29@ + ? sunlabs cc mtv29@ + ? sunlabs subject "Re: Register exmh user" + ? exmh/responses subject "register exmh" + ? exmh/register to exmh-users + ? exmh/users to exmh-announce + ? exmh/announce to exmh-workers + ? exmh/workers subject book + ? book from prenhall.com + ? book default - + ? inbox The first column is a field name. It can be anything, such as x-mailer or x-phase-of-moon The second field is a case-insensitive substring that has to appear in the field value to match. The third field is an operator. The "+" is a new operator added to slocal by a patch that is distributed with exmh. Look for misc/slocal.patch. The + operator says "refile into a folder". There is another way to specify this given below. The fourth field is a sort of conditional. "?" says "do this if the message hasn't already matched, and mark the message as matching after you do this." "A" says "do this even if the message has matchs, and mark the message as matching" "R" says "do this even if the message has matched, and don't even mark it as matching" The last field is a arguments to the operator. If the case of "+", it is just a folder name. If you have not patched slocal, then you need to use the pipe operator and pipe the message into the MH rcvstore program. Unfortunately this is in the MH library directory that is never on the slocal PATH. You need to have lines like this: to b29@ | ? "/some/where/lib/rcvstore +sunlabs" default - | ? "/some/where/lib/rcvstore +inbox" 10. How do I fix the "exmh-bg lost UI {process XXXX}" message? First - see FAQ # 4 about Tk send and Xauthority. is most like a problem with the Tk send command. Second - if Tk send works for you, then perhaps it is a problem with the ps command setting for exmh(psCmd). This is set up when exmh is installed and is used to query the existence of other processes. On Berkeley-style systems you can just do /bin/ps $pid While on SysV-style systems you need the -p flag /bin/ps -p $pid 10b. What does "exmh-bg cannot rendez-vous with UI - exiting" mean? This is a related problem. Tk send is not working so the background process cannot hook up with the user interface. See FAQ #4 11. How come messages are not really removed when I delete them? By default, MH only renames a message when you delete it. It is either named ,N or #N, depending on how your system is configured. You can take a few different approaches to cleaning up these files. 1) Set up a cron job to periodically remove them. 2) Remove them by hand, or add a Purge menu entry to do it. 3) In your ~/.mh_profile, add a line like: rmmproc: /bin/rm This causes the MH rmm command to invoke /bin/rm to nuke the message 12. Why doesn't the flag go up when there is new mail in the spool file? The appearance of the exmh icon relates to the contents of your mail folders, not your spool file. This reflects a bias towards background inc'ing, which periodically transfers (and maybe sorts) mail into your folders. Check out flag.tcl for the details. 13. Why isn't there a Reply button, but only a menu? There are really lots of variations on reply, that's why. You should pick your favorite one and define a personal button for it so that *you* get what *you* want. You can define a repl button by putting these resources into your ~/.exmh-defaults file *Mops.ubuttonlist: myrepl *Mops.myrepl.text: Repl *Mops.myrepl.command: Msg_Reply {any valid repl arguments here} See the MH man page on repl for more details. Common flags include -cc me -nocc me -cc all -nocc all -filter form 14. Are there newsgroups or mailing lists for discussion of exmh? There are three mailing lists, and an archive. First, and **this is important**, send subscription requests to the corresponding -request address, not the main lists. Please. Now you can use the menu operations under Help to do this automatically. Second, subscribe to only one of the lists. They are connected, so you will get duplicate mail if you join more than one. exmh-announce@sunlabs.sun.com - subscribe to this to receive announcements about new exmh releases. To join, send a message to: exmh-announce-request@sunlabs.sun.com The body should have this format, exactly: subscribe exmh-announce you@your.host exmh-users@sunlabs.sun.com - subscribe to this to join a discussion of exmh. This list also gets announcement messages. To join, send a message to: exmh-users-request@sunlabs.sun.com The body should have this format, exactly: subscribe exmh-users you@your.host exmh-workers@sunlabs.sun.com - subscribe to this to join a discussion among hackers that are interested in programming new stuff for exmh. This gets all the exmh-user and exmh-announce traffic. To join, send a message to: exmh-workers-request@sunlabs.sun.com The body should have this format, exactly: subscribe exmh-workers you@your.host The comp.mail.mh newsgroup has more information about basic MH stuff. 15. How do I set up the templates for mail messages. MH uses 4 template files depending on the operation. Default versions of the files are in the MH library directory. Copy these defaults into your ~/Mail directory so you can customize them. The files are: components - used when you send a new message. Put the headers and any text you want in your message. Remember to leave either a blank line between the headers and the body, or a line of all dashes. replcomps - used when you reply to a message. This file is complex because it contains directives that indicate how to fill in the headers based on the content of the mail you are replying to. See the repl man page for details. If you want to put literal values in the headers, you have to double any occurences of % or \ because these are special characters in the formatting commands. If you want plain text in the body, you have to begin these lines with a colon. Otherwise the lines after the header are discarded. The same rules about separating the headers and the body apply. If you want to add comments to the template, start the line with a semi-colon. reply filters - the -filter argument to repl specifies a filter that inserts and formats the body of the message to which you are replying. See the repl man page for details. forwcomps -- used when forwarding a message. This is more like the components file than the replcomps file. forward filters -- these control what headers are retained in the forwarded messages, and how those messages are forwarded. ---------cut here for sample components file----------- To: Subject: Fcc: outbox Cc: X-Face: "HxE|?EnC9fVMV8f70H83&{fgLE.|FZ^$>@Q(yb#N,Eh~N]e&]=>r5~UnRml1:4EglY{9B+ :'wJq$@c_C!l8@<$t,{YUr4K,QJGHSvS~U]H`<+L*x?eGzSk>XH\W:AK\j?@?c1o%>)\ %<(nonnull)%(void(width))%(putaddr To: )\n%>\ %(lit)%(formataddr{to})%(formataddr{cc})%(formataddr(me))\ %<(nonnull)%(void(width))%(putaddr cc: )\n%>\ %<{subject}Subject: Re: %{subject}\n%>\ %<{date}In-reply-to: %<(mbox{from})%(mbox{from})%|%(friendly{from})%>\ 's message of \ %<(nodate{date})%{date}%|%(tws{date})%>.%<{message-id} %{message-id}%>\n%>\ X-Face: "HxE|?EnC9fVMV8f70H83&{fgLE.|FZ^$>@Q(yb#N,Eh~N]e&]=>r5~UnRml1:4EglY{9B+ :'wJq$@c_C!l8@<$t,{YUr4K,QJGHSvS~U]H`<+L*x?eGzSk>XH\\W:AK\\j?@?c1o>>%(friendly{text}) said:" body:component="> ",offset=1,overflowoffset=4 : :--------------------------------- : Brent Welch Xerox PARC ----------end of sample reply filter------------------- ----------cut here for sample forwcomps file----------- To: Cc: Subject: Fcc: outbox ----------end of forwcomps file------------------------ ----------cut here for sample forward filter----------- width=80,overflowtext=,overflowoffset=10 leftadjust,compress,compwidth=9 Date:formatfield="%<(nodate{text})%{text}%|%(tws{text})%>" From: To: cc: Subject: : body:nocomponent,overflowoffset=0,noleftadjust,nocompress ----------end of sample forward filter----------------- 16. How do I get a copy of mail I sent saved into a folder (easily). Use the Fcc: header, which puts a copy of your out-going mail into a folder. 1) add the Fcc: header to the various component files described in FAQ #15. 2) For replies only, you can also add a "-fcc sent-mail" argument to your MH profile entries for repl. 17. What is a good alternate Print command to get good formatting? I use the mp package to print mail (and other files as well). Mailp (one of the commands in mp) prints mail nicely. My print command is: mailp -landscape -twosided -bsdprinter $file But without metamail piped to mp, in certain circumstances like mail coming from MacIntosh (is0-8859, quote-printable) the accents do not come right. That is why we use: metamail $file | mp -l | lp You can get mp at ftp.x.org in contrib/utilities. 18. How do I change the folder table of contents listing? This is a feature of the scan and inc MH programs. They take a macro file that describes how to generate this display. The default is buried in your MH lib directory as scan.form, or scan.default Here is what I have for the default: %; NOTE: This file is supplied for reference only; it shows the default %; format string (for non-UK sites) which was compiled into "scan". %; See the source file "h/scansbr.h" for details. %4(msg)%<(cur)+%| %>%<{replied}-%?{encrypted}E%| %>\ %02(mon{date})/%02(mday{date})%<{date} %|*%>\ %<(mymbox{from})%<{to}To:%14(friendly{to})%>%>%<(zero)%17(friendly{from})%> \ %{subject}%<{body}<<%{body}>>%> Copy this into ~/Mail/scan.form Add scan: -form scan.form inc: -form scan.form to your .mh_profile NOTE: Exmh depends on the output of the scan form to have the message number come first, followed by a character that can be either a space or a plus '+' to mark the current message So - leave this magic at the front (you can change the 4 as noted below) %4(msg)%<(cur)+%| %> Now edit the form as described below. 18a. Remove the leading words of the message Remove the trailing "%<{body}<<%{body}>>%>" from the scan.form 18b. Handle message numbers > 9999 Change the leading "%4(msg)" to "%5(msg)" (or %6 to allow > 99999 18c. Add annotations to messages that have been replied to. MH provides an annotation facility that will cause new message headers to be added to a message when you reply to or forward the message. In addition, the default scan.form adds a dash (-) to the scan listing for annotated messages so you can see their status in the folder table of contents. To get annotations you must add to your .mh_profile. repl: -annotate If you have other profile options for repl, just add -annotate. Note: it won't work to abbreviate it as -anno. 18d. Colorize message headers. Did you know you can colorize rfc822 headers in the message display by setting *m_tagnames and related X resources? This feature has been around for some time, but seems to be little-known. Here's what I have in my ~/.exmh-defaults-color file. *m_tagnames: hidden subject from x-filters-matched content-type x-mailer repl ied replied-to m_tagnames lists headers that have display resources associated with them. There are two special ones, "hidden" applies to the headers that are scrolled off the top of the display. "general" applies to the ones that are visible by default. The rest are just literal names of headers. The display resources are anything that is valid for the Tk text widget tag facility. The most useful ones are font and foreground, but you can check out the Tk text widget man page for all the possibilities. Here is what I use: *m_hidden: -font 6x10 *m_subject: -foreground blue *m_x-filters-matched: -foreground "medium sea green" *m_content-type: -foreground "medium sea green" *m_x-mailer: -foreground "medium sea green" *m_from: -foreground blue *m_replied: -foreground "violet red"