Qmail-LDAP plus DSPAM howto

2008-04-23 Thread Hugo Monteiro

Hello all,

I've finally took some time off to write about how to implement 
Qmail-LDAP and DSPAM.


First i'd like to apologise to those whom i promised an updated document 
some time ago. It's been longer than i'd initially though, and that i 
would like.


But sometimes things happen for a reason, and if i had done this howto 
back then i wouldn't be covering as much situations as i do now.


Enough with the talking and getting to the facts.

The howto covers three possible types of integration

using DSPAMs internal "LDA" engine
using maildrop to call DSPAM
using Simscan to call DSPAM and ClamAV (the anti-virus part is a bonus 
track ;))


, as well as two other types of spam retraining, not counting on the 
DSPAM builtin WebUI method.


retraining using Dovecot and dovecot-antispam plugin (IMAP)
retraining using message forwarding (POP3 & IMAP)

Although i'm feeling this is very close to the final version of the 
document, and since i'm only human, there might be one or two things 
that may need adjustment. I'm counting on you to point me out those 
situations.


As always, comments are welcomed.

The howto is available here

http://hmonteiro.net/howtos:qmail-ldap:qmail-ldap_plus_dspam

My best regards,

Hugo Monteiro.

--
ci.fct.unl.pt:~# cat .signature

Hugo Monteiro
Email: [EMAIL PROTECTED]
Telefone : +351 212948300 Ext.15307

Centro de Informática
Faculdade de Ciências e Tecnologia da
   Universidade Nova de Lisboa
Quinta da Torre   2829-516 Caparica   Portugal
Telefone: +351 212948596   Fax: +351 212948548
www.ci.fct.unl.pt [EMAIL PROTECTED]

ci.fct.unl.pt:~# _



Re: qmail-ldap and DSPAM

2007-06-26 Thread Sn!per
Quoting Hugo Monteiro <[EMAIL PROTECTED]>:

> Sn!per wrote:
> > Am thinking of using simscan-1.3.1 along with DSPAM for qmail-ldap. Has
> anyone been successful in implementing this combo? Please advise. TIA.
> >
> > --
> > roger
> >
> >
> >   
> 
> Yes Roger,
> 
> I will have a small compilation on how to set up qmail-ldap + simscan +
> DSPAM in the next couple of days.
> 
> True that i've promised to post this kind of setup earlier but
> unfortunately i've had very little time to write any documentation
> whatsoever. For that i apologize.
> 
> Please bear with the wait for a couple days more.
> 
> Regards,
> 
> Hugo Monteiro.
> 

Great ! TIA Hugo. 

--
roger


---
Sign Up for free Email at http://ureg.home.net.my/
---


Re: qmail-ldap + DSPAM 1st Draft

2007-06-26 Thread Hugo Monteiro
Hugo Monteiro wrote:
> This was made from the top of my head, but i hope it can be of help to
> someone.
>
> I'll be correcting this doc in the next days.
>
> Regards,
>
> Hugo Monteiro.
>
>   
Btw, my files are located at
http://pessoa.fct.unl.pt/hmmm/files/anti-spam/. The rest of the
mentioned patched are either available with the used software, or
through a quick google search. Sorry if i'm not handing out all the
information in a "silver platter", but my schedule is rather tight ATM.

Regards,

Hugo Monteiro.


-- 
ci.fct.unl.pt:~# cat .signature

Hugo Monteiro
Email: [EMAIL PROTECTED]
Telefone : +351 212948300 Ext.15307

Centro de Informática
Faculdade de Ciências e Tecnologia da
   Universidade Nova de Lisboa
Quinta da Torre   2829-516 Caparica   Portugal
Telefone: +351 212948596   Fax: +351 212948548
www.ci.fct.unl.pt [EMAIL PROTECTED]

ci.fct.unl.pt:~# _



qmail-ldap + DSPAM 1st Draft

2007-06-26 Thread Hugo Monteiro
This was made from the top of my head, but i hope it can be of help to
someone.

I'll be correcting this doc in the next days.

Regards,

Hugo Monteiro.

-- 
ci.fct.unl.pt:~# cat .signature

