There were a lot of things I didn't use anymore anyway.

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

git-svn-id: file:///srv/svn/repo/rin/trunk@2 5f6c6692-7da8-c640-9b4f-fb22b0af4e5b
This commit is contained in:
yakumo.izuru 2024-07-25 13:13:30 +00:00
parent 243ced7c46
commit d153e187ea
4 changed files with 92 additions and 51 deletions

View File

@ -1,8 +1,11 @@
PREFIX ?= /usr/local PREFIX ?= /usr/local
fmt:
shfmt -p -w rin
install: install:
install -Dm0755 rin ${PREFIX}/bin/rin install -Dm0755 rin ${PREFIX}/bin/rin
install -Dm0600 rin.1 ${PREFIX}/man/man1/rin.1 install -Dm0600 rin.1 ${PREFIX}/share/man/man1/rin.1
uninstall: uninstall:
rm -f ${PREFIX}/bin/rin rm -f ${PREFIX}/bin/rin
rm -f ${PREFIX}/man/man1/rin.1 rm -f ${PREFIX}/man/man1/rin.1

35
README
View File

@ -1,8 +1,29 @@
Rin (燐) RIN(1) FreeBSD General Commands Manual RIN(1)
NAME
rin My personal e-mail assistant, named after Rin Kaenbyou (aka Orin)
SYNOPSIS
rin [check] [clean] [fetch] [list] account
DESCRIPTION
It is a script that uses fdm(1) and mblaze(7) adapted to my configuration
USAGE
check account
Check for mail in the server
clean account
Clean up the Maildir directory
fetch account
Fetch mail from the remote server
list account
List messages on a Maildir
AUTHORS
Izuru Yakumo <yakumo.izuru@chaotic.ninja>
FreeBSD 13.3-RELEASE July 25, 2024 FreeBSD 13.3-RELEASE
Usage:
rin clean <maildir>
rin compose
rin fetch <account>
rin list <maildir>
rin read <message-id>

60
rin
View File

@ -1,24 +1,35 @@
#!/bin/sh #!/bin/sh
# rin - my personal e-mail assistant in posix shell # $TheSupernovaDuo$
# it's a wrapper over fdm(1) and mblaze(7) adapted to my setup # (o)rin - my personal e-mail assistant in posix shell
# which can be found on https://gt.kalli.st/novaburst/home-v2
# Source code: https://git.076.ne.jp/novaburst/mailutils-sh # Source code:
# - https://gitler.moe/novaburst/orin
# - https://git.chaotic.ninja/yakumo.izuru/orin
# Check for mail in the server
# Arguments: <account>
fn_check() {
fdm -a "$@" poll 2>/dev/null
if [ $? -ne 0 ]; then
echo "ごめんなさい、できませんでした..."
exit 1
fi
}
# Clean-up the Maildir directory # Clean-up the Maildir directory
# Arguments: <account> # Arguments: <account>
fn_clean() { fn_clean() {
find "$@"/cur -type f -print -delete 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 # Fetch e-mails from remote server
# Arguments: <account> # Arguments: <account>
fn_fetch() { fn_fetch() {
fdm -a "$@" fetch echo "はい、すぐに!"
fdm -a "$@" fetch 2>/dev/null
if [ $? -ne 0 ]; then
echo "ごめんなさい、できませんでした..."
exit 1
fi
} }
# List messages on a Maildir # List messages on a Maildir
# Arguments: <account> # Arguments: <account>
@ -26,22 +37,25 @@ fn_list() {
minc -q "$@" minc -q "$@"
mlist -s "$@" | msort -dr | mthread -r | mseq -S | mscan mlist -s "$@" | msort -dr | mthread -r | mseq -S | mscan
} }
# Read a message
# Arguments: <message>
fn_read() {
mless "$2"
}
# Print an usage note # Print an usage note
# Triggered if the assistant is called without any arguments. # Triggered if the assistant is called without any arguments.
fn_usage() { fn_usage() {
printf "Usage: \n" printf "usage: %s [ check | clean | fetch | list ] <account/message> \n" "$(basename $0)"
printf "%s [ clean | compose | fetch | list | read ] <account/message> \n" "$(basename $0)"
} }
case $1 in case $1 in
clean | -c) fn_clean "$2" ;; check)
compose | -w) fn_compose ;; fn_check "$2"
fetch | -f) fn_fetch "$2" ;; ;;
list | -l) fn_list "$2" ;; clean)
read | -r) fn_read "$2" ;; fn_clean "$2"
*) fn_usage ;; ;;
fetch)
fn_fetch "$2"
;;
list)
fn_list "$2"
;;
*)
fn_usage
;;
esac esac

37
rin.1
View File

@ -1,29 +1,32 @@
.Dd June 9, 2022 .Dd July 25, 2024
.Dt RIN 1 .Dt RIN 1
.Os .Os
.Sh NAME .Sh NAME
.Nm rin .Nm rin
.Nd My personal e-mail assistant .Nd My personal e-mail assistant, named after Rin Kaenbyou (aka "Orin")
.Sh SYNOPSIS
.Nm
.Op check
.Op clean
.Op fetch
.Op list
.Ar account
.Sh DESCRIPTION .Sh DESCRIPTION
It's a wrapper over It is a script that uses
.Xr fdm 1 .Xr fdm 1
and and
.Xr mblaze 7 .Xr mblaze 7
adapted to my setup adapted to my configuration
.Sh USAGE .Sh USAGE
.Bl -tag -width 11n -compact .Bl -tag -width 6n
.It clean, -c .It check Ar account
Clean-up a Maildir directory Check for mail in the server
.It compose, -w .It clean Ar account
Compose/write an e-mail Clean up the Maildir directory
.It fetch, -f .It fetch Ar account
Fetch e-mails from remote server Fetch mail from the remote server
.It list, -l .It list Ar account
List messages on a Maildir List messages on a Maildir
.It read, -r
Read a message
.El .El
.Sh SEE ALSO
.Lk https://gt.kalli.st/novaburst/home-v2
.Sh AUTHORS .Sh AUTHORS
.An Aoi Koizumi Aq Mt novaburst@kalli.st .An Izuru Yakumo Aq Mt yakumo.izuru@chaotic.ninja