native_netbsd_mailx
Differences
This shows you the differences between two versions of the page.
native_netbsd_mailx [2022/01/21 03:36] – created zilog | native_netbsd_mailx [2024/09/06 05:55] (current) – “.” hc9 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Native NetBSD mail(1) Setup and Use: ====== | ||
+ | |||
+ | This is the native mail client on **NetBSD**, the operating system the SDF cluster runs on. For historical reasons there are several aliases: //mail(1), Mail(1), mailx(1)//, however sticking to the first two will avoid name collision with any non-native clients. | ||
+ | |||
+ | ===== Setup ===== | ||
+ | |||
+ | Native //mail(1)// uses **~sdfuser/ | ||
+ | |||
+ | <file config ~sdfuser/ | ||
+ | ### NetBSD mail(1) config file (~/ | ||
+ | |||
+ | ## Hold mail in system Inbox (/ | ||
+ | set hold | ||
+ | |||
+ | ## Set top of mail folder tree & cd into it; can | ||
+ | ## be any name but " | ||
+ | # use ' | ||
+ | set folder=mail | ||
+ | # allows simple folder changes, ex. 'fi Sent' instead of 'fi +/ | ||
+ | chdir mail | ||
+ | |||
+ | ## Set non-std mbox and record names/ | ||
+ | ## (default loc: ~/ ; ' | ||
+ | # ~/mbox is default: | ||
+ | set MBOX=+Save | ||
+ | # none is default: | ||
+ | set record=+Sent | ||
+ | |||
+ | ## Header fields to ignore & retain: | ||
+ | ignore message-id received fcc status resent-date resent-message-id resent-from in-reply-to | ||
+ | retain bcc cc date from subject to user-agent organization | ||
+ | |||
+ | ## Add additional headers - these are added to outgoing | ||
+ | ## messages unless editted/ | ||
+ | Header User-Agent: NetBSD Mail version 9.1alpha 2009-02-25 | ||
+ | Header Organization: | ||
+ | |||
+ | ## uncomment to tweak the ' | ||
+ | ## SDF user GECOS field (use userinfo(1) to list): | ||
+ | #Header From: SDFuser at SDF < | ||
+ | |||
+ | # Open even if no mail: | ||
+ | set emptystart | ||
+ | |||
+ | ## Email aliases: | ||
+ | # use for contacting SDF membership: | ||
+ | alias sdfhelp 'SDF membership < | ||
+ | # a list of users, both local and remote: | ||
+ | alias wrkgrp sdfuser2 sdfuser3 rmtuser@remote.addr 'The Boss < | ||
+ | |||
+ | ## set alt. editor(s) and pager; these will override | ||
+ | ## user's EDITOR, VISUAL, PAGER shell env. vars: | ||
+ | # default is PAGER: | ||
+ | #set PAGER=more | ||
+ | # default is EDITOR: | ||
+ | #set EDITOR=nano | ||
+ | # default is VISUAL: | ||
+ | #set VISUAL=$HOME/ | ||
+ | |||
+ | ## Set an alternate escape char for composition mode; this | ||
+ | ## helps prevent command collision with ssh(1) which also uses | ||
+ | ## the ' | ||
+ | # set escape char to " | ||
+ | #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 things to prompt for before sending: | ||
+ | set append ask autoprint | ||
+ | |||
+ | ## Set indent prefix (for Replys); use with ' | ||
+ | set indentprefix="> | ||
+ | | ||
+ | ## Set autograph string & alternate (use with ' | ||
+ | set sign=' | ||
+ | set Sign=' | ||
+ | |||
+ | ## pipe html/text type messages thru lynx(1), the text | ||
+ | ## web browser. | ||
+ | set mime-decode-header mime-decode-message mime-decode-quote | ||
+ | set mime-body-text-html=" | ||
+ | |||
+ | </ | ||
+ | |||
+ | ===== Basic Use ===== | ||
+ | |||
+ | The //mail(1)// manpage will explain basic usage; once //mail(1)// is running you can type '' | ||
+ | |||
+ | ==== Composition ==== | ||
+ | |||
+ | To compose a new message either launch mail(1) with '' | ||
+ | |||
+ | To reply to a message to a user from within //mail(1)// type '' | ||
+ | |||
+ | Some useful composition commands: '' | ||
+ | |||
+ | ==== 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 ** ~/ | ||
+ | |||
+ | <file config ~homeuser/ | ||
+ | # disable pty escapes: | ||
+ | EscapeChar none | ||
+ | </ | ||
+ | |||
+ | 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). | ||
+ | |||
+ | <file config ~sdfuser/ | ||
+ | #!/bin/sh -e | ||
+ | # veditor - for using lynx(1) as VISUAL editor in mail(1) | ||
+ | # | ||
+ | |||
+ | { echo '< | ||
+ | cat $* |egrep -m4 ' | ||
+ | cat $* |sed ' | ||
+ | echo '</ | ||
+ | </ | ||
+ | |||
+ | To use current message just type '' | ||