Hugo Monteiro
Email: [EMAIL PROTECTED]
Telefone : +351 212948300 Ext.15307

Centro de Informática
Faculdade de Ciências e Tecnologia da
   Universidade Nova de Lisboa
Quinta da Torre   2829-516 Caparica   Portugal
Telefone: +351 212948596   Fax: +351 212948548
www.ci.fct.unl.pt [EMAIL PROTECTED]

ci.fct.unl.pt:~# _

The information in this document was written primarily for personal use, but is 
made available under the terms of the GNU Free Documentation License in the 
possibility that it may be considered usefull to others, without any warranty 
whatsoever.
Basically, this has worked for me, it may work for you or not. I cannot be held 
responsible for any data loss, system crash, or false hopes of any kind. YOU 
HAVE BEEN WARNED!

This is a setup that has been working for some months now. I cannot say that it 
worked just fine from day one, but the problems so far have been due to under 
dimensioned hardware. I'll get to that during the text. The system is a bit 
more complex than what's stated here, but the essential part can be described 
as two frontend MX boxes and a backend server, where the users inboxes are 
stored.

Software used was:

Qmail-LDAP stuff was
qmail-1.03 (stock qmail)
qmail-ldap-1.03-20060201 patch (LDAP support)
qmail-ldap-queue-custom-error (provided with simscan?)
qmail-ldap-1.03-20060201-greetdelay-0.3 (Greetdelay support)
qmail-ldap-1.03-20060201-envelope-scan-0.5 (Greylisting and/or basic 
SMTPD ACL Policy support)

Simscan stuff was
simscan-1.3.1 (stock simscan from inter7)
    simscan-dspam-quarantine-v0.3.patch (patch to make DSPAM internal 
quarantine to work nice with simscan, plus some other things)

DSPAM stuff was
DSPAM-3.6.8 - Already have a test setup running 3.8.0, very similar 
setup, small patch difference.
dspam-3.6.8-external_lookup-0.8.1 patch (To allow mail address/mail 
alias matching, DSPAM profile creation enforcing and custom DSPAM username 
definition)


This all was set up in a Debian Sarge system, and using Debians DSPAM source 
package. Although i have not verified running a stock DSPAM with the patch 
myself, i can although state that the patch applies cleanly and the software 
compiles the same way as the package source. So if using stock DSPAM, with the 
available documentation, it should work.


The install - short and ugly


daemontools:

$ sudo apt-get install daemontools-installer
$ sudo build-daemontools
(just answer the questions - you know the drill - and in the end, daemontools 
should be running.)


ucspi-tcp, aka tcpserver:

$ apt-get install ucspi-tcp-src

(now you'll need two consoles, one to run the ucspi-tcp build and another to 
apply the patch)

#1 $ ls
ucspi-tcp-ssl-20050405.patch.gz

#2 $ sudo build-ucspi-tcp
(it will ask you for a build temp dir and after it will ask you to press enter 
to start the build. Don't press enter just now. Switch to console #1 to apply 
the patch)

#1 $ cd /tmp/ucspi-tcp/ucspi-tcp-0.88
#1 $ zcat /path/to/ucspi-tcp-ssl-20050405.patch.gz | patch -p0
(nevermind the last reject, since debian package already has the errno.h patch)

#2 $ (hit enter and follow the instructions. You should end up with an 
installed ucspi-tcp package)


Qmail:

$ ls
qmail-1.03.tar.gz 
qmail-ldap-1.03-20060201.patch.gz
qmail-ldap-1.03-20060201-envelope-scan-0.5.patch  
qmail-ldap-queue-custom-error.patch.bz2
qmail-ldap-1.03-20060201-greetdelay-0.3.patch

$ tar zxf qmail-1.03.tar.gz
$ zcat qmail-ldap-1.03-20060201.patch.gz | patch -p0
$ cd qmail-1.03
$ cat ../qmail-ldap-1.03-20060201-envelope-scan-0.5.patch | patch -p1
$ bzcat ../qmail-ldap-queue-custom-error.patch.bz2 | patch -p1
$ cat ../qmail-ldap-1.03-20060201-greetdelay-0.3.patch | patch -p1

