Know What and How About Always_bcc in Easy Ways| Carbonio CE

In our previous two articles, we have discussed about incoming forwarding and outgoing forwarding. A specialty about these forwarding is that you can set these forwarding on specific users. But the forwarding (always_bcc) we are going to discuss in this article, can not be set against any specific users. But that does not mean it has less appeal or important use.

Why Someone Wants to Use Always_bcc?

The most prolific use of always_bcc is to save a copy of all of your email communication in a backup mailbox specially when when you do not have any sophisticated mechanism for your email backup process. Let’s take a look at this image and you will understand the scenario more clearly.

For backup/archiving emails use always_bcc forwarding | Carbonio_CE

Now let’s take a look at it’s configuration.

How Can We Configure Always_bcc in Carbonio CE?

The server used in this article has below mentioned configuration:

zextras@mail:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.6 LTS
Release:        20.04
Codename:       focal
zextras@mail:~$
zextras@mail:~$ zmcontrol -v
Carbonio Release 23.3.0
zextras@mail:~$

Let’s assume, we are going to use backup@example.com email account to save a copy of all incoming and outgoing emails of all users. So let’s create the account and check the list of all accounts.

zextras@mail:~$ carbonio prov ca backup@example.com 123456
c5df5a44-b69f-4c64-8c6e-fae938c048d5
zextras@mail:~$ zmaccts
account                          status             created       last logon
------------------------------   -----------     ---------------  ---------------
backup@example.com               active      04/12/23 10:31            never
galsync.htriqf0fj6@example.com   active      04/07/23 10:17            never
ham.87czfnvny@example.com        active      04/07/23 10:14            never
mdsharifulislam@example.com      active      04/07/23 10:38            never
spam.5tkhevn7wr@example.com      active      04/07/23 10:13            never
user1@example.com                active      04/07/23 10:39  20230411113102.
user2@example.com                active      04/07/23 10:39  20230407104941.
virus-quarantine.magoeimvge@example. active      04/07/23 10:14            never
zextras@example.com              active      04/07/23 10:13  20230411113624.

                                 domain summary

    domain                  active    closed    locked    maintenance     total
-----------------------   --------  --------  --------  -------------  --------
example.com                      9         0         0              0         9
zextras@mail:~$

Now we are going to set backup@example.com as our always_bcc address.

Edit the the file /opt/zextras/common/conf/main.cf and add always_bcc=backup@example.com at the bottom of this file.

zextras@mail:~$ vi /opt/zextras/common/conf/main.cf
[Add below mentioned line]
always_bcc=backup@example.com

Now save the file and reload fostfix.

zextras@mail:~$ postfix reload
/postfix-script: refreshing the Postfix mail system
zextras@mail:~$ 

Before testing the settings from GUI mode, check the settings one more time.

zextras@mail:~$ tail -n 1 /opt/zextras/common/conf/main.cf
always_bcc = backup@example.com
zextras@mail:~$ postconf | egrep "always_bcc"
always_bcc = backup@example.com

So all settings are properly set.

Now let’s do some testing !

So as per our understanding, a copy of all incoming and outgoing mails will be saved to backup@example.com

Now let’s test the settings for an outgoing email.

As soon as we send the mail, let’s check the log as well as the webmail of backup@example.com.

