Browse Source

improvements

Pi 1 year ago
parent
commit
b17cb9c0ef
6 changed files with 20 additions and 9 deletions
  1. 2 2
      .fetchmailrc
  2. 0 0
      cropswap-debug.sh
  3. 8 0
      cropswap-register.sh
  4. 6 6
      maildroprc
  5. 3 0
      postmaster.cmds
  6. 1 1
      subunsub.sh

+ 2 - 2
.fetchmailrc

@@ -2,8 +2,8 @@
 set postmaster pi
 set syslog
 
-poll imap.mailserver.com with protocol IMAP service 993 ;
-    username "USER", with password "PASSWORD", is "pi" here;
+poll imap.mailfence.com with protocol IMAP service 993 ;
+    username "USER" is "pi" here;
     ssl;
 #    idle;
     folder "Inbox/Crop Swap Mail Incoming" keep fetchall;

+ 0 - 0
cropswap-replymail.sh → cropswap-debug.sh


+ 8 - 0
cropswap-register.sh

@@ -0,0 +1,8 @@
+#!/bin/bash
+set -euo pipefail
+
+ALIAS="$1"
+EMAIL="$2"
+
+./cropswap-postmaster.sh SIGNUP "$ALIAS" "$EMAIL"
+./cropswap-postmaster.sh SUBSCRIBE "$ALIAS" "$EMAIL"

+ 6 - 6
maildroprc

@@ -4,11 +4,11 @@
 # delivery- this is where courier-imap (amongst others) will look.
 #DEFAULT="$HOME/Maildir"
 SHELL="/bin/bash"
-SENDMAIL="/home/pi/cropswap-sendmail.sh"
-REPLYMAIL="/home/pi/cropswap-replymail.sh"
-MLIST="/home/pi/mlist"
-SLIST="/home/pi/slist"
-SUBUNSUB="/home/pi/cropswap-subunsub.sh"
+SENDMAIL="/opt/cropswap/sendmail.sh"
+SUBUNSUB="/opt/cropswap/subunsub.sh"
+DEBUGMAIL="/opt/cropswap/debug.sh"
+MLIST="/var/mail/maildrop/mlist"
+SLIST="/var/mail/maildrop/slist"
 
 SUFFIX=0
 
@@ -75,7 +75,7 @@ if ($HANDLE)
       # No response to unregistered users
       exit
    }
-   #cc "|$REPLYMAIL"
+   #cc "|$DEBUGMAIL"
    EXITCODE=$UNHANDLED
    # No response to unregistered users
    exit

+ 3 - 0
postmaster.cmds

@@ -0,0 +1,3 @@
+./cropswap-postmaster.sh SIGNUP "Full Name" addr@example.com
+./cropswap-postmaster.sh SUBSCRIBE "Full Name" addr@example.com
+./cropswap-postmaster.sh UNSUBSCRIBE "Full Name" addr@example.com

+ 1 - 1
cropswap-subunsub.sh → subunsub.sh

@@ -5,5 +5,5 @@ if [ "${1}" == "UNSUBSCRIBE" ]; then
 else
 	d="+"
 fi
-printf "%c%s\n%c%s\n" "$d" "$2" "$d" "$3" >> "${SLIST}.txt"
+flock "${SLIST}.txt" printf "%c%s\n%c%s\n" "$d" "$2" "$d" "$3" >> "${SLIST}.txt"
 #TODO: mailbot - You have been successfully (un)subscribed