The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Hidden copies of incoming and outgoing emails

Discussion in 'E-mail Discussions' started by phenixak, Apr 5, 2011.

Thread Status:
Not open for further replies.
  1. phenixak

    phenixak Member

    Joined:
    Dec 3, 2010
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Hello

    Search on the forum but I have not, so I have a question.

    How and where to set:

    1. incoming Email on any mail account (aa@com.pl, bb@com.pl, cc@com.pl etc..) was also sent as a copy at one account: dd@com.pl.
    2. Email sent from all accounts was also sent as blind carbon copy to account: dd@com.pl

    All mail accounts are the same user account.

    The issue is that You control what emails send and receive its employees.

    Best Regards: A. K.
     
  2. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    I'm not entirely certain I understand what you want here. Are you wanting to blind CC all incoming and outgoing emails from any domain to dd@com.pl account? If that is the case, then I can tell you how to do it on a per domain basis:

    1. To create a blind carbon copy, go to /etc/ and create a new file:

    Code:
    cp cpanel_exim_system_filter cpanel_exim_system_filter2
    2. Add the following at the bottom of the new file (/etc/cpanel_exim_system_filter2):

    Code:
    if ("$h_to:, $h_cc:, $h_bcc" contains "domain.com")
    then
      unseen deliver "dd@com.pl"
    endif
    
    if $sender_address: contains "domain.com"
    then
    unseen deliver "dd@com.pl"
    endif
    Now, go to WHM > Exim Configuration Editor and change the system filter to the new path (/etc/cpanel_exim_system_filter2).

    Above, please replace domain.com with the domain name you want to have all emails incoming and outgoing sent to the blind carbon copied address. Please ensure the receiving address for the incoming and outgoing emails is not on the same domain as those you are using for the forwarding, since you might end up creating some type of loop otherwise.
     
  3. phenixak

    phenixak Member

    Joined:
    Dec 3, 2010
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Thanks for your quick response ,

    I mean just a lot of email addresses in the same web account and the same domain that everything will be sent to these email accounts, and every of them will be sent - had hidden copies to dd@com.pl (owner of the domain and the entire company).

    The company's president asked for such a setting to control what employees send out his e-mail accounts and every pick.

    So if I understand correctly - is that enough?


    ///EDIT

    Indeed, there I took this into account.

    In this case, how to send a hidden copy of incoming messages to the email addressdd@com.pl and outgoing ee@com.pl address?

    The rest remains as I described.


    Code:
    if ("$h_to:, $h_cc:, $h_bcc" contains "domain.com")
    then
      unseen deliver "dd@com.pl"
    endif
    
    if $sender_address: contains "domain.com"
    then
    unseen deliver "ee@com.pl"
    endif
    
    
    yes ?
     
    #3 phenixak, Apr 5, 2011
    Last edited: Apr 5, 2011
  4. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    If you want to send a copy of incoming emails to a set email address to another set email address, you'd use this instead:

    Code:
    if ("$h_to:, $h_cc:, $h_bcc" is "emailuser@com.pl")
    then
      unseen deliver "dd@com.pl"
    endif
    
    if $sender_address is "emailuser@com.pl"
    then
    unseen deliver "ee@com.pl"
    endif
     
  5. phenixak

    phenixak Member

    Joined:
    Dec 3, 2010
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    and reproduce this IF statement for each e-mail account in the domain, if necessary? and everything in this file:/etc/cpanel_exim_system_filter2?
     
  6. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    You'd reproduce the if statement for each email account you want this to happen for if you don't simply want all emails on the domain (if you do, then you'd use the previously provided one where it is for all of the domain emails). You'd put each statement you want to add at the bottom of the created cpanel_exim_system_filter2 file.
     
  7. phenixak

    phenixak Member

    Joined:
    Dec 3, 2010
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Ok, I'm very grateful for the quick and concrete help. Thank You.

    -However, money for Cpanel are easily issued :)

    Best Regards: Adam K.
     
  8. phenixak

    phenixak Member

    Joined:
    Dec 3, 2010
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Hello Again,

    I'm sorry for the hassle but unfortunately it doesn't work.

    I did everything as it was written:

    -I have a file with the following formula:


    Code:
    cp cpanel_exim_system_filter cpanel_exim_system_filter2
    
    - At its end there is an entry:

    Code:
    
    if ("$h_to:, $h_cc:, $h_bcc" is "domena.pl")
    then
      unseen deliver "income@domena.pl"
    endif
    
    if $sender_address is "domena.pl"
    then
    unseen deliver "backup@domena.pl"
    endif
    
    
    - Then I run the command:

    ..... and in spite of sending emails to addresses in that domain, not the future, no hidden their copy on the defined account for the hidden copies of e-mails.

    - Whether something is wrong and understood?


    Best Regards: Adam K
     
  9. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Hello Adam,

    You cannot have is when it is not a full email address as the sender or recipient does not only match "domena.pl" instead it has to be contains for the entries, so you would change these:

    Code:
    if ("$h_to:, $h_cc:, $h_bcc" is "domena.pl")
    then
      unseen deliver "income@domena.pl"
    endif
    
    if $sender_address is "domena.pl"
    then
    unseen deliver "backup@domena.pl"
    endif
    To these:

    Code:
    if ("$h_to:, $h_cc:, $h_bcc" contains "domena.pl")
    then
      unseen deliver "income@domena.pl"
    endif
    
    if $sender_address: contains "domena.pl"
    then
    unseen deliver "backup@domena.pl"
    endif
    Additionally, please note that I already warned that having the domain have all emails delivering to another email account on the domain might create a loop situation, so I highly suggest picking two email accounts not on the domain for the delivery.
     
  10. phenixak

    phenixak Member

    Joined:
    Dec 3, 2010
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    Hi,

    It works perfectly. E-mail messages started to arrive.. Thank you for help and clarification.

    Best Regards: Adam K.
     
  11. m5media

    m5media Registered

    Joined:
    Feb 8, 2005
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    hi,

    I have almost the same situation, this post is very helpful but I was wondering why create the new filter file and put the rule in there. My current exim filter file has a lot of rules in it and wouldn't those be lost if you started with a blank one?

    If you wanted to preserve your existing rules would it be better to just add the new rule to the bottom of the filter file and restart exim?

    Regards: Mark P.
     
  12. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    The cPanel filter file will be overwritten on updates. If you add entries to it, then those entries will be lost. Of note, I didn't state to start with a blank filter file. I provided this command initially:

    Code:
    cp cpanel_exim_system_filter cpanel_exim_system_filter2
    This copies the existing filter file to a new filter file. It is not a blank file you would be starting with but the cPanel filter file that you rename by copying it, then putting entries to the bottom of it. If you do not use a filter file copied from the old one, you are going to risk losing your filters. It's up to you.
     
  13. mpkapadia

    mpkapadia Active Member

    Joined:
    Apr 10, 2002
    Messages:
    39
    Likes Received:
    0
    Trophy Points:
    6
    Hello

    This post was extremely helpful in configuring a hidden blind copy for one of our account.
    However i have got a request as under

    I need a blind copy of every External email ( not of domain.com) that is coming in and going out

    That is when sender domain = domain.com and recipient domain NOT = domain.com send blind copy to ABCD@xyz.com

    Also when ("$h_to:, $h_cc:, $h_bcc" contains "domain.com") and when sender NOT = domain.com send blind copy to ABC@XYZ.com

    Is something like the above doable . IF so what filter to set for the same.

    Thanks in advance
     
  14. Kent Brockman

    Kent Brockman Well-Known Member

    Joined:
    Jan 20, 2008
    Messages:
    1,130
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Buenos Aires, Argentina
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hi there Tristan, this was a very interesting post. But I have one question: After doing these changes, the next update will upgrade the cpanel_exim_system_filter only and the second copy will remain untouched? or cpanel will update the filter2 file as this is selected in the Exim Configuration?
    In the other hand, when was the last time this file was updated?

    Thank you
     
  15. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    cPanel rarely changes the cpanel_exim_system_filter file, but the new filter file will not be updated upon cPanel updates, since only the cPanel one is going to get updates. Unless the exim version is being changed, it is unlikely the filter file will change in any way. In 11.34, exim will be updated to a newer version, so you may wish to recopy the filter file at that point.

    I cannot state the exact time it was last updated. Again, it isn't likely to be changed in any way unless exim were updated, which hasn't happened other than patching for some time.

    As for mpkapadia's post, I have no idea how to configure what is being asked. I suggest posting at exim.org for this type of request on their mailing list there.
     
  16. Kent Brockman

    Kent Brockman Well-Known Member

    Joined:
    Jan 20, 2008
    Messages:
    1,130
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Buenos Aires, Argentina
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello Tristan. You still didn't answered the first question: If I set to use the cpanel_exim_system_filter2 file as filter in Exim Configuration, the next time exim has an upgrade, will upgrade the cpanel_exim_system_filter or the cpanel_exim_system_filter2?
     
  17. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    As far as I'm aware, this did answer that question, Kent:

    No, your new filter file will not be updated and only the cPanel one will be updated. If you create cpanel_exim_system_filter2, that is your file rather than cPanel's filter file. It will not be updated on any updates if cPanel does update the regular cPanel cpanel_exim_system_filter file.
     
  18. Kent Brockman

    Kent Brockman Well-Known Member

    Joined:
    Jan 20, 2008
    Messages:
    1,130
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Buenos Aires, Argentina
    cPanel Access Level:
    Root Administrator
    Twitter:
    Thank you very much :)
     
  19. Vinayak

    Vinayak Well-Known Member

    Joined:
    Jun 27, 2003
    Messages:
    267
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Bharat
    cPanel Access Level:
    Root Administrator
    While doing this remember that because of any reason if email is rejected by the BCC email address, sender will come to know that their email is being forwarded to some one else too, and this can create a business/legal mess for you.
     
  20. TuskenRaider

    TuskenRaider Registered

    Joined:
    Nov 23, 2011
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    I went with what I'm calling the 2nd option which filters certain addresses. I copied the file, cp -p, and put the if statements in at the bottom. When I try to save it in the cpanel it won't accept the new file, saying it's invalid.
     
Thread Status:
Not open for further replies.

Share This Page