2016-05-19 06:51:20 -05:00
<!DOCTYPE html>
2015-06-09 09:55:45 -05:00
< html >
< head >
< meta http-equiv = "Content-Type" content = "text/html; charset=utf-8" / >
< title > Quarantine clean emails sent from/to certain local user< / title >
2015-07-31 23:14:52 -05:00
< link rel = "stylesheet" type = "text/css" href = "./css/markdown.css" / >
2015-06-09 09:55:45 -05:00
< / head >
< body >
< div id = "navigation" >
2016-04-19 12:48:51 -05:00
< a href = "/index.html" target = "_blank" >
< img alt = "iRedMail web site"
src="./images/logo-iredmail.png"
style="vertical-align: middle; height: 30px;"
/>
< span > iRedMail< / span >
< / a >
2016-05-18 20:17:26 -05:00
// < a href = "./index.html" > Document Index< / a > < / div > < div class = "admonition note" >
2016-11-11 02:56:08 -06:00
< p class = "admonition-title" > This tutorial is available in other languages. < a href = "https://bitbucket.org/zhb/iredmail-docs/src" > Help translate more< / a > < / p >
2016-05-18 20:17:26 -05:00
< p > < a href = "./quarantine.clean.mails.per-user-it_IT.html" > Italiano< / a > /< / p >
< / div >
< h1 id = "quarantine-clean-emails-sent-fromto-certain-local-user" > Quarantine clean emails sent from/to certain local user< / h1 >
2015-06-09 09:55:45 -05:00
< p > Update < a href = "./file.locations.html#amavisd" > Amavisd config file< / a > , ask it to listen on one additional network port
< code > 10030< / code > (you're free to use another port), and one additional < code > policy_bank< / code > :< / p >
< pre > < code > $inet_socket_port = [10024, 9998, 10030];
$interface_policy{'10030'} = 'QUARANTINE';
$policy_bank{'QUARANTINE'} = {
clean_quarantine_method => 'sql:',
final_destiny_maps_by_ccat => {CC_CLEAN, D_DISCARD},
};
$clean_quarantine_to = 'clean-quarantine';
< / code > < / pre >
< p > Restart Amavisd service.< / p >
< ul >
< li > Append below content to Postfix config file < code > /etc/postfix/master.cf< / code > , ask
Postfix to listen on one additional network port < code > 10026< / code > (you're free to use
another port):< / li >
< / ul >
< pre > < code > 127.0.0.1:10026 inet n - - - - smtpd
-o content_filter=smtp-amavis:[127.0.0.1]:10030
-o recipient_bcc_maps=
-o sender_bcc_maps=
-o mynetworks_style=host
-o mynetworks=127.0.0.0/8
-o local_recipient_maps=
-o relay_recipient_maps=
-o strict_rfc821_envelopes=yes
-o smtp_tls_security_level=none
-o smtpd_tls_security_level=none
-o smtpd_restriction_classes=
-o smtpd_delay_reject=no
-o smtpd_client_restrictions=permit_mynetworks,reject
-o smtpd_helo_restrictions=
-o smtpd_sender_restrictions=
-o smtpd_recipient_restrictions=permit_mynetworks,reject
-o smtpd_end_of_data_restrictions=
-o smtpd_error_sleep_time=0
-o smtpd_soft_error_limit=1001
-o smtpd_hard_error_limit=1000
-o smtpd_client_connection_count_limit=0
-o smtpd_client_connection_rate_limit=0
-o receive_override_options=no_header_body_checks,no_unknown_recipient_checks,no_address_mappings
< / code > < / pre >
< ul >
< li > Restart Postfix service.< / li >
< / ul >
< pre > < code > service postfix restart
< / code > < / pre >
< ul >
< li > To quarantine all emails sent from/to < code > user@domain.com< / code > , set its per-user
transport to < code > smtp:[127.0.0.1]:10026< / code > .< / li >
< / ul >
< p > Now all emails sent from/to < code > user@domain.com< / code > will be quarantined into SQL
database (specified in Amavisd config file, parameter < code > @storage_sql_dsn< / code > ).< / p >
< p > Send an email to < code > user@domain.com< / code > for testing:< / p >
< pre > < code > # echo " mail body" | mail -s " test subject" user@domain.com
< / code > < / pre >
< h2 id = "see-also" > See also< / h2 >
< ul >
< li > < a href = "./quarantining.html" > Quarantining< / a > < / li >
2016-05-19 06:51:20 -05:00
< / ul > < div class = "footer" >
< p style = "text-align: center; color: grey;" > All documents are available in < a href = "https://bitbucket.org/zhb/iredmail-docs/src" > BitBucket repository< / a > , and published under < a href = "http://creativecommons.org/licenses/by-nd/3.0/us/" target = "_blank" > Creative Commons< / a > license. You can < a href = "https://bitbucket.org/zhb/iredmail-docs/get/tip.tar.bz2" > download the latest version< / a > for offline reading. If you found something wrong, please do < a href = "http://www.iredmail.org/contact.html" > contact us< / a > to fix it.< / p >
< / div >
< script type = "text/javascript" >
2015-06-09 09:55:45 -05:00
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-3293801-21', 'auto');
ga('send', 'pageview');
< / script >
< / body > < / html >