In that case, my suggestion is to download/install mailscanner or 
amavisd-new, and configure it to make use of spamassassin for you.  I 
personally use amavis to do virus scanning, and SA via procmail, but am 
planning on configuring amavis to call SA.

In any event, amavis (and mailscanner) acts as a content filter, which is 
what you're looking for, and can be configured to make use of SA, though I 
don't know if it uses the "spamassassin" excutable, or the spamd/spamc 
combination.

On Tue, 8 Oct 2002, Nicolai Strøm Gylling wrote:

> I guess I forgot to say that it's on a mail-relay, which is supposed to scan the 
>mail, and not deliver locally.
> 
> So what I basically need, is the way to apply a contentfilter in postfix, inject the 
>mail in spamd/spamc, and then reinject the mails in the postfix queue. 
> 
> Just like a virus-scanner works on a mail-gateway.
> 
> -----Original Message-----
> From: Mike Schrauder [mailto:[EMAIL PROTECTED]] 
> Sent: 7. oktober 2002 22:20
> To: Nicolai Strøm Gylling
> Cc: [EMAIL PROTECTED]
> Subject: RE: [SAtalk] Spamc/spamd setup with Postfix
> 
> 
> I have it working here, but I am not a linux person and can not speak to if this is 
>good/bad config.  I welcome any sugestions that might help nail down some issues.  
>Can anyone tell me why I get this in the mail.log file?
> spamd[2724]: Still running as root: user not specified, not found, or set to root.  
>Fall back to nobody. even though I have spamc -u filter in the filter.sh file?  Any 
>help or suggestions greatly appreciated.
> 
> I used this web page as a howto 
> http://advosys.ca/papers/postfix-filtering.html
> 
> I first used debian woody and got network and base postfix working.  I then 
>installed postfix w/ this config in main.cf file
> 
> command_directory = /usr/sbin
> daemon_directory = /usr/lib/postfix
> program_directory = /usr/lib/postfix
> 
> smtpd_banner = $myhostname NO UCE ESMTP $mail_name
> setgid_group = postdrop
> biff = no
> 
> # appending .domain is the MUA's job.
> append_dot_mydomain = no
> myhostname = sw.mydomain.com
> alias_maps = hash:/etc/aliases
> alias_database = hash:/etc/aliases
> myorigin = /etc/mailname
> mydestination = mydomain.com
> transport_maps = hash:/etc/postfix/transport
> 
> # relayhost =
> mynetworks = 192.168.0.0/24
> smtpd_recipient_restrictions = permit_mynetworks reject_unauth_destination 
>local_transport = error:local mail delivery  disabled on this machine # 
>mailbox_command = procmail -a "$EXTENSION" mailbox_size_limit = 0 recipient_delimiter 
>= + EOF
> 
> I want all mail forwarded to another mail server (internal) after SA looks at it, so 
>I used a transport file that looks like this: mydomain.com  
>smtp:internal.mydomain.com EOF
> 
> I set up the user accounts and groups per the howto above
> 
> after editing a transport file you have to run the command "postmap transport" to 
>rebuild the db file
> 
> I am not using procmail yet, and am using spamd/spamc instead of spamassassin, so I 
>doctored the filter.sh file from the advosys howto and it now looks like...
> 
> #!/bin/sh
> 
> INSPECT_DIR=/var/spool/filter
> SENDMAIL="/usr/sbin/sendmail -i" SPAMASSASSIN=/usr/bin/spamassassin
> 
> # Exit codes from <sysexits.h>
> EX_TEMPFAIL=75
> EX_UNAVAILABLE=69
> 
> cd $INSPECT_DIR || { echo $INSPECT_DIR does not exist; exit $EX_TEMPFAIL; }
> 
> # Clean up when done or when aborting.
> trap "rm -f in.$$; rm -f out.$$" 0 1 2 3 15
> 
> #cat | $SPAMASSASSIN -P -a > out.$$ || { echo Message content rejected; exit 
>$EX_UNAVAILABLE; } cat | /usr/bin/spamc -u filter > out.$$ || { echo Message content 
>rejected; exit $EX_UNAVAILABLE; }
> 
> 
> $SENDMAIL "$@" < out.$$
> 
> exit $?
> EOF
> 
> the postfix master.cf file looks like
> 
> smtp      inet  n       -       n       -       -       smtpd -o 
>content_filter=filter:
> pickup    fifo  n       -       -       60      1       pickup
> cleanup   unix  n       -       -       -       0       cleanup
> qmgr      fifo  n       -       -       300     1       qmgr
> rewrite   unix  -       -       -       -       -       trivial-rewrite
> bounce    unix  -       -       -       -       0       bounce
> defer     unix  -       -       -       -       0       bounce
> flush     unix  n       -       -       1000?   0       flush
> smtp      unix  -       -       -       -       -       smtp
> showq     unix  n       -       -       -       -       showq
> error     unix  -       -       -       -       -       error
> virtual   unix  -       n       n       -       -       virtual
> lmtp      unix  -       -       n       -       -       lmtp
> #
> # Interfaces to non-Postfix software. Be sure to examine the manual # pages of the 
>non-Postfix software to find out what options it wants. # The Cyrus deliver program 
>has changed incompatibly. #
> cyrus     unix  -       n       n       -       -       pipe
>   flags=R user=cyrus argv=/usr/sbin/cyrdeliver -e -m ${extension} ${user}
> uucp      unix  -       n       n       -       -       pipe
>   flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
> ifmail    unix  -       n       n       -       -       pipe
>   flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
> bsmtp     unix  -       n       n       -       -       pipe
>   flags=Fq. user=bsmtp argv=/usr/lib/bsmtp/bsmtp -d -t$nexthop -f$sender $recipient
> scalemail-backend unix  -       n       n       -       2       pipe
>   flags=R user=scalemail argv=/usr/lib/scalemail/bin/scalemail-store ${nexthop} 
>${user} ${extension}
> 
> # only used by postfix-tls
> #smtps    inet  n       -       n       -       -       smtpd -o 
>smtpd_tls_wrappermode=yes -o smtpd_sasl_auth_enable=yes#587      inet  n       -      
> n       -       -       smtpd -o smtpd_enforce_tls=yes -o smtpd_sasl_auth_enable=yes
> filter    unix  -  n  n  -  -   pipe user=filter 
>argv=/usr/local/bin/filtering/filter.sh -f ${sender} -- ${recipient}
> EOF
> 
> you can see in the filtering line the reference to filter.sh.  I tried making the 
>ownership for that file to user=filter then did postfix reload
> 
> I hope you can glean at least a little info from this mess.  The /var/log/mail.log 
>file shows a spam going throught the system.
> 
> 
> Oct  7 15:35:38 sw postfix/smtpd[2717]: connect from 
>flanders.ntelos.net[216.12.0.16] Oct  7 15:35:38 sw postfix/smtpd[2717]: 9969A999B1: 
>client=flanders.ntelos.net[216.12.0.16]
> Oct  7 15:35:38 sw postfix/cleanup[2718]: 9969A999B1: 
>message-id=<[EMAIL PROTECTED]>
> Oct  7 15:35:39 sw postfix/smtpd[2717]: disconnect from 
>flanders.ntelos.net[216.12.0.16] Oct  7 15:35:39 sw postfix/qmgr[269]: 9969A999B1: 
>from=<[EMAIL PROTECTED]>, size=6733, nrcpt=1 (queue active) Oct  7 
>15:35:39 sw spamd[161]: connection from localhost [ 127.0.0.1 ] at port 1401 Oct  7 
>15:35:39 sw spamd[2724]: Still running as root: user not specified, not found, or set 
>to root.  Fall back to nobody.
> Oct  7 15:35:40 sw spamd[2724]: identified spam (17.7/5.0) for (unknown):65534 in   
>1 seconds.
> Oct  7 15:35:40 sw postfix/pipe[2720]: 9969A999B1: to=<[EMAIL PROTECTED]>, 
>relay=filter, delay=2, status=sent (sw.mydomain.com) Oct  7 15:35:40 sw 
>postfix/pickup[2691]: 58F15999B3: uid=1002 from=<[EMAIL PROTECTED]>
> Oct  7 15:35:40 sw postfix/cleanup[2718]: 58F15999B3: 
>message-id=<[EMAIL PROTECTED]>
> Oct  7 15:35:40 sw postfix/qmgr[269]: 58F15999B3: 
>from=<[EMAIL PROTECTED]>, size=8096, nrcpt=1 (queue active) Oct  7 
>15:35:45 sw postfix/smtp[2729]: 58F15999B3: to=<[EMAIL PROTECTED]>, 
>relay=mail.mydomain.com[192.168.0.7], delay=5, status=sent (250 Message received: 
>[EMAIL PROTECTED]@sw.mydomain.com)
> 
> 
> Mike Schrauder
> 
> 
> 
> 
> > -----Original Message-----
> > From: Nicolai Strøm Gylling [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, October 07, 2002 11:21 AM
> > To: [EMAIL PROTECTED]
> > Subject: [SAtalk] Spamc/spamd setup with Postfix
> > 
> > 
> > Hi
> > 
> > I want to setup a Postfix-server with Spamassassin, but so
> > far I havn't had much luck, by reading the docs, this 
> > mailinglist(including archives) and searching the net.
> > 
> > Could anyone provide a working example configuration of
> > postfix and spamassassin (using spamc/spamd), or link to a 
> > howto on the subject?
> > 
> > Best regards
> > 
> > Nicolai Gylling
> > 
> > 
> > -------------------------------------------------------
> > This sf.net email is sponsored by:ThinkGeek
> > Welcome to geek heaven.
> > http://thinkgeek.com/sf 
> > _______________________________________________
> > Spamassassin-talk mailing list [EMAIL PROTECTED]
> > https://lists.sourceforge.net/lists/listinfo/spamassassin-talk
> > 
> 
> 
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> Spamassassin-talk mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/spamassassin-talk
> 



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Spamassassin-talk mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/spamassassin-talk

Reply via email to