On Mon, 2017-10-09 at 12:19 -0700, Imam Toufique wrote:
> I am using getmail, that's where I added a filter for SA. Can
> procmail be used to quarantine spams flagged by SA?
> 
You probably don't need procmail unless you want to provide
individualised spam handling for each mail recipient. Procmail is
designed to be run under a mail recipient's user each time a new
message is delivered to them. 

If you don't need this, you can do everything needed to reject spam
within getmail's 'MDA_external' mail delivery script. To use it, define
 getmail's  output in the [destination] section of the getmail
configuration file with: 

type = MDA_external
path = name of script
arguments = set to the script named in 'path'
allow_root_commands = true
ignore_stderr = true


My script is a pipeline that:
- calls spamc to examine the message and add X-Spam headers
- pipes the result into spamkiller, a locally written program that
  writes spam to a quarantine directory and calls sendmail to pass 
  ham to Postfix for delivery

spamkiller is a C program, but it could be written in any suitable
language. It quarantines spam by writing it as a suitably named file
in a quarantine directory. It delivers ham by calling sendmail with a
suitable parameter set so that it passes the mail to Postfix. If you
want to look at spamkiller or adapt it to suit yourself, its available
here: 

http://www.libelle-systems.com/free/

(spamkiller 1.3.4) as source plus documentation. Note that it needs my
environ library to compile. Source for that is in environ_srce-1.10.tgz 
and its documentation is in environ_docs-1.10.tgz or online, linked
from the same page.


Martin



  
> thanks.
> 
> On Mon, Oct 9, 2017 at 11:52 AM, Martin Gregorie <mar...@gregorie.org
> >
> wrote:
> 
> > On Mon, 2017-10-09 at 10:25 -0700, Imam Toufique wrote:
> > > But it is not deleting/discarding those mails.  I am
> > > not sure how to do that.  Can you please tell me how to do
> > > that?  I
> > > want all e-mails (in this example... ) from gmail.com to be
> > > deleted/discarded as
> > > soon as SA scans them.
> > > 
> > 
> > SA does not delete or discard any messages. All it does is add
> > headers
> > to the message with a YES/NO value in the X-Spam-Flag header and
> > details (including the actual score) in the X-SPAM-Status header.
> > The message is treated as ham if the score is less than the the
> > 'required_hits' parameter in local.cf (which defaults to 5.0) and
> > spam
> > if its equal or greater.
> > 
> > Also, it can optionally) alter the subject header to visually mark
> > spam.
> > 
> > You need something else downstream of SA that looks at the headers
> > and
> > discards or quarantines any messages marked as spam by SA. This
> > could
> > be third party code, like amavis, procmail and friends, or code
> > written
> > by yourself. If it is going to silently discard incoming spam then
> > its
> > your responsibility to put it in the mail delivery chain where it
> > can't
> > upset your MTA and/or trigger sending an unwanted rejection message
> > to
> > the sender when it discards a message.
> > 
> > For example, if your mail volume is very low you could retrieve
> > mail
> > from your domain's mailbox at your ISP with 'getmail', run it past
> > SA
> > to mark it as ham or spam and then through something that
> > quarantine
> > spam and passes ham to an internal MTA for delivery to recipients
> > on
> > your LAN.
> > 
> > 
> > Martin
> > 
> > 
> > 
> > > thanks.
> > > 
> > > On Mon, Oct 9, 2017 at 7:47 AM, RW <rwmailli...@googlemail.com>
> > > wrote:
> > > 
> > > > On Mon, 9 Oct 2017 00:49:33 -0700
> > > > Imam Toufique wrote:
> > > > 
> > > > > Hello everyone,
> > > > > 
> > > > > I am running SpamAssassin 3.4.0 in centOS 7, and I can't get
> > > > > blacklist_from to work.
> > > > 
> > > > ...
> > > > > an external option in getmail.  when I send mail from my
> > > > > gmail
> > > > > account, spamc does not honor the rule as setup with
> > > > > "blacklist_from
> > > > > *@gmai.com " .
> > > > > 
> > > > > I started spamd with the command below:
> > > > > /usr/bin/spamd --daemonize -D  --pidfile /var/run/spamd.pid
> > > > 
> > > > You didn't mention restarting spamd after adding the blacklist
> > > > entries.
> > > > 
> > > 
> > > 
> > > 
> 
> 
> 

Reply via email to