Apr 12 10:57:16 mail postfix/amavisd/smtpd[2397705]: connect from localhost[127.0.0.1]
Apr 12 10:57:16 mail postfix/amavisd/smtpd[2397705]: 511C62024B7: client=localhost[127.0.0.1]
Apr 12 10:57:16 mail postfix/cleanup[2397696]: 511C62024B7: message-id=<1024965152.780.1681297034503.JavaMail.zextras@example.com>
Apr 12 10:57:16 mail postfix/qmgr[2385143]: 511C62024B7: from=<user1@example.com>, size=2804, nrcpt=2 (queue active)
Apr 12 10:57:16 mail amavis[1936442]: (1936442-01) Xygq6M85k4xu FWD from <user1@example.com> -> <backup@example.com>,<testuser@example2.com>, BODY=7BIT 250 2.0.0 from MTA(smtp:[127.0.0.1]:10025): 250 2.0.0 Ok: queued as 511C62024B7
Apr 12 10:57:16 mail postfix/qmgr[2385143]: D692B2024B8: removed
Apr 12 10:57:16 mail postfix/lmtp[2397706]: 511C62024B7: to=<backup@example.com>, relay=mail.example.com[192.168.1.192]:7025, delay=0.39, delays=0.01/0.02/0.03/0.34, dsn=2.1.5, status=sent (250 2.1.5 Delivery OK)
Apr 12 10:57:16 mail postfix/lmtp[2397706]: 511C62024B7: to=<testuser@example2.com>, relay=mail.example.com[192.168.1.192]:7025, delay=0.39, delays=0.01/0.02/0.03/0.34, dsn=2.1.5, status=sent (250 2.1.5 Delivery OK)
Apr 12 10:57:16 mail postfix/qmgr[2385143]: 511C62024B7: removed

So the log shows a copy this outgoing mail is saved to always_bcc address (backup@example.com). Let’s check it from the webmail of backup@example.com

Now, webmail confirms our configuration also.

Now let’s test the settings for an incoming email.

As soon as we send the mail, let’s check the log as well as the webmail of backup@example.com.

Apr 12 11:11:39 mail postfix/amavisd/smtpd[2408506]: connect from localhost[127.0.0.1]
Apr 12 11:11:39 mail postfix/amavisd/smtpd[2408506]: CFDFC2024E0: client=localhost[127.0.0.1]
Apr 12 11:11:39 mail postfix/cleanup[2408490]: CFDFC2024E0: message-id=<1554181232.959.1681297898803.JavaMail.zextras@example2.com>
Apr 12 11:11:39 mail postfix/qmgr[2385143]: CFDFC2024E0: from=<testuser@example2.com>, size=2995, nrcpt=2 (queue active)
Apr 12 11:11:39 mail amavis[1936444]: (1936444-01) CkTxLbJN83Td FWD from <testuser@example2.com> -> <backup@example.com>,<user1@example.com>, BODY=7BIT 250 2.0.0 from MTA(smtp:[127.0.0.1]:10025): 250 2.0.0 Ok: queued as CFDFC2024E0
Apr 12 11:11:39 mail amavis[1936444]: (1936444-01) Passed CLEAN {RelayedInternal}, ORIGINATING_POST/MYNETS LOCAL [127.0.0.1]:39620 <testuser@example2.com> -> <backup@example.com>,<user1@example.com>, Queue-ID: 126902024E1, Message-ID: <1554181232.959.1681297898803.JavaMail.zextras@example2.com>, mail_id: CkTxLbJN83Td, Hits: 0.276, size: 2440, queued_as: CFDFC2024E0, 729 ms
Apr 12 11:11:39 mail postfix/qmgr[2385143]: 126902024E1: removed
Apr 12 11:11:39 mail postfix/lmtp[2408507]: CFDFC2024E0: to=<backup@example.com>, relay=mail.example.com[192.168.1.192]:7025, delay=0.1, delays=0.01/0.02/0.02/0.06, dsn=2.1.5, status=sent (250 2.1.5 Delivery OK)
Apr 12 11:11:39 mail postfix/lmtp[2408507]: CFDFC2024E0: to=<user1@example.com>, relay=mail.example.com[192.168.1.192]:7025, delay=0.11, delays=0.01/0.02/0.02/0.06, dsn=2.1.5, status=sent (250 2.1.5 Delivery OK)
Apr 12 11:11:39 mail postfix/qmgr[2385143]: CFDFC2024E0: removed

So the log shows a copy this incoming mail is saved to always_bcc address (backup@example.com). Let’s check it from the webmail of backup@example.com

So the webmail verifies the log.

This is it. If you are interested to read more about this postfix configuration, you can check this postfix web page.

🙂

Post your comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

What You Need to Know About Outgoing Forwarding | Carbonio CE
Digital Sovereignty vs. Data Sovereignty – What Are the Differences? | Blog