HEX
Server: Apache
System: Linux www3.pit.tblive.com 5.14.0-687.38.1.el9_8.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Aug 12 17:19:12 EDT 2026 x86_64
User: awaldron (1020)
PHP: 8.1.34
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //usr/local/lib/python3.9/site-packages/agent360/plugins/__pycache__/postfix.cpython-39.pyc
a

F�Eg��@sHddlZddlZddlZddlZGdd�dej�ZedkrDe���dS)�Nc@seZdZdZdd�ZdS)�Plugin�postfixcCs&i}|�dd�}|�dd�}|�dd�}|�dd�}t�d|d|���}|�d�D]<}t�d	|�rXt�d
|�d}	t�d|�d}
t|
�||	<qX|d
kr�ddt�d����	�i|d<|d
k�r"t�d���}d|vr�ddd�|d<n6t�d|�d�
dd�t�d|�d�
dd�d�|d<|S)ak
        Monitoring of the Postfix MTA log and optionally the Postfix version and the mailqueue
        Dependency: Pflogsumm log analyzer, sudo access

        Exampel config for /etc/agent360.ini:
        [postfix]
        enabled = yes
        log = /var/log/mail.log
        pflogsumm = /usr/sbin/pflogsumm
        version = true
        queue = true
        r�logZ	pflogsumm�version�queuezsudo z -d today --detail 0 �
z +[0-9]+ +[a-z]{1}[a-z- ]+[a-z]z[a-z]{1}[a-z- ]+[a-z]rz
\b[0-9]*\b�truezPostfix z>sudo postconf -d | grep mail_version -m 1 | egrep -o "[0-9.]+"�metazsudo mailq | tail -n 1�empty)Zmails�sizez[0-9]+ Requestz Request�z	-- [0-9]+z-- )�get�os�popen�read�split�re�search�findall�int�rstrip�replace)�self�config�dataZmaillogZpflbinZpversionZmqueue�output�row�stat�numZ	mqcommand�r�B/usr/local/lib/python3.9/site-packages/agent360/plugins/postfix.py�runs&

6z
Plugin.runN)�__name__�
__module__�__qualname__r!rrrr rsr�__main__)r�
subprocessZpluginsrZ
BasePluginrr"�executerrrr �<module>s+