home
readme
diff
tree
note
docs
0commit d1e60baa5c1198bb066aeefc1deb348ff6167e9c
1Author: Mason Wright <mason@lakefox.net>
2Date: Sun Nov 9 11:44:17 2025 -0700
3
4 working resave
5
6diff --git a/cgi-bin/.mailto.awk.swp b/cgi-bin/.mailto.awk.swp
7index 1de3b0a..10fd033 100644
8Binary files a/cgi-bin/.mailto.awk.swp and b/cgi-bin/.mailto.awk.swp differ
9diff --git a/cgi-bin/mailto.awk b/cgi-bin/mailto.awk
10index 65198d9..2316290 100755
11--- a/cgi-bin/mailto.awk
12+++ b/cgi-bin/mailto.awk
13@@ -165,11 +165,15 @@ function openMail(folder, uid) {
14
15 # This function will keep all email's up to date
16 function getThreads(username, password, inbox, query) {
17- cmd = "(echo 'USER " username "'; echo PASS '" password "'; echo LIST; echo QUIT;) | nc -i 1 " inbox " 110"
18+# TODO: "(echo 'USER " username "'; echo PASS '" password "'; echo LIST; echo QUIT;) | nc -i 1 " inbox " 110"
19+# RETR 1
20 # . == end of message
21- while (cmd | getline res) {
22- if (res ~ !/^\+/) {
23- print res
24+ cmd = "curl -s -u '" username ":" password "' '" inbox "' -X 'UID SEARCH SUBJECT " query "'"
25+ while ((cmd | getline res) > 0) { # collect last line
26+ split(res, a); # a[1]="*"; a[2]="SEARCH"; rest are UIDs
27+ n = 0
28+ for (i = 3; i <= length(a); i++) { # skip "* SEARCH"
29+ uids[++n] = a[i]
30 }
31 }
32 close(cmd)