[%
    processed = {};

    FOR ip IN ips.reverse;
        NEXT UNLESS ip.mail_ip.defined;

	ip_object = ip.object;

	# Wir müssen hier alle IP-Adressen einzeln aufzählen, was für große
	# IPv6-Bereiche nicht so praktikabel ist, vgl. Ticket #532509:
	NEXT UNLESS ip_object.is_v4;

        hosts = ip_object.splitref;
        
        FOR host IN hosts;
            NEXT IF processed.exists(host.addr);
            host.addr %]:	[% ip.mail_ip | format('%03d') %]
[%
            processed.${host.addr} = undef;
        END;
    END;
-%]
