[pfx] Re: read postscreen database?

2023-10-31 Thread Phil Biggs via Postfix-users
Wednesday, November 1, 2023, 4:38:13 AM, Michael W. Lucas via Postfix-users  
wrote:

> On Tue, Oct 31, 2023 at 12:56:23PM -0400, Wietse Venema via Postfix-users 
> wrote:
>> Michael W. Lucas via Postfix-users:
>> > Hi,
>> > 
>> > Is there a way to dump the postscreen database, showing which
>> > addresses are cached and why?
>> > 
>> > Running postfix 3.8 on FreeBSD.
>> 
>> postmap -s
>> 

> # ./postmap -s /var/db/postfix/postscreen_cache

> Still hung.

> Am I missing something obvious here?

> Thanks,
> ==ml

Problem was a missing 'btree:' file_type, as in:

# postmap -s btree:/var/db/postfix/postscreen_cache

  
-- 
Cheers,
Phil

___
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org


[pfx] Re: read postscreen database?

2023-10-31 Thread Jaroslaw Rafa via Postfix-users
Dnia 31.10.2023 o godz. 14:10:40 Wietse Venema via Postfix-users pisze:
> 
> Or copy the file with a dumb program, and use postmnap to dump that
> copy. Caution: the file contains holes and may grow when copied,
> as holes are filled in with nulls.

When GNU cp is used with --sparse=auto parameter, it should keep copies of
sparse files being sparse.
-- 
Regards,
   Jaroslaw Rafa
   r...@rafa.eu.org
--
"In a million years, when kids go to school, they're gonna know: once there
was a Hushpuppy, and she lived with her daddy in the Bathtub."
___
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org


[pfx] Re: read postscreen database?

2023-10-31 Thread Wietse Venema via Postfix-users
Viktor Dukhovni via Postfix-users:
> On Tue, Oct 31, 2023 at 01:38:13PM -0400, Michael W. Lucas via Postfix-users 
> wrote:
> 
> > That's what I would have thought. I can run postmap -s and postmap -q
> > on the usual db files in /etc/postfix just fine, but when I try it on
> > /var/db/postfix/postscreen_cache.db it just hangs:
> 
> That's expected.  The "postmap -s" command takes a read lock, the
> "postscreen" service holds a write lock.  For snapshot reads, you
> need LMDB not Berkeley DB.
> 
> Otherwise, you can read the database after stopping "postscreen".

Or copy the file with a dumb program, and use postmnap to dump that
copy. Caution: the file contains holes and may grow when copied,
as holes are filled in with nulls.

Or use LMDB, which does not need a postscreen write lock.

Postfix commands are not optimized to provide 'manual' access to
an 'internal' interface.

Wietse
___
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org


[pfx] Re: read postscreen database?

2023-10-31 Thread Viktor Dukhovni via Postfix-users
On Tue, Oct 31, 2023 at 01:38:13PM -0400, Michael W. Lucas via Postfix-users 
wrote:

> That's what I would have thought. I can run postmap -s and postmap -q
> on the usual db files in /etc/postfix just fine, but when I try it on
> /var/db/postfix/postscreen_cache.db it just hangs:

That's expected.  The "postmap -s" command takes a read lock, the
"postscreen" service holds a write lock.  For snapshot reads, you
need LMDB not Berkeley DB.

Otherwise, you can read the database after stopping "postscreen".

-- 
Viktor.
___
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org


[pfx] Re: read postscreen database?

2023-10-31 Thread Michael W. Lucas via Postfix-users
On Tue, Oct 31, 2023 at 12:56:23PM -0400, Wietse Venema via Postfix-users wrote:
> Michael W. Lucas via Postfix-users:
> > Hi,
> > 
> > Is there a way to dump the postscreen database, showing which
> > addresses are cached and why?
> > 
> > Running postfix 3.8 on FreeBSD.
> 
> postmap -s
> 
> The database contains tuples with (client IP address, list of
> timestamps). Each timestamp indicates when the corresponding test
> result expires, or whether a test is disabled. 
> 
> It's an internal interface, so tools that depend on it may break
> as the format evolves. If you are not using LMDB, the file may
> change while you're dumping it (LMDB reports the contents of a
> temporary snapshot).

That's what I would have thought. I can run postmap -s and postmap -q
on the usual db files in /etc/postfix just fine, but when I try it on
/var/db/postfix/postscreen_cache.db it just hangs:

# postmap -s  postscreen_cache

I know that 80.94.95.181 is in there, because I'm watching the mail
log and that host keeps trying. Querying for that same address also
gives a hang:

# postmap -q 80.94.95.181 postscreen_cache

My cache is set to default:

postscreen_cache_map = btree:$data_directory/postscreen_cache

Thinking it might be a problem with the FreeBSD package, I compiled
the pristine Postfix sources, went into bin/, and ran:

# ./postmap -s /var/db/postfix/postscreen_cache

Still hung.

Am I missing something obvious here?

Thanks,
==ml

-- 
Michael W. Lucashttps://mwl.io/
author of: Absolute OpenBSD, SSH Mastery, git commit murder,
 Absolute FreeBSD, Butterfly Stomp Waltz, Forever Falls, etc...
### New books: DNSSEC Mastery, Letters to ed(1), $ git sync murder ###
___
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org


[pfx] Re: read postscreen database?

2023-10-31 Thread Wietse Venema via Postfix-users
Michael W. Lucas via Postfix-users:
> Hi,
> 
> Is there a way to dump the postscreen database, showing which
> addresses are cached and why?
> 
> Running postfix 3.8 on FreeBSD.

postmap -s

The database contains tuples with (client IP address, list of
timestamps). Each timestamp indicates when the corresponding test
result expires, or whether a test is disabled. 

It's an internal interface, so tools that depend on it may break
as the format evolves. If you are not using LMDB, the file may
change while you're dumping it (LMDB reports the contents of a
temporary snapshot).

Wietse
___
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org


[pfx] Re: read postscreen database?

2023-10-31 Thread Matus UHLAR - fantomas via Postfix-users

On 31.10.23 12:26, Michael W. Lucas via Postfix-users wrote:

Is there a way to dump the postscreen database, showing which
addresses are cached and why?


I guess postmap -s could do that.
http://www.postfix.org/postmap.1.html

--
Matus UHLAR - fantomas, uh...@fantomas.sk ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
I'm not interested in your website anymore.
If you need cookies, bake them yourself.
___
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org