Add Abax post.
[blog.git] / posts / Abax / pbs_queues / file / qcleanmail.proc
diff --git a/posts/Abax/pbs_queues/file/qcleanmail.proc b/posts/Abax/pbs_queues/file/qcleanmail.proc
new file mode 100644 (file)
index 0000000..645f2e9
--- /dev/null
@@ -0,0 +1,27 @@
+# qcleanmail.proc
+#
+# remove mail from PBS queue administrator from your system mailbox
+#
+# see man procmail, procmailrc, and procmailex
+# there is also a good procmail tutorial at
+# http://userpages.umbc.edu/~ian/procmail.html
+#
+# procmail uses sed-like regexps
+
+MAILDIR=$HOME/.mailspool   #$MAIL
+LOGFILE=$MAILDIR/mailfilter/qcleanmail.log
+SHELL=/bin/bash
+HOST=`hostname -f`
+PBS_ADM=adm@abax[.]physics[.]drexel[.]edu
+
+# trash anything from satifying ALL of 
+# From adm@abax.physics.drexel.edu,
+# Envelope-to: $USER@$HOST
+# To: $USER@$HOST
+# Subject: PBS JOB [0-9]*.$HOST
+# lock the mail file while the processing is being carried out
+:0:                                     # the last colon means use a lockfile
+* ^From $PBS_ADM
+* ^To: $USER@$HOST
+* ^Subject: PBS JOB [0-9]*$HOST
+/dev/null                               # write matching messages to /dev/null