Orin, go!

Signed-off-by: Izuru Yakumo <yakumo.izuru@chaotic.ninja>

git-svn-id: file:///srv/svn/repo/rin/trunk@1 5f6c6692-7da8-c640-9b4f-fb22b0af4e5b
This commit is contained in:
yakumo.izuru 2023-04-08 00:26:50 +00:00
commit 243ced7c46
5 changed files with 97 additions and 0 deletions

4
COPYING Normal file
View File

@ -0,0 +1,4 @@
Freedom License v1 (2021年08月17日)
全く無限的自由です。
It's infinite freedom.

9
Makefile Normal file
View File

@ -0,0 +1,9 @@
PREFIX ?= /usr/local
install:
install -Dm0755 rin ${PREFIX}/bin/rin
install -Dm0600 rin.1 ${PREFIX}/man/man1/rin.1
uninstall:
rm -f ${PREFIX}/bin/rin
rm -f ${PREFIX}/man/man1/rin.1

8
README Normal file
View File

@ -0,0 +1,8 @@
Rin (燐)
Usage:
rin clean <maildir>
rin compose
rin fetch <account>
rin list <maildir>
rin read <message-id>

47
rin Normal file
View File

@ -0,0 +1,47 @@
#!/bin/sh
# rin - my personal e-mail assistant in posix shell
# it's a wrapper over fdm(1) and mblaze(7) adapted to my setup
# which can be found on https://gt.kalli.st/novaburst/home-v2
# Source code: https://git.076.ne.jp/novaburst/mailutils-sh
# Clean-up the Maildir directory
# Arguments: <account>
fn_clean() {
find "$@"/cur -type f -print -delete
}
# Compose/write an e-mail
# This is just here for some reason
fn_compose() {
mcom
}
# Fetch e-mails from remote server
# Arguments: <account>
fn_fetch() {
fdm -a "$@" fetch
}
# List messages on a Maildir
# Arguments: <account>
fn_list() {
minc -q "$@"
mlist -s "$@" | msort -dr | mthread -r | mseq -S | mscan
}
# Read a message
# Arguments: <message>
fn_read() {
mless "$2"
}
# Print an usage note
# Triggered if the assistant is called without any arguments.
fn_usage() {
printf "Usage: \n"
printf "%s [ clean | compose | fetch | list | read ] <account/message> \n" "$(basename $0)"
}
case $1 in
clean | -c) fn_clean "$2" ;;
compose | -w) fn_compose ;;
fetch | -f) fn_fetch "$2" ;;
list | -l) fn_list "$2" ;;
read | -r) fn_read "$2" ;;
*) fn_usage ;;
esac

29
rin.1 Normal file
View File

@ -0,0 +1,29 @@
.Dd June 9, 2022
.Dt RIN 1
.Os
.Sh NAME
.Nm rin
.Nd My personal e-mail assistant
.Sh DESCRIPTION
It's a wrapper over
.Xr fdm 1
and
.Xr mblaze 7
adapted to my setup
.Sh USAGE
.Bl -tag -width 11n -compact
.It clean, -c
Clean-up a Maildir directory
.It compose, -w
Compose/write an e-mail
.It fetch, -f
Fetch e-mails from remote server
.It list, -l
List messages on a Maildir
.It read, -r
Read a message
.El
.Sh SEE ALSO
.Lk https://gt.kalli.st/novaburst/home-v2
.Sh AUTHORS
.An Aoi Koizumi Aq Mt novaburst@kalli.st