<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[iRedMail — Postfix security tunning.]]></title>
	<link rel="self" href="http://www.iredmail.org/forum/feed-atom-topic4162.xml" />
	<updated>2012-11-15T09:15:34Z</updated>
	<generator>PunBB</generator>
	<id>http://www.iredmail.org/forum/topic4162-postfix-security-tunning.html</id>
		<entry>
			<title type="html"><![CDATA[Re: Postfix security tunning.]]></title>
			<link rel="alternate" href="http://www.iredmail.org/forum/post19083.html#p19083" />
			<content type="html"><![CDATA[<p>- I&#039;d like to add two in iRedMail: allow_percent_hack=no, swap_bangpath=no. but no more.<br />- It&#039;s not a good idea to block attachments in iRedMail by default, it should be finished by system admin, not iRedMail. So i won&#039;t use it in iRedMail.</p><p>Thanks very much for your sharing. <img src="http://www.iredmail.org/forum/img/smilies/smile.png" width="15" height="15" alt="smile" /></p>]]></content>
			<author>
				<name><![CDATA[ZhangHuangbin]]></name>
				<uri>http://www.iredmail.org/forum/user2.html</uri>
			</author>
			<updated>2012-11-15T09:15:34Z</updated>
			<id>http://www.iredmail.org/forum/post19083.html#p19083</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Postfix security tunning.]]></title>
			<link rel="alternate" href="http://www.iredmail.org/forum/post19082.html#p19082" />
			<content type="html"><![CDATA[<p>==== Required information ====<br />- iRedMail version: 0.8.3<br />- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL<br />- Linux/BSD distribution name and version: CENTOS<br />- Related log if you&#039;re reporting an issue: NONE<br />==== <br />I set some options to make some improvements in POSTFIX security. Apparently everything is working fine, so I share it hoping that it will be useful!</p><p>Complete alternative solution from: <a href="https://calomel.org/postfix.html">https://calomel.org/postfix.html</a> &amp;&amp; Postfix Man pages<br />********************************************** In /etc/postfix/main.cf **********************************************<br />## reject dangerous and undesirable file types attachments directly from Postfix (Don&#039;t waste time, CPU and bandwidth)<br />header_checks = pcre:/etc/postfix/header_checks.pcre</p><p>#### user%domain != user@domain<br />allow_percent_hack = no</p><p>#### user!domain != user@domain<br />swap_bangpath = no</p><p>### Tarpit those bots/clients/spammers who send errors or scan for accounts<br />smtpd_error_sleep_time = 20<br />smtpd_soft_error_limit = 1<br />smtpd_hard_error_limit = 3<br />smtpd_junk_command_limit = 2</p><p>### Reject codes == 554<br />access_map_reject_code = 554<br />invalid_hostname_reject_code = 554<br />maps_rbl_reject_code = 554<br />multi_recipient_bounce_reject_code = 554<br />non_fqdn_reject_code = 554<br />plaintext_reject_code = 554<br />reject_code = 554<br />relay_domains_reject_code = 554<br />unknown_address_reject_code = 554<br />unknown_client_reject_code = 450<br />unknown_hostname_reject_code = 450<br />unknown_local_recipient_reject_code = 554<br />unknown_relay_recipient_reject_code = 554<br />unknown_virtual_alias_reject_code = 554<br />unknown_virtual_mailbox_reject_code = 554<br />unverified_recipient_reject_code = 554<br />unverified_sender_reject_code = 554</p><p>### Limit the info given to outside servers<br />show_user_unknown_table_name = no</p><p>### How long do messages stay in the queue before being sent back to the sender. (in days)<br />### By default, postfix attempts to resend the message every (1000 secs)x(# attempts)x(days).<br />bounce_queue_lifetime = 4h<br />maximal_queue_lifetime = 4h<br />delay_warning_time = 1h</p><p>****************************************************************************************************************************************</p><p>********************************************** In /etc/postfix/header_checks.pcre **********************************************<br /># REJECT specific file attachments extensions<br /># Notice that some Microsoft Office files with macros and auto executable PowerPoint presentations are blocked (docm|pps[xm]?|xlsm)<br />/^Content-(Disposition|Type).*name\s*=\s*&quot;?(.*(\.|=2E)(ade|adp|asp|bas|bat|chm|cmd|com|cpl|crt|dll|docm|exe|hlp|ht[at]|inf|ins|isp|jse?|lnk|md[betw]|ms[cipt]|nws|\{[[:xdigit:]]{8}(?:-[[:xdigit:]]{4}){3}-[[:xdigit:]]{12}\}|ops|pps[xm]?|pptm|pcd|pif|prf|reg|sc[frt]|sh[bsm]|swf|vb[esx]?|vxd|ws[cfh]|xlsm))(\?=)?&quot;?\s*(;|$)/x REJECT (PCRE)Attachment name &quot;$2&quot; has not allowed file extension &quot;(.$4)&quot;</p>]]></content>
			<author>
				<name><![CDATA[ozapien]]></name>
				<uri>http://www.iredmail.org/forum/user32149.html</uri>
			</author>
			<updated>2012-11-14T22:22:21Z</updated>
			<id>http://www.iredmail.org/forum/post19082.html#p19082</id>
		</entry>
</feed>
