s-mailx
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
s-mailx [2022/02/07 19:25] – zilog | s-mailx [2024/09/16 07:22] (current) – 2"” hc9 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== S-mailx (aka s-nail) ====== | ||
+ | |||
+ | S-mailx is an active fork of Heirloom mailx which ceased development around 2010. S-mailx has preserved most of the latter' | ||
+ | |||
+ | ===== Documentation and Features ===== | ||
+ | |||
+ | The s-mailx manpage, '' | ||
+ | |||
+ | * all Heirloom-mailx features: POP3/ | ||
+ | * Maildir support | ||
+ | * readline (cmd history) | ||
+ | * optional coloration | ||
+ | * enhanced spam filtering | ||
+ | * detailed error reporting | ||
+ | |||
+ | One thing to be aware of is that even though s-mailx is a fork and largely a super-set of heirloom-mailx there is significant deviation with respect to command names and configuration syntax such that separate configuration files are necessary; attempting to craft a common configuration file for both will likely fail and potentially result in lost messages. | ||
+ | |||
+ | ===== Setup ===== | ||
+ | |||
+ | ==== Running S-mailx ==== | ||
+ | |||
+ | S-mailx actually installs as ''/ | ||
+ | |||
+ | ==== Configuration ==== | ||
+ | |||
+ | Several S-mailx options are pre-set via ''/ | ||
+ | |||
+ | The default user configuration file for S-mailx is '' | ||
+ | |||
+ | <file ~sdfuser/ | ||
+ | set mailx-extra-rc=" | ||
+ | </ | ||
+ | |||
+ | This will allow occasional / accidental use of the native mail(1) client and keeps all the “S-mailx-specific” settings in '' | ||
+ | |||
+ | A basic SDF specific S-mailx configuration (using both ~/.mailrc and ~/ | ||
+ | |||
+ | <file config ~sdfuser/ | ||
+ | ## ~sdfuser/ | ||
+ | |||
+ | # Set top of mail folder tree to ~/mail: | ||
+ | set folder=mail | ||
+ | |||
+ | # Tell s-nail where to get additional configurations: | ||
+ | set mailx-extra-rc=" | ||
+ | </ | ||
+ | |||
+ | Note that this technique is also used for the Heirloom mailx client via the NAIL_EXTRA_RC variable; having both '' | ||
+ | |||
+ | <file config ~/ | ||
+ | ## ~sdfuser/ | ||
+ | |||
+ | # hold mail in system Inbox (default): | ||
+ | set hold | ||
+ | |||
+ | # see s-nail(1) for details: | ||
+ | set v15-compat=yes | ||
+ | |||
+ | # set EDITOR if different than default: | ||
+ | #set EDITOR=vi | ||
+ | |||
+ | # allow " | ||
+ | set bsdcompat dot flip autoprint | ||
+ | |||
+ | ## Mbox settings: | ||
+ | set from=' | ||
+ | set reply-to=' | ||
+ | # redundant is set in ~/.mailrc: | ||
+ | set folder=mail | ||
+ | # ' | ||
+ | set MBOX=+Save | ||
+ | set record=+Sent | ||
+ | shortcut saved +Save | ||
+ | shortcut sent +Sent | ||
+ | |||
+ | ## automatic MIME type processing: | ||
+ | # pipe all webified msgs thru lynx(1): | ||
+ | set pipe-text/ | ||
+ | |||
+ | ## command aliases: | ||
+ | # use to return from remote accts: | ||
+ | commandalias home ' | ||
+ | # match mail(1) cmd: | ||
+ | commandalias inc ' | ||
+ | # quiet the ' | ||
+ | commandalias set ' | ||
+ | # thread/ | ||
+ | commandalias thrd 'sort thread' | ||
+ | commandalias uthr ' | ||
+ | |||
+ | ## email address aliases: | ||
+ | alias snail-list | ||
+ | |||
+ | # group aliases - note: cc/bcc mailings need to have | ||
+ | # at least one To: entry | ||
+ | #alias hop-list | ||
+ | # mrwarts@mud.bog \ | ||
+ | # " | ||
+ | |||
+ | ## SMTP stuff: | ||
+ | # wait until MTA finishes when sending mail. | ||
+ | # => allows seeing any errors: | ||
+ | set sendwait | ||
+ | |||
+ | ### IMAP accounts section: ### | ||
+ | |||
+ | # Another SDF user account: | ||
+ | account sdfuser2 { | ||
+ | set hold | ||
+ | # just because.. | ||
+ | set ssl-verify-mx.sdf.org=ignore | ||
+ | set MBOX=+Saved | ||
+ | set folder=imaps:// | ||
+ | set inbox=imaps:// | ||
+ | set password-sdfuser2@mx.sdf.org=" | ||
+ | set from=' | ||
+ | set record=+Sent | ||
+ | shortcut saved +Saved | ||
+ | shortcut sent +Sent | ||
+ | } | ||
+ | |||
+ | ### note: due to 2022 Gmail policy change this no longer works ### | ||
+ | # Typical Gmail IMAP/SMTP w/ SSL setup (enable IMAP on your acct first); | ||
+ | # note use of "URL percent encoded" | ||
+ | account gmail { | ||
+ | set hold | ||
+ | set folder=" | ||
+ | set inbox=" | ||
+ | set password-gmail.user%40gmail.com@imap.gmail.com=' | ||
+ | set shortcut sent=" | ||
+ | set shortcut trash=" | ||
+ | set from=' | ||
+ | set reply-to=' | ||
+ | set record=+Sent | ||
+ | shortcut saved +Saved | ||
+ | shortcut sent +Sent | ||
+ | ### Gmail SMTP stuff ### | ||
+ | # => reserved chars in SMTP pwd need to be URL percent encoded <= | ||
+ | set mta=" | ||
+ | } | ||
+ | |||
+ | </ | ||
+ | |||
+ | ===== S-mailx Usage ===== | ||
+ | |||
+ | Basic usage is essentially identical for all mailx-style clients and so won't be covered here; see the [[traditional_mail_1_mailx_1# | ||
+ | |||
+ | S-mailx has fairly decent interactive help. Get a listing of all commands with '' | ||
+ | |||
+ | ==== Remote accounts ==== | ||
+ | |||
+ | Remote or alternate SDF accounts are accessed via the '' | ||
+ | |||
+ | < | ||
+ | |||
+ | Note the “+” ; sub-folders //under// your main mail directory, i.e. //~/mail//, are accessed using '' | ||
+ | |||
+ | If multiple folders are configured for an account they can usually be listed using the '' | ||
+ | |||
+ | ^ shortcut | ||
+ | | % | system Inbox | | ||
+ | | # | previous folder | ||
+ | | & | account MBOX | | ||
+ | |||
+ | |||
+ | To return to your default account – the one associated with YOU – within a S-mailx session use '' | ||
+ | |||
+ | ==== Colors and other hacks ==== | ||
+ | |||
+ | S-mailx can colorize your session experience depending on your terminal' | ||
+ | |||
+ | Example: | ||
+ | <code file=~sdfuser/ | ||
+ | # colors: prompt & msg info=teal, headers=green, | ||
+ | set colour-pager | ||
+ | if terminal && " | ||
+ | colour iso view-msginfo fg=cyan | ||
+ | colour iso view-header ft=bold, | ||
+ | colour iso view-header fg=green | ||
+ | colour iso mle-prompt fg=cyan | ||
+ | colour iso mle-error fg=red | ||
+ | endif | ||
+ | </ | ||
+ | |||
+ | Note european spelling – use // | ||
+ | |||
+ | Hacking the prompt: by default the S-mailx prompt is just a **//?// | ||
+ | |||
+ | <code file=~sdfuser/ | ||
+ | set prompt=' | ||
+ | </ | ||
+ | |||
+ | For a local folder, say // | ||
+ | |||
+ | < | ||
+ | |||
+ | Not bad. However, remote IMAP accounts can look a bit uglier: < | ||
+ | |||
+ | If you are accessing such accounts you're already aware of their type; no need to display the full path. The following hack checks if variable //acount// is set (only set for remote accounts) and if so, uses a regex expression to filter the contents of the // | ||
+ | |||
+ | <code file=~sdfuser/ | ||
+ | # customize prompt | ||
+ | define custom-prompt { | ||
+ | if -z $' | ||
+ | set prompt=' | ||
+ | else | ||
+ | vput vexpr prompt regex " | ||
+ | endif | ||
+ | } | ||
+ | set folder-hook=custom-prompt | ||
+ | </ | ||
+ | |||
+ | Now when we switch to our account “gmail” we get something like the following: | ||
+ | |||
+ | < | ||
+ | ... | ||
+ | [gmail]: | ||
+ | ... | ||
+ | [gmail]: | ||
+ | </ | ||
+ | |||
+ | A bit nicer! | ||