{"id":2295,"date":"2018-02-14T09:18:28","date_gmt":"2018-02-14T03:48:28","guid":{"rendered":"https:\/\/pheonixsolutions.com\/blog\/?p=2295"},"modified":"2018-02-14T09:18:28","modified_gmt":"2018-02-14T03:48:28","slug":"bcc-emails-exim-cpanelcopy-outgoing-emails-exim","status":"publish","type":"post","link":"https:\/\/pheonixsolutions.com\/blog\/bcc-emails-exim-cpanelcopy-outgoing-emails-exim\/","title":{"rendered":"BCC to all emails in exim cPanel|Copy all outgoing emails on exim"},"content":{"rendered":"<h3>BCC to all emails in exim cPanel|Copy all outgoing emails on exim<\/h3>\n<p><strong>Date posted: 14-02-2018<\/strong><\/p>\n<p>In this post, we will explain how to keep all outgoing Emails to particular mail account. Note that the email box which we will be setup will receive all the mails irrespective of to address. So, it would be good if that mail box can have unlimited storage.<\/p>\n<h4>Assumptions:<\/h4>\n<ol>\n<li>Exim Mailserver<\/li>\n<li>Email account(used as BCC email)<\/li>\n<li>Server root access<\/li>\n<\/ol>\n<h4>Implementation:<\/h4>\n<p>Login to the server using SSH.<\/p>\n<p>Copy default system filter config file \/etc\/cpanel_exim_system_filter<\/p>\n<p><code>cp \/etc\/cpanel_exim_system_filter \/etc\/cpanel_exim_system_filter_bcc<\/code><\/p>\n<p>Edit the file with the following content.<\/p>\n<p><code>vi\u00a0\/etc\/exim.conf.localopts<\/code><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">systemfilter=\/etc\/cpanel_exim_system_filter_bcc<\/pre>\n<p>Open the file\u00a0<em>\u00a0\/etc\/cpanel_exim_system_filter_bcc\u00a0<\/em>and add the below content.<\/p>\n<p><code><code><\/code>vi<\/code><code>\/etc\/cpanel_exim_system_filter_bcc<\/code><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">if (\"$h_to:, $h_cc:, $h_bcc\" contains \"domain.tld\")\r\nthen\r\n  unseen deliver \"email@domain.tld\"\r\nendif\r\n\r\nif $sender_address: contains \"domain.tld\"\r\nthen\r\nunseen deliver \"email@domain.tld\"\r\nendif<\/pre>\n<p>Replace the domain.tld with your own domain.<\/p>\n<p>Rebuild the exim configuration.<\/p>\n<p><code>\/scripts\/buildeximconf<\/code><\/p>\n<p>Restart the exim service.<\/p>\n<p><code>systemctl restart exim<\/code><\/p>\n<p>Verify the log for the domain.tld and we can see sample log file as below which indicates that the mails are being bcc to email@domain.tld<\/p>\n<p><code>grep email@domain.tld \/var\/log\/exim_mainlog<\/code><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">2018-02-14 11:41:35 1elxxxxx -&gt; email@domain.tld &lt;system-filter&gt; R=smarthost_dkim T=remote_smtp_smart_dkim H=xxxxxx [xx.xx.xx.xx] X=TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256 CV=yes  C=\"250 OK id=1elxxxxx\"\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>BCC to all emails in exim cPanel|Copy all outgoing emails on exim Date posted: 14-02-2018 In this post, we will [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[1019],"tags":[402,263,13],"class_list":["post-2295","post","type-post","status-publish","format-standard","hentry","category-cloud-aws","tag-bcc","tag-cpanel","tag-exim","psol-cat-cloud-aws"],"jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/phn2x7-B1","jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/2295","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=2295"}],"version-history":[{"count":0,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/2295\/revisions"}],"wp:attachment":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=2295"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=2295"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=2295"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}