##### lm_hubspot.rc # # Resource file for procmail. # Filters list messages from lists handled by hubspot.com. # # Note: hubspot is basically braindead, there are no strings useful for # indicating any mailing list name. # The only option is any string in Subject: in LISTNAME. # # Variables, in (set before calling): # LISTNAME List name (e.g. between [...] in Subject:). # LISTEMAIL Address of list (leave out part after @ and any generic # parts like -return); defaults to LISTNAME. # LISTSERVERDOMAIN Domain of the list server handling this list # (the part after @). # LISTFOLDER Where to store email if it's from this list; # nothing will be stored if this is empty. # LISTFOLDER_UMASK If set, umask to use when saving to LISTFOLDER. # PROCDIR Directory where the procmail resource files are stored. # These may be unused by some of the listserver handlers (lm_*.rc): # LISTTO Your address to which list emails are sent. # Variables, returned: # ISTHISLIST Set to "1" if email is from this list, unset otherwise. # LISTEMAIL Unset. # # Run with e.g.: # LISTNAME="Weather Discussion" # LISTEMAIL="weatherdisc" # LISTSERVERDOMAIN="weather.net" # LISTFOLDER=somepath/weather-List # INCLUDERC=yourpath/lm_hubspot.rc # in your $HOME/.procmailrc (you can leave out LISTEMAIL if it's the same as # LISTNAME). # # The latest version is always available from: # http://volker.top.geek.nz/soft/procmail/ # # Copyright (C) by Volker Kuhlmann # http://volker.top.geek.nz/contact.html # Released under the terms of the GNU General Public License (GPL) Version 2. # See http://www.gnu.org/ for details. # # Volker Kuhlmann # 27 Mar 2020 Created from lm_template.rc. # 29 Mar 2020 Remove email header crud at end! # Comment out LSERVERDOM__. List admin emails still undetected. # ## LISTEMAIL defaults to LISTNAME :0 * LISTEMAIL ?? ^^^^ { LISTEMAIL=$LISTNAME } ## Set ISTHISLIST if match occurs ISTHISLIST= #LSERVERDOM__="(yahoogroups|egroups|onelist).com" ## Admin (subscribe/unsubscribe) email: #:0 #* $ ^From (confirm|notify)-.*@$LSERVERDOM__ #* $ ^From: .*@$LSERVERDOM__ #* $ ^Subject: .*($LISTEMAIL|$LISTNAME) #{ ISTHISLIST=1 } ## List email: :0 * $ ^X-Report-Abuse-To: abuse@hubspot\.com . * $ ^Return-Path:.*@[a-z0-9_-]*.hubspotemail\.net> * $ ^DKIM-Signature:.*=[a-z0-9_-]*\.hubspotemail\.net; * $ ^DKIM-Signature:.*=@?$LISTSERVERDOMAIN; * $ ^List-Unsubscribe:.*@[a-z0-9_-]*\.hubspotemail\.net\? * $ ^From|Reply-To:[^@]*@$LISTSERVERDOMAIN> * $ ^Subject:.*$LISTNAME { ISTHISLIST=1 } ## If match occurred and LISTFOLDER is set, save to LISTFOLDER :0 * ISTHISLIST ?? ^^1^^ * ! LISTFOLDER ?? ^^^^ { :0 * ! LISTFOLDER_UMASK ?? ^^^^ { UMASK=$LISTFOLDER_UMASK } :0 : $LISTFOLDER } LISTEMAIL= #LSERVERDOM__= ##### EOF lm_hubspot.rc