[horde] Report Spam to other machine - SOLVED

Andreas Mauser andreas at mauser.info
Mon Apr 21 10:03:59 UTC 2014


To summarize for others to understand and easy configure spamc  
reporting to remote host.


spamd run on the mailserver, with amavisd, postfix, and such. Open  
your firewall on port tcp/783.
spamd on the mailserver must be configured to allow access not only  
for localhost (-i) and which IP's are able to access (-A)

spamc is called from the webserver, where no amavis and such is needed.
spamc you can test on command line with: spamc -d mailserver <  
/usr/share/doc/spamassassin/sample-spam.txt
Now on the mailserver you can see that it does the reporting.

The array config in backends.local.php is:

     'spam' => array(
          'innocent' => array(
              'display' => true,
         //     // Program reporting driver
              'program' => '/usr/bin/spamc -C revoke -u %l -d mailserver',
          ),
          'spam' => array(
              'display' => true,
         //     // Program reporting driver
              'program' => '/usr/bin/spamc -C report -u %l -d mailserver',
          ),
     ),

Thank you for your help. All set now.
Andreas



----- Nachricht von Andreas Mauser <andreas at mauser.info> ---------
   Datum: Mon, 21 Apr 2014 08:47:46 +0000
     Von: Andreas Mauser <andreas at mauser.info>
Betreff: Re: [horde] Report Spam to other machine
      An: horde at lists.horde.org


