PHP code example of coercive / maillog

1. Go to this page and download the library: Download coercive/maillog library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

coercive / maillog example snippets


$exim = new EximBL('/var/log/exim_log_file');

echo "<pre>";
var_dump($exim->get());
var_dump($exim->getEmails());
var_dump($exim->getNb());
echo "</pre>";

# Example of config
$postfix = new PostfixBL(
	'/var/log/mail.log',
	'localhost.localdomain[127.0.0.1]',
	'name0123'
);

# Set your search client
$postfix->search('no-reply\@my-domain\.email', PostfixBL::DAEMON_PICKUP);

# Parse options
$postfix->parse('bounced', true, 0, 10);

echo "<pre>";
var_dump($postfix->getIds());
var_dump($postfix->getDatas());
var_dump($postfix->getEmails());

# Distinct emails
var_dump($postfix->getEmails(true));
echo "</pre>";