(All the patches are fairly independant and there shouldn't be any problem 
applying them in any different order, with exception for the qmail-ldap patch, 
of course. That has to be the first one!)

Now, edit the Makefile, using the qmail-ldap docs available. The new stuff can 
be looked up in two readme files, README.ENVELOPE_SCAN and README.GREETDELAY.

$ sudo make setup check

(you should have qmail installed in /var/qmail right now)


Simscan:

$ ls
simscan-1.3.1.tar.gz  simscan-dspam-quarantine-v0.3.patch

$ tar zxf simscan-1.3.1.tar.gz
$ cd simscan-1.3.1
$ cat ../simscan-dspam-quarantine-v0.3.patch | patch -p1

(now build, check simscan options and documentation, these were my choices)
$ ./configure --enable-regex=y --enable-spam-passthru=y --enable-user=clamav 
--enable-custom-smtp-reject=y --enable-received=y 
--enable-ripmime=/usr/bin/ripmime --enable-dspam=y --enable-per-domain=y 
--enable-dspam-path=/usr/bin/dspam --ena

Re: qmail-ldap and DSPAM

2007-06-26 Thread Hugo Monteiro
Sn!per wrote:
> Am thinking of using simscan-1.3.1 along with DSPAM for qmail-ldap. Has 
> anyone been successful in implementing this combo? Please advise. TIA.
>
> --
> roger
>
>
>   

Yes Roger,

I will have a small compilation on how to set up qmail-ldap + simscan +
DSPAM in the next couple of days.

True that i've promised to post this kind of setup earlier but
unfortunately i've had very little time to write any documentation
whatsoever. For that i apologize.

Please bear with the wait for a couple days more.

Regards,

Hugo Monteiro.

-- 
ci.fct.unl.pt:~# cat .signature

Hugo Monteiro
Email: [EMAIL PROTECTED]
Telefone : +351 212948300 Ext.15307

Centro de Informática
Faculdade de Ciências e Tecnologia da
   Universidade Nova de Lisboa
Quinta da Torre   2829-516 Caparica   Portugal
Telefone: +351 212948596   Fax: +351 212948548
www.ci.fct.unl.pt [EMAIL PROTECTED]

ci.fct.unl.pt:~# _



qmail-ldap and DSPAM

2007-06-21 Thread Sn!per
Am thinking of using simscan-1.3.1 along with DSPAM for qmail-ldap. Has anyone 
been successful in implementing this combo? Please advise. TIA.

--
roger


---
Sign Up for free Email at http://ureg.home.net.my/
---


Re: [dspam-users] dspam for qmail-ldap

2007-01-25 Thread Sn!per
Quoting Hugo Monteiro <[EMAIL PROTECTED]>:

> The good news is that i have 
> several qmail-ldap installations working with the following components:
> 
> openldap
> qmail-ldap in true cluster mode and in a single machine
> dspam with virtual users and preferences extension + alias mapping 
> through a patch i wrote
> server side filtering with maildrop
> pop and imap access using dovecot, having imap working with dspam plugin 
> to provide drag and drop reclassification.
> 
> If you, and others, have a little patiente i'll be having an howto real 
> soon.
> 
> 
> Regards,
> 
> 
> Hugo Monteiro.

Dear Hugo,
Since there's no complete guide in the subject of qmail-ldap, dspam and 
simscan, I think it's worth the wait. I'll be patient...but don't take too long 
ok! hehe.

--
roger


---
Sign Up for free Email at http://ureg.home.net.my/
---


Re: [dspam-users] dspam for qmail-ldap

2007-01-25 Thread Hugo Monteiro

Sn!per wrote:

I would like to install dspam to be used for qmail-ldap environment. But am not 
too sure about the configure line that I should use. Please help.

--
roger


  


Hello Roger,

I'm in the process of a rather complicated migration, so my time 
relatively short for writing documentation. The good news is that i have 
several qmail-ldap installations working with the following components:


openldap
qmail-ldap in true cluster mode and in a single machine
dspam with virtual users and preferences extension + alias mapping 
through a patch i wrote