> ----- Nachricht von Arjen de Korte <arjen+horde at de-korte.org> ---------
>   Datum: Mon, 21 Apr 2014 10:06:55 +0200
>     Von: Arjen de Korte <arjen+horde at de-korte.org>
> Betreff: Re: [horde] Report Spam to other machine
>      An: horde at lists.horde.org
>
>
>> Citeren Andreas Mauser <andreas at mauser.info>:
>>
>>> ----- Nachricht von Patrick Boutilier <boutilpj at ednet.ns.ca> ---------
>>> Datum: Sun, 20 Apr 2014 23:10:52 -0300
>>>   Von: Patrick Boutilier <boutilpj at ednet.ns.ca>
>>> Betreff: Re: [horde] Report Spam to other machine
>>>    An: horde at lists.horde.org
>>>
>>>
>>>> On 04/20/2014 10:53 PM, Andreas Mauser wrote:
>>>>>
>>>>> Hello,
>>>>>
>>>>> recently I removed Horde from my mailserver and put it on another, newer
>>>>> server. It is a clean new installation and works. I struggled a bit
>>>>> getting the 'Report Spam' Buttons back, but now they are back again.
>>>>>
>>>>> I assume that does not automatically mean that the reporting works?
>>>>>
>>>>> Setup:
>>>>> Server1 - Web only:  Horde, Postfix, Amavisd
>>>>> Server2 - Mail only: Postfix, Amavisd, Dovecot
>>>>>
>>>>> DO I need amavisd and postfix on Server 1?
>>>>>
>>>>> My imp/config/backends.local.php looks like this:
>>>>>
>>>>> <?php
>>>>> $servers['advanced'] = array(
>>>>>  // Disabled by default
>>>>>  'disabled' => false,
>>>>>  'name' => 'Advanced IMAP Server',
>>>>>  'hostspec' => '10.30.24.17',
>>>>>  'hordeauth' => false,
>>>>>  'protocol' => 'imap',
>>>>>  'port' => 143,
>>>>>  'secure' => 'tls',
>>>>>  'maildomain' => 'mauser.info',
>>>>>  'smtp' => array(
>>>>>  //    'auth' => true,
>>>>>  //    'debug' => false,
>>>>>  //    'horde_auth' => false,
>>>>>  //    'host' => 'smtp.example.com',
>>>>>  //    'localhost' => 'localhost',
>>>>>  //    'password' => null,
>>>>>  //    /* Mail from a MUA SHOULD be sent via the mail submission
>>>>> port (587)
>>>>>  //     * rather than the MTA port (25). Note that mail submission
>>>>>  //     * REQUIRES some method of authentication (whether explicit
>>>>>  //     * user/password credentials or configuring the mail submission
>>>>>  //     * agent to automatically authenticate this host based on the
>>>>>  //     * network location). */
>>>>>  //    'port' => 587,
>>>>>  //    'username' => null
>>>>>  ),
>>>>>  'spam' => array(
>>>>>       'innocent' => array(
>>>>>           'display' => true,
>>>>>      //
>>>>>      //     // Email reporting driver
>>>>>      //     'email' => null,
>>>>>         //     'email_format' => 'digest',
>>>>>      //
>>>>>  //     // Null reporting driver
>>>>>      //     'null' => true,
>>>>>      //
>>>>>  //     // Program reporting driver
>>>>>           'program' => '/usr/bin/spamc -C revoke -u %l',
>>>>>       ),
>>>>>   'spam' => array(
>>>>>           'display' => true,
>>>>>      //
>>>>>  //     // Email reporting driver
>>>>>      //     'email' => null,
>>>>>      //     'email_format' => 'digest',
>>>>>      //
>>>>>  //     // Null reporting driver
>>>>>      //     'null' => true,
>>>>>      //
>>>>>  //     // Program reporting driver
>>>>>           'program' => '/usr/bin/spamc -C report -u %l',
>>>>>       ),
>>>>>  // // It is possible to directly define additional spam drivers.
>>>>>      // // The 'drivers' array should contain a list of driver objects
>>>>>      // // (these classes must implement the IMP_Spam_Base class).
>>>>>      // 'drivers' => array(
>>>>>      //     new IMP_Example_Spam_Driver()
>>>>>      // )
>>>>>  ),
>>>>>  'admin' => array(
>>>>>  //     'user' => 'cyrus',
>>>>>  //     'password' => 'cyrus_pass',
>>>>>  //     'userhierarchy' => 'user.'
>>>>>  ),
>>>>>  'acl' => true,
>>>>>  'cache' => false,
>>>>>  // 'debug' => '/tmp/imp_imap.log',
>>>>>  // 'debug_raw' => false,
>>>>>  'quota' => array(
>>>>>      'driver' => 'imap',
>>>>>      'params' => array(
>>>>>          'hide_when_unlimited' => true,
>>>>>          'unit' => 'MB'
>>>>>      )
>>>>>  ),
>>>>>  'special_mboxes' => array(
>>>>>  //     IMP_Mailbox::MBOX_DRAFTS => 'Drafts',
>>>>>  //     IMP_Mailbox::MBOX_SENT => 'Sent',
>>>>>  //     IMP_Mailbox::MBOX_SPAM => 'Spam',
>>>>>  //     IMP_Mailbox::MBOX_TEMPLATES => 'Templates',
>>>>>  //     IMP_Mailbox::MBOX_TRASH => 'Trash',
>>>>>  //     IMP_Mailbox::MBOX_USERSPECIAL => array(
>>>>>  //         'Example' => _("Example Special Mailbox")
>>>>>  //     )
>>>>>  ),
>>>>>  'autocreate_special' => false,
>>>>> );
>>>>>
>>>>>
>>>>> Where does     //     // Program reporting driver
>>>>>           'program' => '/usr/bin/spamc -C report -u %l'
>>>>> sending the report to? Is it automatically the machine entered in the
>>>>> 'hostspec' field?
>>>>> Or do I have to tell the program an option to report to another IP?
>>>>
>>>>
>>>>
>>>> According to the spamc man page you would need something like  
>>>> /usr/bin/spamc -C report -u %l -d Server2
>>>
>>> Oh, thank you very much, I missed that part and now did as it  
>>> says. Still nothing in both servers logs.
>>>
>>>>
>>>> -d host[,host2], --dest=host[,host2]
>>>>         In TCP/IP mode, connect to spamd server on given host  
>>>> (default: localhost).  Several hosts can be specified if  
>>>> separated by commas.
>>>>
>>>>         If host resolves to multiple addresses, then spamc will  
>>>> fail-over to the other addresses, if the first one cannot be  
>>>> connected to.  It will
>>>>         first try all addresses of one host before it tries the  
>>>> next one in the list.  Note that this fail-over behaviour is  
>>>> incompatible with -x;
>>>>         if that switch is used, fail-over will not occur.
>>>>
>>>>
>>>
>>> So how does the Horde process really work?
>>>
>>> Someone selects a mail, then klick the SPAM button.
>>> Horde takes this mail and directly put it in SPAMC's hands, and  
>>> SPAMC will give it to the other servers amavisd?
>>
>> No, spamc connects to spamd, which is a daemonized version of  
>> spamassassin. I guess you didn't configure that or it is not  
>> configured to allow reporting (--allow-tell), which isn't enabled  
>> by default.
>
> spamd is configured and working/reporting on server2 (mailserver only)
>
> Does spamc on server1 report first to spamd on server1 or directly  
> to server 2?
> Could figure that out. Sorry its a lil off topic.
>
> Thank you,
> Andreas


----- Ende der Nachricht von Andreas Mauser <andreas at mauser.info> -----


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1832 bytes
Desc: S/MIME-Signatur
URL: <http://lists.horde.org/archives/horde/attachments/20140421/f05cb36c/attachment-0001.bin>


More information about the horde mailing list