Explanation of mysend

[previous] [next] [table of contents] [index]

The Section Add Text to Drafts: mysend gives an overview of this script. Here is the mysend script (you might want to open it in a separate browser window). To install it, see the Section Programs in This Book's Archive.

The dosig variable determines whether the script adds a signature or not; the default setting is at the top of the script.

The case statement tests a string that combines the setting of the mhdist environment variable (shown in the Table Environment Variables that MH Sets) with the setting of the dosig shell variable. If mhdist is 1, then the script was called from the dist command (via whatnow). You shouldn't add text to the body of a redistributed message. So the case branches straight to the send command. Otherwise, if the draft file is writable and your $signature file is readable, the script appends a row of dashes and your signature file to the draft message.

Finally, the script runs the MH send command. The arguments, $args, passes all arguments you typed at What now? except -nosig or -sig. Note that any send: arguments from the MH profile are not passed to sendproc scripts like mysend. If you want to set mysend: defaults in your MH profile, use mhparam or mhprofile.

One last note: as the whatnow manual page mentions, if you rename this script to something besides mysend, don't call it send because whatnow won't use it.

mydist

The NOTE in the Section Add Text to Drafts: mysend explains a problem with mysend that keeps the script from working with the MH dist command. The mydist script works around that problem. It disables the mysend script while you dist a message. mydist makes a temporary copy of your MH profile without the sendproc: entry that runs mysend. Then it runs the real dist. To see the script, click here (you might want to open it in a separate browser window).

There are two ways to install mydist:

  1. Make a shell alias or function named dist that actually runs mydist.
  2. Rename the mydist script to dist. Put it in a directory that's listed before the MH binary directory in your shell search path. That way, the shell will find your version before it finds the real dist. The NOTE: at the start of the script will remind you what dist you're really using.

[Table of Contents] [Index] [Previous: Explanation of mimecat] [Next: Explanation of original]


Last change $Date: 1996/06/06 15:09:47 $

This file is from the third edition of the book MH & xmh: Email for Users & Programmers, ISBN 1-56592-093-7, by Jerry Peek. Copyright © 1991, 1992, 1995 by O'Reilly & Associates, Inc. This file is freely-available; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation. For more information, see the file copying.htm.

Suggestions are welcome: Jerry Peek <jerry@ora.com>

HIVE: All information for read only. Please respect copyright!
Hosted by hive КГБ: Киевская городская библиотека