Yahoo Groups archive

Milter-greylist

Index last updated: 2026-04-28 23:32 UTC

Thread

milter-greylist and p0f - integration with Solaris

milter-greylist and p0f - integration with Solaris

2014-02-09 by Jim Klimov

Hello all,

   FYI: for milter-greylist users who (want to) use p0f fingerprinting
and run under a Solaris-based OS.

   Over the past year I've applied assorted changes to p0f-3.06b in
order to enable its builds on Solaris 10 and OpenIndiana, as well as
integration with Solaris Service Management Framework (for further
integration with our relays' milter-greylist based antispam solution).
I've also hit a bug with the API connections not being closed after
the p0f-client disconnection, causing the failure of the p0f daemon
and/or its clients (milter-greylist) upon exhaustion of some resource.

   My research and discussion of these problems has been tracked on
the milter-greylist mailing list, and some of the patches were also
posted here... partially due to my laziness ;)

   I've unsuccesfully tried to post the changes to the original project 
author, but got no replies to any posts during the last year), and
ultimately decided to publish my fixes in an orderly bunch by forking
the repository which I've found at GitHub: https://github.com/p0f/p0f.
So the Solaris users who want p0f-3.06b can use my fork for now:
   https://github.com/jimklimov/p0f

   Still, I'd love to see this upstreamed someday, so that the vanilla
p0f (say, 3.06c?) can just work under Solaris :)

Thanks,
//Jim Klimov

Re: [milter-greylist] milter-greylist and p0f - integration with Solaris

2014-02-10 by Jim Klimov

On 2014-02-09 18:24, Jim Klimov wrote:
> Hello all,
>
> FYI: for milter-greylist users who (want to) use p0f fingerprinting
> and run under a Solaris-based OS.

Also some fixes/improvements were desired on the milter-greylist side.

I attached here the following:
* in the debug logs, don't just state the p0f query results, but do
   also report the IP address they pertain to - helps debugging a lot ;)
* try to reconnect to p0f once if "write failed" or "read failed",
   instead of bailing out immediately so that no p0f processing is done
   for this connection (i.e. if p0f daemon restarted)
* if the remote host is missing in the p0f cache, do a few retries,
   perhaps its packets will soon be processed by the daemon and show up.
   NOTE that this blocks milter-greylist until the loop completes
   and in case of at least Sendmail, this delays even the display
   of the SMTP banner.
* the clumsy part I need help with: configuration of the delay and
   count for the retry loop above. For some reason, my build refused to
   process the p0f_miss_retry_count and p0f_miss_retry_delay variables
   in the config file :( Possibly a late-night silly typo somewhere?

Thanks,
//Jim Klimov

Re: [milter-greylist] milter-greylist and p0f - integration with Solaris

2014-02-10 by Jim Klimov

On 2014-02-09 18:24, Jim Klimov wrote:
> FYI: for milter-greylist users who (want to) use p0f fingerprinting

I also found that if p0fsock is enabled, the filter is called - even
if there are no p0f ACLs requiring that. Moreover, this filter is
called at the beginning of connection-processing by milter-greylist
instead of the position where it is referenced by config file.

Can anything be done about this (to ensure orderly processing of
rules)?

Thanks,
//Jim Klimov

Re: [milter-greylist] milter-greylist and p0f - integration with Solaris [1 Attachment]

2014-02-10 by manu@...

Jim Klimov <jimklimov@...> wrote:

> * if the remote host is missing in the p0f cache, do a few retries,<br>
>    perhaps its packets will soon be processed by the daemon and show up.<br>
>    NOTE that this blocks milter-greylist until the loop completes<br>
>    and in case of at least Sendmail, this delays even the display<br>
>    of the SMTP banner.<br>

I understand that sleep(3) will put the whole process to sleep, which
makes the milter unable to process other requests from sendmail.
sched_yield(3) seems to be the right way. Could you investigate?

-- 
Emmanuel Dreyfus
http://hcpnet.free.fr/pubz
manu@...

Re: [milter-greylist] milter-greylist and p0f - integration with Solaris

2014-02-10 by Jim Klimov

On 2014-02-10 06:12, manu@... wrote:
> Jim Klimov <jimklimov@...> wrote:
>
>  > * if the remote host is missing in the p0f cache, do a few retries,<br>
>  > perhaps its packets will soon be processed by the daemon and show up.<br>
>  > NOTE that this blocks milter-greylist until the loop completes<br>
>  > and in case of at least Sendmail, this delays even the display<br>
>  > of the SMTP banner.<br>
>
> I understand that sleep(3) will put the whole process to sleep, which
> makes the milter unable to process other requests from sendmail.
> sched_yield(3) seems to be the right way. Could you investigate?

Hmmm, thanks

I'll take a look (hopefully tonight)

Re: [milter-greylist] milter-greylist and p0f - integration with Solaris

2014-02-10 by jimklimov@cos.ru

--Boundary_(ID_z4F1RdDzhgNp1chwB0jsCg)
Content-type: text/plain; charset=utf-8
Content-transfer-encoding: base64

V2VsbCwgYWNjb3JkaW5nIHRvIG1hbnBhZ2V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NwbmV0LmZyZWUuZnIvcHViejxicj4KbWFudUBuZXRic2Qub3JnPGJy
Pgo8L3A+CgogICAgPC9kaXY+CiAgICAgCgogICAgCgoKCgoKPCEtLSBlbmQgZ3JvdXAgZW1haWwg
LS0+Cgo8L2JvZHk+


--Boundary_(ID_z4F1RdDzhgNp1chwB0jsCg)--

RE: [milter-greylist] milter-greylist and p0f - integration with Solaris

2014-02-10 by Bruncsak, Attila

> I understand that sleep(3) will put the whole process to sleep, which
> makes the milter unable to process other requests from sendmail.
> sched_yield(3) seems to be the right way. Could you investigate?
> 

At least on Tru64 this is in the man page of sleep (3):

  In a multi-threaded environment, the sleep() function is redefined so that
  only the calling thread is suspended.

Best,
Attila

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.