User Tools

Site Tools


playground:native_mail

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Last revisionBoth sides next revision
playground:native_mail [2021/12/30 00:57] – created zilogplayground:native_mail [2021/12/30 04:21] zilog
Line 7: Line 7:
 Native //mail(1)// uses  **~sdfuser/.mailrc**  for its configurations; below is an annotated sample config file which should work for most SDF users with little modification: Native //mail(1)// uses  **~sdfuser/.mailrc**  for its configurations; below is an annotated sample config file which should work for most SDF users with little modification:
  
-<file config ~homeuser/.mailrc>+<file config ~sdfuser/.mailrc>
 ### NetBSD mail(1) config file (~/.mailrc): ### NetBSD mail(1) config file (~/.mailrc):
  
Line 38: Line 38:
 ## uncomment to tweak the 'From:' field; default is ## uncomment to tweak the 'From:' field; default is
 ## SDF user GECOS field (use userinfo(1) to list): ## SDF user GECOS field (use userinfo(1) to list):
-#Header From: sdfuser@beevomit.org(Me at SDF)+#Header From: SDFuser at SDF <sdfuser@beevomit.org>
  
 # Open even if no mail: # Open even if no mail:
Line 46: Line 46:
 # use for contacting SDF membership: # use for contacting SDF membership:
 alias sdfhelp 'SDF membership <membership@sdf.org>' alias sdfhelp 'SDF membership <membership@sdf.org>'
 +# a list of users, both local and remote:
 +alias wrkgrp sdfuser2 sdfuser3 rmtuser@remote.addr 'The Boss <boss@big.house>'
  
 ## set alt. editor(s) and pager; these will override ## set alt. editor(s) and pager; these will override
Line 56: Line 58:
 #set VISUAL=$HOME/bin/veditor #set VISUAL=$HOME/bin/veditor
  
-## enable piping output of mailx cmds. In example, +## Set an alternate escape char for composition mode; this 
-## typing '|wc -m' gives word count for curr. msg:+## helps prevent command collision with ssh(1) which also uses 
 +## the '~' character for session escapes: 
 +# set escape char to "`" (backtick): 
 +#set escape=` 
 +   
 +## enable piping output of mailx cmds. In example, typing 
 +## '|wc -w' gives word count for *body* of current msg:
 set enable-pipes set enable-pipes
  
Line 65: Line 73:
 ## Set indent prefix (for Replys); use with '~m': ## Set indent prefix (for Replys); use with '~m':
 set indentprefix="> " set indentprefix="> "
 +    
 +## Set autograph string & alternate (use with '~a' & '~A'):
 +set sign='SDFuser / SDF Public Access UNIX'
 +set Sign='SDFuser of SDF'
  
 ## pipe html/text type messages thru lynx(1), the text ## pipe html/text type messages thru lynx(1), the text
Line 77: Line 89:
 The //mail(1)// manpage will explain basic usage; once //mail(1)// is running you can type ''help'' and ''list'' for basic help info and a listing of commands.  Many commands can be abbreviated, i.e. 'm' for ''mailto'', 'd' for ''delete'', 'p' for ''print''. To page through multiple screens of messages use ''z'' (down) and ''z -'' (up).  A useful command is ''x'' which will quit without saving changes -- handy if you've made several unintended changes, i.e. deleting a bunch of messages. The //mail(1)// manpage will explain basic usage; once //mail(1)// is running you can type ''help'' and ''list'' for basic help info and a listing of commands.  Many commands can be abbreviated, i.e. 'm' for ''mailto'', 'd' for ''delete'', 'p' for ''print''. To page through multiple screens of messages use ''z'' (down) and ''z -'' (up).  A useful command is ''x'' which will quit without saving changes -- handy if you've made several unintended changes, i.e. deleting a bunch of messages.
  
 +==== Composition ====
  
 +To compose a new message either launch mail(1) with ''mail someone@addr.foo'' or type ''m someone@addr.foo'' within mail(1).  Any defined aliases can be substituted for an address or group of addresses.  For example if ** alias mylist one@addr1 two@addr2 three@addr3 ** is defined then typing ''m mylist'' will send your message to all addresses to the right of "mylist"
  
 +To reply to a message to a user from within //mail(1)// type ''R'' This will put you in composition mode; to get help type ''~?'' or "?" prefixed with whatever alternate escape character you've set (may be needed within secure shell sessions).
  
 +Some useful composition commands: ''~m'' will quote the current message using the //indentprefix// character(s); ''~e'' will launch the editor set in EDITOR; ''~a'' will add the signature string assigned to //sign// To finish your reply type either ''CNTL+D'' or a single "." on a new line.  If you've changed your mind and want to discard your reply type ''~x'' (or ''~q'' which will save the text to your ~/dead.letter file).  To later retrieve the discarded contents within composition mode type ''~r ~/dead.letter''
 +
 +==== Tips & Tricks ====
 +
 +1. If you'd rather not change the default composition mode escape character for //mail(1)// but are using secure shell (ssh) to connect to SDF you can add the following to your ** ~/.ssh/config ** file:
 + 
 +<file config ~homeuser/.ssh/config>
 +# disable pty escapes:
 +EscapeChar none
 +</file>
 + 
 +This will disable PTY escapes completely; alternately you can choose a different escape character if needed.
 +
 +2. The VISUAL editor variable can be set within ** ~/.mailrc ** to a shell script which invokes an interactive lynx(1) session on the current mail message (or several messages).  This is useful for easilly following embedded URLs (lynx supports many protocols besides http/https such as gopher, finger, news and ftp).  The following is a sample script:
 +
 +<file config ~sdfuser/bin/veditor>
 +#!/bin/sh -e
 +# veditor - for using lynx(1) as VISUAL editor in mail(1)
 +#
 +
 +{ echo '<pre>'
 +  cat $* |egrep -m4 '^From:|^Date:|^To:|^Subject:'
 +  cat $* |sed '1,/^$/d'
 +  echo '</pre>'  ;} |lynx -force_html -stdin
 + </file>
 +
 +To use current message just type ''v'' ; if in composition mode use ''~v'' It doesn't always look pretty but it's often enough for following a few links.