l i n u x - u s e r s - g r o u p - o f - d a v i s
L U G O D
 
Next Meeting:
August 5: Social gathering
Next Installfest:
TBD
Latest News:
Jul. 4: July, August and September: Security, Photography and Programming for Kids
Page last updated:
2004 Jun 07 02:32

The following is an archive of a post made to our 'vox-tech mailing list' by one of its subscribers.

Report this post as spam:

(Enter your email address)
Re: [vox-tech] spamassassin + procmail
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [vox-tech] spamassassin + procmail



Milver S. Nisay said:
> hi guys,
> i am trying to call a shell script before SENDMAIL will deliver a mail
> message,
> can it be done using procmail ? if so, any hints?
> can anyone advise me on this. thanks in advance.
> //milver
>

This may be of some help. Here is a generic Template with some basic vars
as used in a .procmailrc to get you started:

(You can see several examples of prgrams being called from the script and
you should be able to find a way to work one of these into call a prgram
at a specific time in processing of a message.)

(If you find you have problems, you can always create a "wrapper" script
which includes a "cat" and a subsection which does other things. Then when
you pipe things through this script, it spits out what it gets, *and* does
your extra "sub commands" when it is called. (one of those interesting
tricks I have used.)

----------------cut after this line --------------
#Set on when debugging settings
VERBOSE=off
#How to "run" things we call:
SHELL=/bin/bash
#Path for Shell:
PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin
#Dynamic username loading:
USER=`whoami`

#If you use "MailDir" format, make sure the path to the mail
# storgae ends with a "/"
#If you are using mbox, then make sure it sends without a "/"

#Your mail directory
MAILDIR=/home/${USER}/Maildir
#MAILDIR=Maildir/
# optional:
DEFAULT=${MAILDIR}/
#recommended:
LOGFILE=$MAILDIR/LOG

# Include user-specific files:
#INCLUDERC=/var/whatever/${USER}-spamrc

# I have an alias for abuse reports of spam to me:
# If "to" a user, put in one folder:
:0 H
* ^To:.*spam@passwall.com
.aSysSpam/

# Many ways to do this:
# If message size is less than 356kB, then call pipe message through
#  program: (SpamAssassin has a feature for this too)
:0fw
* < 256000
|/usr/local/bin/spamc -f

# If marked as sam, put in spam maildir:
:0 H
* ^X-Spam-Status: Yes
.SPAM/

# Work around procmail bug: any output on stderr will cause the "F" in "From"
# to be dropped.  This will re-add it.
:0 H
* ! ^From[ ]
* ^rom[ ]
{
  LOG="*** Dropped F off From_ header! Fixing up. "

  :0 fhw
  | sed -e 's/^rom /From /'
}

#Our default catch-all:

:0
${MAILDIR}/
--------------------cut above here-----------------

HTH,
-ME

_______________________________________________
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech



LinkedIn
LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
facebook
LUGOD Group on Facebook
'Like' LUGOD on Facebook:

Hosting provided by:
Sunset Systems
Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development.

LUGOD: Linux Users' Group of Davis
PO Box 2082, Davis, CA 95617
Contact Us

LUGOD is a 501(c)7 non-profit organization
based in Davis, California
and serving the Sacramento area.
"Linux" is a trademark of Linus Torvalds.

Sponsored in part by:
Appahost Applications
For a significant contribution towards our projector, and a generous donation to allow us to continue meeting at the Davis Library.