OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
help with master.cf and filter

From: Alan Fullmer (lists-alanxnote.com)
Date: Tue Sep 16 2003 - 18:25:20 CDT


I have a question, and forgive me if this has been posted already.

I scoured through the docs and coulnd't really find the info I needed.

I am trying to pass a variable through to a shell. (i've been told to use a forward file, and use procmailrc file. but I am also using mysql for my user base... so they aren't actual unix users.)

FROM master.cf:
spamfilter unix - n n - - pipe
  flags=Rq user=spamfilter argv=/usr/local/bin/spamfilter.sh -f ${sender} -- ${recipient}

FROM spamfilter.sh:
#!/bin/bash
/usr/local/bin/spamc -u <want username variable here> | /usr/sbin/sendmail -i "$"
exit $?

i am trying to call the spamc with the username of which the mail was addressed to. Like I said, i've been told to use procmail. But I can't get procmail to work with the .procmairc file because they are virtual users.

I tried $1, and all sorts of variable syntaxes, and none seemed to work.

Can anyone help please?

Thanks.