Yahoo Groups archive

Milter-greylist

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

Message

Another MX sync bug

2004-12-05 by Remy Card

Hi,

	I think that I have found another bug in the MX synchronisation code.
The code checks that a peer is not the local server (function local_addr()
in sync.c) but the result of this test is only used in sync_sender().

	I think that this should be tested in sync_queue() as well.  With
the current code, sync_queue() adds pendings records to the list, even
if the peer is local and sync_sender() does not send the records and does
not clear the list.  Thus, the list grows as pending records are added and
an overflow occurs, e.g:
...
Dec  5 20:34:15 soleil milter-greylist: peer 193.51.24.1 queue overflow (1024 entries), discarding new entry
Dec  5 20:34:15 soleil milter-greylist: peer 193.51.24.1 queue overflow (1024 entries), discarding new entry
Dec  5 20:34:16 soleil milter-greylist: peer 193.51.24.1 queue overflow (1024 entries), discarding new entry
Dec  5 20:34:19 soleil milter-greylist: peer 193.51.24.1 queue overflow (1024 entries), discarding new entry
...

	I suggest to add a test at the beginning of sync_queue():

	if (peer->p_flags & P_LOCAL)
		return;

	This will prevent milter-greylist from queuing records to a local
peer.  And, BTW, this will fix a memory leak in milter-greylist (pending
records that are added to the local peer list are never deallocated since
their reference count will never be decremented).

	Comments, anyone?

	Cheers

		R\ufffdmy

Attachments

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.