From d0b8d19ae027597c7cfeb952737e2a7def7b4b33 Mon Sep 17 00:00:00 2001 From: Hsieh Chin Fan Date: Tue, 4 Feb 2025 14:32:23 +0800 Subject: Update --- bin/mail/deliver.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/mail/deliver.sh b/bin/mail/deliver.sh index aba07ef..9701c74 100755 --- a/bin/mail/deliver.sh +++ b/bin/mail/deliver.sh @@ -47,14 +47,14 @@ header="$(<<<"$MAIL" sed '/^$/ q; /^[[:blank:]]/ d;')" body="$(<<<"$MAIL" sed -n '/^$/,$ p' | sed '1d')" # vars about output -date=$(date --iso=seconds) +iso_date=$(date --iso=seconds -d @${epoch}) maildir=${HOME}/Maildir mailbox= # }}} # FUNCTION: Set set_stdout {{{ set_stdout() { filename=${Subject// /_} - path=${maildir}/${mailbox}${mailbox:+/}new/${date//:/}.${filename//[^[:alnum:]_]/} + path=${maildir}/${mailbox}${mailbox:+/}new/${iso_date//:/}.${filename//[^[:alnum:]_]/} mkdir -p $(dirname $path) exec 1>$path @@ -154,7 +154,7 @@ set_stdout && print_mail # log to stderr declare -i width_mailbox=$(wc -c <<<"${mailbox:-INBOX}") -spaces="$(printf %$(( 18 - ${width_mailbox} ))s)" -echo -e ${date} ${mailbox:-INBOX} "$spaces" "${heading:-${SUBJECT}}" >&2 +spaces="$(printf %$(( 16 - ${width_mailbox} ))s)" +echo -e $(date '+%m-%d %H:%M' -d @${epoch}) "=> ${mailbox:-INBOX}" "$spaces" "${heading:-${SUBJECT}}" >&2 # vim:fdm=marker fdl=0 -- cgit v1.2.3-70-g09d2