list

scripts

Repo containing scripts to be used with dovel, and git hooks that powers our web interface.

curl https://dovel.email/scripts.tar tar

f43f13b

Author: blmayer (bleemayer@gmail.com)

Date: Tue Oct 3 20:44:32 2023 -0300

Parent: 70455e3

Added logs to dovel hook

Diff

receive-dovel.email

diff --git a/receive-dovel.email b/receive-dovel.email
index 9f73076..fc47732 100755
--- a/receive-dovel.email
+++ b/receive-dovel.email
@@ -10,7 +10,7 @@ inbox() {
 	<h2>mail</h2>
 	EOF
 
-	ls -ogdt --time-style long-iso "$root/$repo/mail"/* | while read -r g x s d t f
+	ls -ogdt --time-style long-iso "$root/$repo/mail/"* | while read -r g x s d t f
 		do
 			[ -d "$f" ] || continue
 
@@ -40,7 +40,7 @@ emails() {
 	EOF
 
 	# print each email
-	ls -1rt "$root/$repo/mail/$subj"/*.mbox | while read -r f
+	ls -1rt "$root/$repo/mail/$subj/"*.mbox | while read -r f
 		do
 			{
 				# print headers
@@ -81,6 +81,8 @@ emails() {
 }
 
 save() {
+	echo "reading email"
+
 	# first line is From email date:
 	read -r foo from date
 
@@ -95,16 +97,19 @@ save() {
 		esac
 	done
 	eid="${eid:-$(date -Iseconds)}"
-	repo="${to%@*}"	
+	repo="${to%@*}"
+	echo "email from $from to $to about $subj"
 
 	# now the rest is a body
 	cat - > /dev/null
 
 	# move temp file
+	echo "moving mbox file"
 	[ -d "$root/$repo/mail/$subj" ] ||  mkdir -p "$root/$repo/mail/$subj"
 	mv "$tmp" "$root/$repo/mail/$subj/$eid.mbox"
 
 	# create html pages
+	echo "creating html pages"
 	inbox > "$root/$repo/mail.html"
 	emails > "$root/$repo/mail/$subj.html"
 }