فهرست منبع

fix subscriptions from external address

Pi 1 سال پیش
والد
کامیت
b87266f665
1فایلهای تغییر یافته به همراه18 افزوده شده و 11 حذف شده
  1. 18 11
      filters/postmaster@localhost

+ 18 - 11
filters/postmaster@localhost

@@ -1,27 +1,34 @@
 SIGNUPRESP="/opt/cropswap/signup.eml"
 POSTMASTERREGEX=escape($POSTMASTER)
 ANYGROUPREGEX="$MEMBERGROUPREGEX|$ORGANIZERGROUPREGEX"
-foreach (tolower $ADDR) =~ /^$POSTMASTERREGEX$/
+foreach (tolower $ADDR) =~ /^$POSTMASTERREGEX|$ANYGROUPREGEX$/
 {
-   if (/^X\-GROUP:\s*($ANYGROUPREGEX)\s*$/)
+   if ($MATCH =~ /^$ANYGROUPREGEX$/)
+   {
+      MAILGROUP=$MATCH
+   }
+   elsif (/^X\-GROUP:\s*($ANYGROUPREGEX)\s*$/)
    {
       MAILGROUP=$MATCH1
+   }
+   if ($MAILGROUP ne "")
+   {
+      TOORGANIZER=($TOORGANIZER || ($MAILGROUP eq $ORGANIZERGROUP))
+      TOMEMBER=($TOMEMBER || ($MAILGROUP eq $MEMBERGROUP))
+      if (/^Subject:\s*\[(SUBSCRIBE|UNSUBSCRIBE)\]\s*$/)
+      {
+         SUBSCRIBE=$MATCH1
+         CONTINUE=1
+      }
       if (/^Subject:\s*\[SIGNUP\]\s*$/)
       {
+         TOPOSTMASTER=1
          if (/^X\-GROUP\-ALIAS:\s*(.*)\s*$/)
          {
             MAILGROUPALIAS=$MATCH1
+            CONTINUE=1
          }
-         TOPOSTMASTER=1
-         CONTINUE=1
       }
-      elsif (/^Subject:\s*\[(SUBSCRIBE|UNSUBSCRIBE)\]\s*$/)
-      {
-         SUBSCRIBE=$MATCH1
-      }
-      TOORGANIZER=($TOORGANIZER || ($MAILGROUP eq $ORGANIZERGROUP))
-      TOMEMBER=($TOMEMBER || ($MAILGROUP eq $MEMBERGROUP))
-      CONTINUE=1
    }
 }
 if ($FORWARD)