HEX
Server: Apache/2.4.62 (Unix) OpenSSL/1.1.1k
System: Linux ns565604.ip-54-39-133.net 4.18.0-553.50.1.el8_10.x86_64 #1 SMP Tue Apr 15 08:09:22 EDT 2025 x86_64
User: greer489 (1034)
PHP: 8.3.19
Disabled: NONE
Upload Files
File: //lib/python3.6/site-packages/spf_engine/__pycache__/policydspfsupp.cpython-36.pyc
3

t��^��@s�dZddlZddlZddlZddlZddlZddlZddddddddddd	d
ddd
dddddddddd�ZGdd�de�Z	d#dd�Z
Gdd�d�Zdd�Zdd�Z
ejd �Zdifd!d"�ZdS)$a(
   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
�N�ZFail�Falsez$127.0.0.0/8,::ffff:127.0.0.0/104,::1ZYesZSPF�HOSTNAME��
�z5Message {rejectdefer} due to: {spf}. Please see {url}Fz)local:/run/pyspf-milter/pyspf-milter.sockz"/run/pyspf-milter/pyspf-milter.pidzpyspf-milter�z	127.0.0.1�)�
debugLevel�HELO_reject�Mail_From_reject�PermError_reject�TempError_Defer�skip_addresses�TestOnly�SPF_Enhanced_Status_Codes�Header_Type�
Hide_Receiver�Authserv_Id�Lookup_Time�Whitelist_Lookup_Time�
Void_Limit�Reason_Message�No_Mail�Mock�Socket�PidFile�UserID�UMask�
InternalHosts�IntHosts�MacroListVerifyc@seZdZdZdS)�ConfigExceptionz9Exception raised when there's a configuration file error.N)�__name__�
__module__�__qualname__�__doc__�r'r'�$/usr/lib/python3.6/policydspfsupp.pyr"=sr"cCs�ddl}|dkr|jj}|dkr�yt||�WnZtk
r�}z>|rTtj|jd�|rntjj	d|jd�tj
d�WYdd}~XnX|S)zjLoad the specified config file, exit and log errors if it fails,
    otherwise return a config dictionary.rNz%s
r)Zspf_engine.policydspfsuppZpolicydspfsupp�defaultConfigData�_readConfigFile�	Exception�syslog�args�sys�stderr�write�exit)�filename�config�	useSyslog�	useStderrZ
spf_engine�er'r'r(�_processConfigFileCsr7c@seZdZddd�Zdd�ZdS)	�
ExceptHookrrcCs||_||_dS)N)r4r5)�selfr4r5r'r'r(�__init__XszExceptHook.__init__cCsTddl}ddl}|j|||f�}x.|D]&}|jr:tj|�|jr&|jj|�q&WdS)Nr)�	tracebackr.�format_exceptionr4r,r5r/r0)r9�etypeZevalueZetbr;r.�tb�liner'r'r(�__call__\s

zExceptHook.__call__N)rr)r#r$r%r:r@r'r'r'r(r8Ws
r8cCstddd�t_dS)Nr)r4r5)r8r.�
excepthookr'r'r'r(�_setExceptHookgsrBcCs|dkrtj�}|S)zDetermine Authserv_Id if neededr)�socketZgethostname)Zas_idr'r'r(�_make_authserv_idksrDz	^(.*)#.*$c
#Cs�|jdd�}|dkr"tjd|�|dkr.i}ttttttttttttttttttttttttttttttdtdtd�"}ytj|�d}Wn@tk
r�}z$|dkr�tjtjd	||j	f�|Sd}~XnXtj
|��s|dk�r�tjtjd
|t|�f�|St|d�}�x|j
�}|�sP|jdd
�dj�}|dk�rJtjt|��|�sT�qdd�|jd�D�}	t|	�dk�r�t|	�d
k�r�|d
k�r�tjd||f�ntjd||f��q|	\}
}|j|
�}|dk�r�|dk�rtjd|
|f��q|dk�rtjd|
|f�||�||
<�qW|j�yP|dk�rJtjdj|d��t|d�|d<|dk�rxtjdj|d��WnYnX|S)z�Reads a configuration file from the specified path, merging it
    with the configuration data specified in configData.  Returns a
    dictionary of name/value pairs based on configData and the values
    read from path.r
r�zreadConfigFile: Loading "%s"N�int�bool)"r
rrr
rZMail_From_pass_restrictionZHELO_pass_restrictionZProspectiveZ	WhitelistrZHELO_WhitelistZDomain_WhitelistZDomain_Whitelist_PTRrZReject_Not_Pass_DomainsZPer_UserrZdefaultSeedOnlyrrrrrrrrrrrrrrr r!zERROR stating "%s": %sz#ERROR: is not a file: "%s", mode=%s�r�#r�cSsg|]}|j��qSr')�strip)�.0�qr'r'r(�
<listcomp>�sz#_readConfigFile.<locals>.<listcomp>�=rz0Configuration item "%s" not defined in file "%s"z&ERROR parsing line "%s" from file "%s"z%ERROR: Unknown name "%s" in file "%s"z#readConfigFile: Found entry "%s=%s"zAuthserv_Id before: {0}rzAuthserv_Id after: {0})�getr,rF�strrG�os�stat�OSErrorZLOG_ERR�strerror�S_ISREG�oct�open�readline�splitrK�len�close�formatrD)
�pathZ
configDataZconfigGlobalr
ZnameConversion�moder6�fpr?�data�name�valueZ
conversionr'r'r(r*ss�









r*)NNrr)r&r,rRr.�rerSrCr)r+r"r7r8rBrD�compileZ	commentRxr*r'r'r'r(�<module>sL