Re: piping executing external commands (STDIN)
On Fri, Nov 17, 2000 at 11:23:35AM -0800 or so it is rumoured hereabouts, Gary Johnson thought: On Fri, Nov 17, 2000 at 01:09:16AM +, Conor Daly wrote: On Thu, Nov 16, 2000 at 04:25:20PM -0500 or so it is rumoured hereabouts, Jorg Ziefle thought: I want to pipe a message from within Mutt to a Perl program, which not only processes it, but as well reads some user input from STDIN. As far as I know, the pipe-message command ('|') only allows to _write_ the message to STDOUT, but then returns immediately (as its name suggests). So, is there a possibilty to achieve printing to a message to an external program which is then executed _before_ returning to Mutt? I've fought that fight before and AFAIK, there's no way to catch stdin from mutt. It *is* possible to capture input from the current tty with the $THIS_TTY variable. Just do a "read SOMETHING $THIS_TTY" but mutt handles anything that comes in on *its* tty and so this isn't possible here. I'm not sure I understand what you're trying to do here. I _think_ you want to pipe a message to some command, then query the user for some parameters before processing the message, then process the message, and finally return to mutt. If so, then yes, you _can_ do this with mutt and a shell script around your external program. Here's an example using 'fold' just for concreteness. cat /tmp/mutt_tmp_file# Save stdin. exec /dev/tty # Redirect stdin from the terminal. echo "Enter page width:" read width fold -w $width /tmp/mutt_tmp_file rm -f /tmp/mutt_tmp_file If you save this script as 'mutt_fold', then pipe your message from mutt as |mutt_fold the script will query you for the page width, then send the folded output to stdout. Is that what you wanted to do? Gary -- Gary Johnson | Agilent Technologies [EMAIL PROTECTED] | RF Communications Product Generation Unit | Spokane, Washington, USA That's the idea allright, in my case I want to check did I _actually_ attach that file that I said I attached in the outgoing mail. Now, what is /dev/tty ? Is it different if I'm in an xterm than if I'm at a console? I _did_ try redirecting input from whatever tty I was on at the time but unsucessfully. It apeared to me that, since mutt was running in the same tty, _it_ was intercepting keyboard input rather than my script. -- Conor Daly [EMAIL PROTECTED] Domestic Sysadmin :-)
Re: Saving Messages automatically
Charles Krug muttered: What I'd like to do is cause mutt to save certain types of messages automatically to specific folders. Would this be a matter of setting the correct save hooks? save-hooks are not executed automatically. Take a look at procmail for that purpose. HTH, Michael -- Computers don't actually think. You just think they think. (We think.) PGP-Key: http://www.stud.ims.uni-stuttgart.de/~tatgeml/public.key
bug? OpenPGP hash algo, and running GPG
First: I don't have any experience w/ PGP, but I have and use GPG. Bug severity: fairly minor GPG has a command line option to choose the digest algorithm when making signatures. Mutt has the ability to select this algorithm too, but from what I've seen in a cursory examination of the code, the only place the selected value is used is in the MIME header. Perhaps in pgpinvoke.c there could be an additional % escape for PgpSignMicalg in the format callback function? That would allow GPG (and possibly PGP) to select the same algo as Mutt puts in the header. Mutt by default will choose MD5, while GPG will use SHA-1. -- Oo---o, Oo---o, O-weem-oh-wum-ooo-ayyy In the jungle, the silicon jungle, the process sleeps tonight. Joe Philipps [EMAIL PROTECTED], http://www.philippsfamily.org/Joe/ public PGP/GPG key available at www.keyserver.net
another strange nfs problem...
I run mutt on my workstation with my mail directory nfs mounted. Mail get sorted into various folders in the mail dir automatically (via exim), I have these in my muttrc as mailboxes. Both machines are Debian/Linux boxes. The server is debian stable, running kernel 2.2.17 using the kernel nfs server. The client is debian unstable running kernel 2.4.0-test10 and mutt 1.2.5i. The problem seems to be with atimes getting set upon mutt startup. When first starting mutt the status line will report new mail in several of my mailboxes (eg. Inc:2), but as soon as I refresh the display the Inc: disappears. The mail is still in the mailboxes, and marked as new in them, but the status line no longer reports this. Once mutt is running this works as it should (the Inc: stays until the mailbox is checked). It only has this problem at startup. After doing a bit of testing, it seems like mutt is setting the atime of the mailboxes with new mail upon startup. Actually I think mutt is probably behaving correctly (by saving and resetting the atime), but the nfs server isn't. Has anyone else run into this problem? Does the newly patched knfs server in linux-2.2.18preX work any better, how about the knfsv3 server in 2.2.18? Any other solutions besides ditching nfs and switching to a imap, fetchmail, etc? Thanks in advance for any advice. Oh... I did try recompiling with the --enable-nfs-fix. It made no difference. -- John Eikenberry [[EMAIL PROTECTED] - http://zhar.net] __ "A society that will trade a little liberty for a little order will deserve neither and lose both." --B. Franklin
mutt and rot13 ?
This was posted on the NG comp.mail.mutt sometime ago but I have only jsut got around to palying with it and I thought my expereinces might be useful on the mutt list as well as the basic idea. On Thu, Oct 19, 2000 at 04:24:36PM +0200, Johannes Segitz wrote: On Thu, 19 Oct 2000 13:00:18 GMT, Renaud Colinet wrote: [EMAIL PROTECTED] (Frank Altpeter) wrote in 8smpfc$iju$[EMAIL PROTECTED]: Just a simple question ... is it possible to enable the mutt internal pager for viewing rot13 encoded content ? Just create a simple macro to filter the message through a rot13 encoding script, for instance: macro pager \er "| tr a-zA-Z n-za-mN-ZA-M" I bound it to Esc-r, which is the default in slrn. Cool macro, but when i start it, my screen gets rushed by chars. I can use macro pager \er "| tr a-zA-Z n-za-mN-ZA-M"|less but so i have to use less. What can i do else? First, I think macro pager \er "| tr a-zA-Z n-za-mN-ZA-M | less" is better with the " at the end. Second on AIX 2.3.5 I had to change this to macro pager \er "| /usr/ucb/tr -A 'a-zA-Z' 'n-za-mN-ZA-M' | less" The BSD tr seems better than the AIX tr (in /usr/bin). Without the ASCII -A flag it did not quite work in a way I did not understand. It did not translate m and LM. Third, a problem. If the message is rot13 coded and the headers are not, this macro of course rot13 codes the header and decodes the message. Is there a way to only pipe the message without the headers to tr? Of course I guess one could sed out everything up to a blank line, but I am thinking of something simpler. Cheers, Brian. -- Associate Professor Brian Salter-Duke (Brian Duke) [EMAIL PROTECTED] Chemistry, School of BECS, SITE, NT University, Darwin, NT 0909, Australia. Phone 08-89466702. Fax 08-89466847. http://www.smps.ntu.edu.au/ Get PGP2 Key:- http://www.smps.ntu.edu.au/chemistry/duke.key.html
Re: piping executing external commands (STDIN)
On Fri, Nov 17, 2000 at 11:32:39PM +, Conor Daly wrote: That's the idea allright, in my case I want to check did I _actually_ attach that file that I said I attached in the outgoing mail. Now, what is /dev/tty ? Is it different if I'm in an xterm than if I'm at a console? From the (HP-UX) tty(7) man page: The file /dev/tty is, in each process, a synonym for the control terminal associated with the process group of that process, if any. It is useful for programs or shell sequences that need to be sure of writing messages on the terminal no matter how output has been redirected. It can also be used for programs that demand the name of a file for output, when typed output is desired and it is tiresome to find out what terminal is currently in use. You can use /dev/tty from any type of terminal to refer to the current terminal; it should work the same way from a console or an xterm. I _did_ try redirecting input from whatever tty I was on at the time but unsucessfully. It apeared to me that, since mutt was running in the same tty, _it_ was intercepting keyboard input rather than my script. Well, if your program was running in the background at the same time mutt was running in the foreground, then you would have trouble reading from the tty. When I've done that inadvertently, each program seems to get about half the keystrokes, every other keystroke going to a different program. Otherwise, as long as mutt is suspended waiting for your program to finish before it continues, you should be able to redirect your program's stdin from the tty without any problem. Maybe if you could provide more details of exactly what you did and exactly how it failed, we might be able to figure out a solution. Gary -- Gary Johnson | Agilent Technologies [EMAIL PROTECTED] | RF Communications Product Generation Unit | Spokane, Washington, USA