Xref: utzoo news.software.b:1401 comp.sources.d:2306 Path: utzoo!attcan!uunet!mcvax!philapd!jos From: jos@philapd.UUCP (Jos Vos) Newsgroups: news.software.b,comp.sources.d Subject: Re: Quick hack to use the normal mail program for replies in rn Summary: Another hack, maybe it's even not a hack but a solution Keywords: rn Rnmail.SH Rnmail Message-ID: <104@philapd.idca.tds.philips.nl> Date: 15 Jun 88 06:55:55 GMT References: <19305@watmath.waterloo.edu> Organization: Philips TDS, P.O. Box 245, 7300 AE Apeldoorn, The Netherlands Lines: 67 In article <19305@watmath.waterloo.edu> sahayman@watmath.waterloo.edu (Steve Hayman) writes: >Want to use the regular Unix "mail" program to compose >replies to news articles from within "rn", rather than >the "Rnmail" shell script? Well, I do. I do it like this: >i) arrange to have rn take its options from a file, by something like > setenv RNINIT ~/.rninit >ii) in my .rninit file, add these three lines: > >-EMAILHEADER='From %t %`date` >' >-EMAILPOSTER='cat %A >>%h; mail -f %h' > >Now, when I type 'r', rn dumps the current article into a >file that looks like a mailbox, and then starts mail looking >at that file; type "r" within mail to reply. I like this >a lot better than "Rnmail" even though I have to type "r" twice, >and don't get any of that "In article such-and-such you write" stuff. What's really needed, I think, is the functionality of readnews' followup, substituting the address in the 'internet' address of 'LIB/mailpaths'. For that reason I adapted Rnmail.SH (and so Rnmail changes in the same way). Here's the extra piece of text to be put after line 145 (just after the first part of file $tmpart is made): --- START OF INSERTED TEXT --- # START OF DESTINATION ADDRESS CONVERSION # Equivalent to function 'replyname' (netnews/src/funcs2.c) # search for 'internet' entry in file /usr/lib/mailpaths iformat=`expr "\`$grep '^internet' /usr/lib/news/mailpaths\`" : \ 'internet[ ][ ]*\([^ ]*\)'` # if no entry is found, just assume we can handle internet addresses if test -n "$iformat" then # extract (internet) destination address from temporary file to=`expr "\`$grep '^To:' $tmpart\`" : 'To:[ ]*\([^ ]*\)'` # if format string contains no '!' or '@' we may just substitute if $test `expr "$iformat" : '[^!@]*$'` -eq 0 then # format string contains '!' and/or '@' if $test `expr "$iformat" : '[^@]*$'` -gt 0 then # format string contains no '@' # if to string contains no '@', nothing will change to=`$echo "$to" | sed 's/^\([^@]*\)@\(.*\)$/\2!\1/'` else # format string contains '@' # if to string contains no '@', nothing will change to=`$echo "$to" | sed 's/@/%/'` fi fi # now we can substitute the bang address into the format string to=`awk "END { printf \"$iformat\", \"$to\" }" < /dev/null` # finally, we have to replace the address in the temporary file $echo "/^To:/c\nTo: $to\n.\nw\nq" | ed - -s $tmpart fi # END OF DESTINATION ADDRESS CONVERSION --- END OF INSERTED TEXT --- I'm not sure it solves *all* problems, but I'm quite sure it solves *the same* problems as the routine in funcs2.c (readnews) does. For me that's enough. -- # Jos Vos # Internet jos@philapd.UUCP # # Philips TDS, Dept SSP # # # P.O. Box 245 # UUCP ..!mcvax!philapd!jos # # 7300 AE Apeldoorn, The Netherlands # Phone +31 55 433181 #