server side filtering with maildrop
pop and imap access using dovecot, having imap working with dspam plugin 
to provide drag and drop reclassification.


If you, and others, have a little patiente i'll be having an howto real 
soon.



Regards,


Hugo Monteiro.



--
ci.fct.unl.pt:~# cat .signature

Hugo Monteiro
Email: [EMAIL PROTECTED]
Telefone : +351 212948300 Ext.15307

Centro de Informática
Faculdade de Ciências e Tecnologia da
   Universidade Nova de Lisboa
Quinta da Torre   2829-516 Caparica   Portugal
Telefone: +351 212948596   Fax: +351 212948548
www.ci.fct.unl.pt [EMAIL PROTECTED]

ci.fct.unl.pt:~# _



Re: DSPAM

2006-06-30 Thread David Hawke




Nicolas de Bari Embriz Garcia Rojas wrote:
Hello, I am not using .qmail files, just a global procmail
(called using the deliveryprogram) conf and simscan calling
spamassasin, but would like to replace spamassasin and test dspam so
for now i am interested on a global conf that can be used.
  

As a quick response, you'd access it within the procmail environment
rather than simscan (which is upstream / part of the qmail delivery
chain.

Try googling for "dspam procmail" - there are a number of resources -
eg http://splodge.fluff.org/docs/dspam-for-sa-users

Essentially dpsam goes in the mail delivery chain.

David H


regards.
  
  
On Jun 30, 2006, at 1:42 AM, David Hawke wrote:
  
  
  Nicolas de Bari Embriz Garcia Rojas wrote:

Hello, some one has installed and
configured DSPAM with qmail-ldap?
  

I'd suspect that it is the same with qmail-ldap as it is with qmail -
you configure it downstream of qmail via the  .qmail file - link it
with maildrop to handle saving spam separately or use the dspam web
interface to handle the quarantined files.


It was quite quick and easy to implement - set up dspam and the spam
and notspam  mail addresses, then configure the .qmail and .mailfilter
files and away it goes.


After much hunting for how to do it, I was very pleased with

- how straightforward it is to implement

- how reliable it is - running 20% spam with 99%+ classification
accuracy.


You can also use it upstream of qmail by setting it as the default mx
host, then deliver the mail on to your qmail installation.


It doesn't seem to integrate with qmail-scanner.


David H


I would like to know how to install it and to get out the best of it.
  
  
  
Regards.
  
  
  
!DSPAM:501,44a4c2b7244766491211187!
      
    

  
  
  

!DSPAM:501,44a4cb09124351319314796!






Re: DSPAM

2006-06-29 Thread Nicolas de Bari Embriz Garcia Rojas
Hello, I am not using .qmail files, just a global procmail (called  
using the deliveryprogram) conf and simscan calling spamassasin, but  
would like to replace spamassasin and test dspam so for now i am  
interested on a global conf that can be used.


regards.

On Jun 30, 2006, at 1:42 AM, David Hawke wrote:


Nicolas de Bari Embriz Garcia Rojas wrote:

Hello, some one has installed and configured DSPAM with qmail-ldap?
I'd suspect that it is the same with qmail-ldap as it is with qmail  
- you configure it downstream of qmail via the  .qmail file - link  
it with maildrop to handle saving spam separately or use the dspam  
web interface to handle the quarantined files.


It was quite quick and easy to implement - set up dspam and the  
spam and notspam  mail addresses, then configure the .qmail  
and .mailfilter files and away it goes.


After much hunting for how to do it, I was very pleased with
- how straightforward it is to implement
- how reliable it is - running 20% spam with 99%+ classification  
accuracy.


You can also use it upstream of qmail by setting it as the default  
mx host, then deliver the mail on to your qmail installation.


It doesn't seem to integrate with qmail-scanner.

David H


I would like to know how to install it and to get out the best of it.


Regards.


!DSPAM:501,44a4c2b7244766491211187!






PGP.sig
Description: This is a digitally signed message part


Re: DSPAM

2006-06-29 Thread David Hawke




Nicolas de Bari Embriz Garcia Rojas wrote:
Hello, some one has installed and configured DSPAM with
qmail-ldap?
  

I'd suspect that it is the same with qmail-ldap as it is with qmail -
you configure it downstream of qmail via the  .qmail file - link it
with maildrop to handle saving spam separately or use the dspam web
interface to handle the quarantined files.

It was quite quick and easy to implement - set up dspam and the spam
and notspam  mail addresses, then configure the .qmail and .mailfilter
files and away it goes.

After much hunting for how to do it, I was very pleased with
- how straightforward it is to implement
- how reliable it is - running 20% spam with 99%+ classification
accuracy.

You can also use it upstream of qmail by setting it as the default mx
host, then deliver the mail on to your qmail installation.

It doesn't seem to integrate with qmail-scanner.

David H

I would like to know how to install it and to get out the best of it.
  
  
  
Regards.
  
  
  

!DSPAM:501,44a4c2b7244766491211187!






DSPAM

2006-06-29 Thread Nicolas de Bari Embriz Garcia Rojas

Hello, some one has installed and configured DSPAM with qmail-ldap?

I would like to know how to install it and to get out the best of it.


Regards.



PGP.sig
Description: This is a digitally signed message part


Re: dspam + qmail-ldap

2006-03-17 Thread Christian Willy Asmussen - Young Padawan

Oskar Eyb wrote:

Christian Willy Asmussen - Young Padawan wrote:

Hi!

  

Any other information you need, drop me an e-mail.



It would be nice if you can describe your setup detailed.
  

Hei Oskar!
Well, I use ldap to define the delivery program (ie: 
deliveryProgramPath) on objectClass: qmailUser.


So basically, what I did was patch dspam (ie: src/dspam.c) to get the 
user from the environment and pretend it received ---user. The delivery 
program configured for dspam is maildrop. When dspam classifies a 
message as "spam" it uses qmail-inject and sends that message to a (per 
domain) quarentine mailbox.


This is a very brief explanation... Actually, this was something that 
was made sort of like an emergency, very quick an poorly documented. I 
implemented it, but I still don't know exactly how it works :-)


I am working on this project during the next few month, and then I will 
probably document it a little more.


[s]
Krico


Re: dspam + qmail-ldap

2006-03-13 Thread Marc Huot

On December 22nd, Christian Willy Asmussen wrote:
I am trying out the dspam package, and it works quite well as a 
"deliveryProgramPath".  Any one want to share any experience with this?


On December 29th, Christian Willy Asmussen followed up with:
Ueda, we are using dspam now with about 5000 users. We had to hack it 
a bit to use qmail-inject to send messages to a quarantine mailbox. It 
is very good, especially when you use a "global" list so that there is 
spam filtering out of the box.


Performance-wise it is very good, but you must plan to have a 
"dedicated" mysql server (if using this as a backend).


Any other information you need, drop me an e-mail.


On March 9th, Oskar Eyb wrote:

I ve at one server(1) dspam since about a year running.
Now I'd like setup another server with dspam, qmail-ldap and maildrop.

On server(1) I use:

-LDAP: deliveryMode localdelivery
-dot-qmail:

|/usr/local/bin/maildrop -A "X-Info: DSPAM scanned" .mailfilter ./Maildir

-a big .mailfilter file in the user's Maildir
-periodic via crontab called script named "scan-dspam-maildirs"
   ( # Lee R. Copp : 2004-06-18 )
These scripts I've found on the web, I guess it was from 
funkypenguin.co.za/


This works fine, expect the following error in qmail log:

delivery 1470: success: 
(standard_in)_1:_illegal_character:_N/(standard_in)_2:_syntax_error/did_0+0+1/


Is there any better way out of using DSPAM with qmail-ldap? Id like to 
configure in the ldap directory if the user's mail should scanned with 
DSPAM or not.


It would be nice if you can describe your setup detailed.
I'd also like to ask around again to find out what the current thoughts 
are on best-practices for involving dspam (and to a lesser extent, 
clamav) within a qmail-ldap environment. simscan has been raised as a 
choice on a number of occasions, but there's no built-in dspam support, 
and the two simscan patches out there don't appear to be particularly 
geared toward this setup.


-- http://www.top-consulting.net/qmailmods.php (focused on integration 
with vpopmail)

--
http://wiki.debian-made.de/space/snipsnap-index/DSPAM/Qmail+Simscan+Dspam

Like Oskar, I'm hoping to involve LDAP in the process of finding out 
who's opted-in for spam protection, and that the "best" way to do this 
would be to invoke maildrop (or procmail) from the "deliveryProgramPath" 
attribute. The script Oskar mentioned at funkypenguin.co.za to use the 
dspam "quarantine" method can be found below. Does it work? Has anybody 
needed to change/update it at all?


-- http://www.funkypenguin.co.za/filestore2/download/15/maildroprc.dspam

Ideally, *all* inbound messages should run through clamdscan through 
qscanq, and the presence of a deliveryProgramPath attribute will send it 
to dspam *after* qscanq. Any suggestions on how to make this happen? I'm 
preparing to put together a very full-featured article for the 
qmail-ldap wiki on how to tie this all together, all the bases are 
covered except this spam setup. Any help would be greatly appreciated.


Thanks in advance,

Marc


Re: dspam + qmail-ldap

2006-03-08 Thread Oskar Eyb
Christian Willy Asmussen - Young Padawan wrote:

Hi!

> Any other information you need, drop me an e-mail.


I ve at one server(1) dspam since about a year running.
Now I'd like setup another server with dspam, qmail-ldap and maildrop.

On server(1) I use:

-> LDAP: deliveryMode localdelivery
-> dot-qmail:

|/usr/local/bin/maildrop -A "X-Info: DSPAM scanned" .mailfilter ./Maildir


-> a big .mailfilter file in the user's Maildir
-> periodic via crontab called script named "scan-dspam-maildirs"
   ( # Lee R. Copp : 2004-06-18 )

These scripts I've found on the web, I guess it was from funkypenguin.co.za/

This works fine, expect the following error in qmail log:

 delivery 1470: success:
(standard_in)_1:_illegal_character:_N/(standard_in)_2:_syntax_error/did_0+0+1/



Is there any better way out of using DSPAM with qmail-ldap?
Id like to configure in the ldap directory if the user's mail should
scanned with DSPAM or not.

It would be nice if you can describe your setup detailed.


Cheers
Oskar



Re: dspam + qmail-ldap

2005-12-29 Thread Christian Willy Asmussen - Young Padawan

UEDA Hiroyuki wrote:


Dear all,


 

I am trying out the dspam package, and it works quite well as a 
"deliveryProgramPath".  Any one want to share any experience with this?
   



Yes, of course :)

I have thought use of dspam for a long time, so I would like to be
taught about this topic.
 

Ueda, we are using dspam now with about 5000 users. We had to hack it a 
bit to use qmail-inject to send messagesto a quarantine mailbox. It is 
very good, especially when you use a "global" list so that there is spam 
filtering out of the box.


Performance-wise it is very good, but you must plan to have a 
"dedicated" mysql server (if using this as a backend).


Any other information you need, drop me an e-mail.


Re: dspam + qmail-ldap

2005-12-23 Thread UEDA Hiroyuki
Dear all,


> I am trying out the dspam package, and it works quite well as a 
> "deliveryProgramPath".  Any one want to share any experience with this?

Yes, of course :)

I have thought use of dspam for a long time, so I would like to be
taught about this topic.


-
UEDA Hiroyuki <[EMAIL PROTECTED]>



dspam + qmail-ldap

2005-12-22 Thread Christian Willy Asmussen - Young Padawan
I am trying out the dspam package, and it works quite well as a 
"deliveryProgramPath".  Any one want to share any experience with this?


[s]
Krico


DSpam and qmail-ldap

2004-04-02 Thread Rajkumar S
Hello,

I am thinkig of using DSPam along with qmail-ldap as the anti spam 
solution for my mail server. DSpam says that


he DSPAM agent masquerades as the email server's local delivery agent 
providing filtering at the server level.


Now, I suppose qmail-local is qmail-ldap's local delivery agent? Any one 
tried replacing it with DSpam? My wish is to put DSpam in the qmail-ldap 
path so that all mails tagged as spam goes to Junk folder (like Yahoo!) 
and others are delivered normally.

raj