# # 2003-2006 Victor Ustugov # # проверка полей Content-Type и Content-Transfer-Encoding # ##### # при 8-битном charset в поле Content-Type не указано 7-битное поле Content-Transfer-Encoding # # Content-Type: text/html; charset=windows-1251 # Content-Transfer-Encoding: 7bit # meta CT_8BIT_CTE_7BIT __CUST_Content_Type_text_8bit && __CUST_Content_Transfer_Encoding_7bit describe CT_8BIT_CTE_7BIT 8-bit header Content-Type found with 7-bit header Content-Transfer-Encoding score CT_8BIT_CTE_7BIT 2.0 ##### # при 8-битном charset в поле Content-Type не указано поле Content-Transfer-Encoding # # Content-Type: text/html; charset=windows-1251 # Content-Transfer-Encoding: отсутствует # meta CT_TEXT_WITHOUT_CTE __CUST_Content_Type_text_8bit && !__CTE && !( __User_Agent_Mutt && __CUST_Content_Type_text_plain && __Content_Disposition_inline) describe CT_TEXT_WITHOUT_CTE header Content-Type found without required header Content-Transfer-Encoding score CT_TEXT_WITHOUT_CTE 2.0 ##### # при отсутствующем Content-Transfer-Encoding два раза указано поле Content-Type # # Content-Type: text/html;charset="windows-1251" # Content-Type: multipart/alternative; # boundary="----=_NextPart_000_E03_410D1A93.62576A47" # header __DOUBLE_CT_WOUT_CTE Content-Type =~ /text\/html;charset="windows-1251"[.\n\r]+multipart\/alternative/ meta DOUBLE_CT_WOUT_CTE __DOUBLE_CT_WOUT_CTE && __CUST_Content_Transfer_Encoding_EMPTY describe DOUBLE_CT_WOUT_CTE Double header Content-Type without Content-Transfer-Encoding score DOUBLE_CT_WOUT_CTE 2.0 ##### # при 7-битном Content-Transfer-Encoding два раза указано поле Content-Type # # Content-Type: text/HTML; charset = windows-1251 # Content-Transfer-Encoding: 7bit # Content-Type: multipart/related; # boundary="----=_NextPart_000_0000_01C4379A.2926DAC0"; # type="text/html" # header __DOUBLE_CT Content-Type =~ /text\/HTML; charset = windows-1251[.\n\r]+multipart\/related;.+type="text\/html"/ meta DOUBLE_CT __DOUBLE_CT && __CUST_Content_Transfer_Encoding_7bit describe DOUBLE_CT Double header Content-Type with wrong type score DOUBLE_CT 4.0 ##### # при 7-битном Content-Transfer-Encoding в поле Content-Type указан charset windows-1251 # # Content-Type: text/HTML; charset = windows-1251 # Content-Transfer-Encoding: 7bit # header __CT_1251_WITH_SB Content-Type =~ /text\/(HTML|plain); charset = windows-1251/ meta CT_1251_WITH_SB __CT_1251_WITH_SB && __CUST_Content_Transfer_Encoding_7bit && !DOUBLE_CT describe CT_1251_WITH_SB Content-Type with charset windows-1251 and space bars and 8bit Content-Transfer-Encoding score CT_1251_WITH_SB 4.0 ##### # при Content-Transfer-Encoding: base64 в поле Content-Type указан charset windows-1251 # # Content-Type: text/HTML; charset = windows-1251 # Content-Transfer-Encoding: base64 # header __CTE7_CT_1251_WITH_SB Content-Type =~ /text\/(HTML|plain); charset = windows-1251/ meta CTE7_CT_1251_WITH_SB __CTE7_CT_1251_WITH_SB && __CUST_Content_Transfer_Encoding_base64 && !DOUBLE_CT describe CTE7_CT_1251_WITH_SB Content-Type with charset windows-1251 and space bars and base64 Content-Transfer-Encoding score CTE7_CT_1251_WITH_SB 4.0 ##### # при Content-Type: multipart есть поле Content-Transfer-Encoding: # # Content-Type: multipart/alternative; boundary="0-1069095558-1092238248=:56716" # Content-Transfer-Encoding: 8bit # #meta CT_MULTIPART_CTE __CUST_Content_Type_multipart && __CTE && !(__CUST_Content_Type_multipart_report && __CUST_From_MAILER_DAEMON) #meta CT_MULTIPART_CTE __CUST_Content_Type_multipart && __CTE && !(__CUST_Content_Type_multipart_report && __CUST_From_Mail_Delivery_System) meta CT_MULTIPART_CTE __CUST_Content_Type_multipart && __CTE && !__CUST_Content_Transfer_Encoding_binary && !(__CUST_Content_Type_multipart_report && (__CUST_From_Mail_Delivery_System || __CUST_From_Daemon)) && !__CUST_Content_Type_multipart_signed && !LIST_RU && !__YAHOO describe CT_MULTIPART_CTE Multipart message with header Content-Transfer-Encoding score CT_MULTIPART_CTE 0.5 ##### # дважды упоминаемый charset в поле Content-Type # # Content-Type: text/html; # charset="windows-1251"; charset=windows-1251 # header CT_DOUBLE_CHARSET Content-Type =~ /text\/(plain|html);\s*charset="windows-1251"; charset=windows-1251/ describe CT_DOUBLE_CHARSET Double charset in header Content-Type score CT_DOUBLE_CHARSET 1.5 ##### # фильтровать два Type в Content-Type: # Content-Type: multipart/related; # Type="multipart/alternative"; # boundary="----=_NextPart_000_0023_01C2A75B.6A694E1A" # или # Content-Type: multipart/related; # boundary="----_=_NextPart_001_01C3CE0C.49C89EA4"; # type="multipart/alternative" # #header CT_DOUBLE_TYPE_MULTI Content-Type =~ /multipart\/related;\s*(boundary=".+?";)?\s*type="multipart\/alternative"/i #describe CT_DOUBLE_TYPE_MULTI Double multipart type in header Content-Type #score CT_DOUBLE_TYPE_MULTI 0.5 ##### # фильтровать Content-Type: multipart/related с последующим type="text/html": # Content-Type: multipart/related; # boundary="----=_NextPart_000_0000_01C4379A.2926DAC0"; # type="text/html" # #header CT_DOUBLE_TYPE_TEXT Content-Type =~ /multipart\/related;\s*(boundary=".+?";)?\s*type="text\/html"/i #describe CT_DOUBLE_TYPE_TEXT Double type in header Content-Type #score CT_DOUBLE_TYPE_TEXT 0.5 ##### # фильтровать чарсет в Content-Type: multipart: # Content-Type: multipart/mixed; boundary="x0x0x0x0x0x0x0x0x0x0x0x0x"; # charset="Windows-1251" # или # Content-Type: multipart/alternative; # boundary="=_NextPart_2rfkindysadvnqw3nerasdf"; # charset="ISO-8859-1" # header CT_MULTIPART_CHARSET Content-Type =~ /multipart\/(mixed|alternative);\s*(boundary=".+?";)?\s*charset="?.+?"?/ describe CT_MULTIPART_CHARSET Field charset found in multipart header Content-Type score CT_MULTIPART_CHARSET 1.0 ##### # Content-Type: text/plain; # format=flowed; # charset="windows-1251"; # reply-type=original # Content-Transfer-Encoding: 7bit header __CT_PLAIN_FLOWED_CHARSET8_CTE7 Content-Type =~ /text\/plain;[\r\n\s]*format=flowed;[\r\n\s]*charset="?windows-1251"?;[\r\n\s]*reply-type=original/ meta CT_PLAIN_FLOWED_CHARSET8_CTE7 __CT_PLAIN_FLOWED_CHARSET8_CTE7 && __CUST_Content_Transfer_Encoding_7bit describe CT_PLAIN_FLOWED_CHARSET8_CTE7 8-bit header Content-Type found with 7-bit header Content-Transfer-Encoding score CT_PLAIN_FLOWED_CHARSET8_CTE7 2.0