1

Topic: How to BCC outgoing email that send only to external domain ?

==== Required information ====
- iRedMail version (check /etc/iredmail-release):  0.9.4
- Linux/BSD distribution name and version: Ubuntu 14.04
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):  MySQL
- Web server (Apache or Nginx): Apache
- Manage mail accounts with iRedAdmin-Pro? Yes
- Related log if you're reporting an issue:
====

Hi,
I need a solution to BCC outgoing email but only email that sent to external domain.
So if the user send to internal domain it will not BCC to defined email, but if user send to external domain, then it will BCC to defined email.
So how to do that ? Because BCC menu in domain will BCC all emails.

thanks

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: How to BCC outgoing email that send only to external domain ?

You can try to turn the SQL query in /etc/postfix/mysql/recipient_bcc_maps_user.cf, check whether recipient domain is hosted on localhost, if not, return a bcc address.

3

Re: How to BCC outgoing email that send only to external domain ?

hi Zhang,

Thanks for the reply, but sorry I don't understand what you mean and what to change.
So could you please give me the exact query so that I can replace the query in /etc/postfix/mysql/recipient_bcc_maps_user.cf to fulfill this goal ?

thanks

4

Re: How to BCC outgoing email that send only to external domain ?

I suggest that you open file /etc/postfix/mysql/recipient_bcc_maps_user.cf and check its sql query, then tune it to match your need.

Or, are you willing to buy a support ticket?
http://www.iredmail.org/support.html

5

Re: How to BCC outgoing email that send only to external domain ?

Hi Zhang

thanks for the info, I change in  /etc/postfix/mysql/recipient_bcc_maps_domain.cf
and it can filter what I want.

thanks

6

Re: How to BCC outgoing email that send only to external domain ?

Could you mind sharing your modification?

7

Re: How to BCC outgoing email that send only to external domain ?

hi Zhang,

No problem, I can share here smile
it is rather tricky, because in sender_bcc_maps_domain.cf we don't have parameter of recipient domain and in recipient_bcc_maps_domain.cf we don't have parameter for sender domain. So for temporary solution, I must hardcoding the script like this :

SELECT bcc_address FROM recipient_bcc_domain
WHERE '%d != domain and domain='your_domain'

done, hopefully it can help other that also need this solution.

8

Re: How to BCC outgoing email that send only to external domain ?

You may want to develop a plugin for iRedAPD for this purpose. As a Postfix policy server, iRedAPD has all parameters/values which client sends during smtp session, that means you have sender and recipient addresses at the same time, then you can return 'bcc' action.

9

Re: How to BCC outgoing email that send only to external domain ?

hi Zhang,

I'm not a developer, but you. I'm just a google search expert smile
So for the plugin, I depend on you smile
Hopefully you have time to upgrade the feature of bcc module, so that it can have option to filter only external domain.

thanks again

10

Re: How to BCC outgoing email that send only to external domain ?

I'm sorry that i have no plan to improve bcc control by developing an iRedAPD plugin... Just an idea to offer, so that you may find the better way for you.