Your IP : 216.73.216.246


Current Path : /proc/self/root/opt/sharedrads/__pycache__/
Upload File :
Current File : //proc/self/root/opt/sharedrads/__pycache__/exclude_rbl.cpython-313.pyc

�

��}j���j�SrSSKrSSKrSSKrSSKrS	SjrSrS
SjrSrSr	\
S:Xa\	"5 gg)z
Written by Quintin Holmes
�Nc��Sn[USSS9nUVs1sHoUR5iM nnURS5 US:XaCUHnXv;dM
URU5 SnM U(aUR	SU55 O�US	:Xa�[U5nUR
U5 [U5U:aKSn[S
US35 URS5 UR	SU55 UR5 O[S
US35 SSS5 U$s snf!,(df   U$=f![a [SU35 U$f=f)NFzr+�utf-8��encodingr�addTc3�*# �UH	oS3v� M g7f��
N���.0�domains  �/opt/sharedrads/exclude_rbl.py�	<genexpr>�!modify_domains.<locals>.<genexpr>����$�4D�&�(�"�
�4D����removezDomains removed from �.c3�*# �UH	oS3v� M g7fr	rrs  rrr)rrz#No specified domains were found in z$Permission denied: Unable to modify )
�open�strip�seekr�
writelines�len�difference_update�print�truncate�PermissionError)	�	file_path�domains�action�modified�file�line�existing_domainsr�
initial_counts	         r�modify_domainsr(sY���H� B�
�)�T�G�
4��9=�>���
�
����>��I�I�a�L����%�F��5�(�,�,�V�4�#'��&�
��O�O�$�4D�$����8�#� #�$4� 5�
� �2�2�7�;��'�(�=�8�#�H��1�)��A�>�?��I�I�a�L��O�O�$�4D�$���M�M�O��?�	�{�!�L�M�95�>�O��= ?�5�
4�>�O���B�
�4�Y�K�@�A��O�B�sE�D5�D#�D�!D#�CD#�D5�D#�#
D2�-D5�2D5�5E�Ec���[R"S/SS9 [R"/SQSS9 [S5 g![Ran[SU35 SnAgSnAff=f)Nz/scripts/buildeximconfT)�check)�	systemctl�restart�eximzExim restarted.zError restarting Exim: )�
subprocess�runr�CalledProcessError)�es r�restart_eximr25sZ��-����0�1��>����7�t�D�
�� ���(�(�-�
�'��s�+�,�,��-�s�8;�A'�A"�"A'c�R�/n[USS9nUHYnUR5RS5upVUR5U:XdM:URUR55 M[ SSS5 U$!,(df   U$=f![a [SU35 U$f=f)Nrr�:z"Permission denied: Unable to read )rr�split�appendrr)�user�userdomains_pathr!r$r%r�owners       r�find_user_domainsr:@s����G�G�
�"�W�
5���� $�
�
�� 2� 2�3� 7�
���;�;�=�D�(��N�N�6�<�<�>�2��6��N�6�
5��N���G�
�2�3C�2D�E�F��N�G�s4�
B
�9A8�#A8�.B
�8
B�B
�B
�
B&�%B&c�&�/n[SSS9nUHIn[R"SU3U5(dM$URUR	S5S5 /nMK SSS5 UHrn[SSS9nUHVn[R"SUS3U5(dM%WRUR	S5SR55 MX SSS5 Mt W(a[
XSS	9 gg!,(df   N�=f!,(df   M�=f)
Nz/etc/trueuserownersrrr4rz/etc/trueuserdomains�$r�r")r�re�searchr6r5rr()�resellerr �accountsr$r%�reseller_domains�accounts       r�child_accountsrDMs����H�	
�#�g�	6�$��D��y�y�1�X�J���.�.�����
�
�3��� 2�3�#%� ��
7�
��
�(�7�
;�t����9�9�q��	��^�T�2�2�$�+�+�D�J�J�s�O�A�,>�,D�,D�,F�G��<�
;��
��y�5�A��
7�	6��<�
;�s"�#C0�)C0�4$D�5D�0
C>�
D	c
�t�[R"SS9nURSSSSS/[S9 URS	S
SSS/[S9 URSS
SS[S9 URSSSSS9 UR	5nSnSn[
RRU5(d[USSS9R5 UR(a[X!RSS9nUR(a[X!RSS9=(d UnUR(a/[!UR5nU(a[X$SS9=(d UnUR"(a[%URU5 SnU(a['5 g[S 5 g![a [SU35 gf=f)!Nz Modify /etc/skiprbldomains file.)�descriptionz-az--add�+zAdd domains to the file.�DOMAIN)�nargs�help�metavar�default�typez-rz--removezRemove domains from the file.z-uz--userz#Add all domains owned by this user.�USERNAME)rJrKrMz-cz--child�
store_truezAdd reseller child accounts.)r"rJz/etc/skiprbldomainsF�arrz.Permission denied: Unable to create or modify rr=rTzNo changes made.)�argparse�ArgumentParser�add_argument�str�
parse_args�os�path�isfiler�closerrrr(rr7r:�childrDr2)�parser�argsr �
domains_added�user_domainss     r�mainr_^s���
�
$�
$�6��F�������
'���
���������
,���
��������
2��
���������
+�	������D�%�I��M�
�7�7�>�>�)�$�$�	���C�'�2�8�8�:�
�x�x�&�y�(�(�5�I�
��{�{��9�k�k�(�C�
��	�
�y�y�(����3����y�u�E�!� �
��z�z��t�y�y�)�,��
����
� �!��3�	��B�9�+�N�O��	�s�)F�F7�6F7�__main__)r)z/etc/userdomains)�__doc__rQr.rVr>r(r2r:rDr_�__name__r�r�<module>rdsI�����	�	�#�N-�
�
B�"B"�J�z���F�rc