# Instructions for configuring mail transfer via ciphermail

**URL:** <https://community.ciphermail.com/t/instructions-for-configuring-mail-transfer-via-ciphermail/868>\
**Category:** Gateway\
**Created:** [October 2, 2023, 3:56pm UTC](https://community.ciphermail.com/t/instructions-for-configuring-mail-transfer-via-ciphermail/868 "2023-10-02T15:56:28Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![khaivu](https://dub1.discourse-cdn.com/flex017/user_avatar/community.ciphermail.com/khaivu/32/176_2.png) [@khaivu](https://community.ciphermail.com/u/khaivu)\
**Post date:** [October 2, 2023, 3:56pm UTC](https://community.ciphermail.com/t/instructions-for-configuring-mail-transfer-via-ciphermail/868/1 "2023-10-02T15:56:28Z")

</div>

Hello, I’m a student and I was assigned to research mail configuration via ciphermail gateway. Currently, I have installed a mail server using dovecot, postfix and configured ciphermail gateway. but I don’t know how the message can go through the ciphermail gateway to encrypt/decrypt and return to the user. Please help me configure mail transfer. thank you!

---

<div class="post-metadata">

**Author:** ![martijn](https://dub1.discourse-cdn.com/flex017/user_avatar/community.ciphermail.com/martijn/32/127_2.png) [@martijn](https://community.ciphermail.com/u/martijn)\
**Post date:** [October 3, 2023, 8:38am UTC](https://community.ciphermail.com/t/instructions-for-configuring-mail-transfer-via-ciphermail/868/2 "2023-10-03T08:38:41Z")

</div>

CipherMail gateway should be configured as a “postfix after queue filter”, i.e., the first time postfix receives an email, postfix will deliver the email to the CipherMail back-end. After handling, the back-end will then send the email back to postfix for further delivery.

For details on how to configure a postfix after queue filter, see [Postfix After-Queue Content Filter](https://www.postfix.org/FILTER_README.html)

Basically what you need to configure is:

1. In `master.cf` add a service (for example name it ciphermail)

2. in `main.cf` configure `content_filter` to point to the IP of the CIpherMail back-end

3. Add a “reinjection” port to postfix for email sent by the back-end back to postfix

I would suggest you have a look at the Virtual Appliance because that is already a configured and working system.

---

<div class="post-metadata">

**Author:** ![MSK](https://avatars.discourse-cdn.com/v4/letter/m/65b543/32.png) [@MSK](https://community.ciphermail.com/u/MSK)\
**Post date:** [November 20, 2023, 10:06am UTC](https://community.ciphermail.com/t/instructions-for-configuring-mail-transfer-via-ciphermail/868/3 "2023-11-20T10:06:11Z")

</div>

Hi team,

nice that you are here 🙂

I have the very same question, although not a student any longer…

From the discussion - it is NOT clear, which master.cf are you talking about, there will be two: one from the original postfix and one from the ciphermail postfix. This is not clear in your answer.

I setup the Virtual Appliance, still I need to change main.cf/master.cf of the original postfix, otherwise ciphermail will be totally ignored.

Question is: do I need to change name, IP of the original postfix to make ciphermail work?

There need to be more changes than installing and configuring ciphermail, there MUST be changes to the config files of the original postfix, too.

I am lost here as well.  
Unfortunately the documentiation does not mention at all. HOWTO, integrate ciphermail, into an existin mail system with one mail server (postfix).

Glad for any help,

Martin.

---

<div class="post-metadata">

**Author:** ![MSK](https://avatars.discourse-cdn.com/v4/letter/m/65b543/32.png) [@MSK](https://community.ciphermail.com/u/MSK)\
**Post date:** [November 20, 2023, 6:54pm UTC](https://community.ciphermail.com/t/instructions-for-configuring-mail-transfer-via-ciphermail/868/4 "2023-11-20T18:54:21Z")

</div>

Well, it is all in the net… 🙂

This post opened my eyes, got everything working, including amavis content filter

> [@Use CipherMail Appliance as encrypt decrypt gateway with mailserver](https://community.ciphermail.com/t/use-ciphermail-appliance-as-encrypt-decrypt-gateway-with-mailserver/796/6):
>
> You forgot to add a couple of important Postfix settings on the Mailcow server: In main.cf: content\_filter = smtp:[172.30.30.231]:25 This tells Postfix on the Mailcow server to forward all incoming email to CipherMail on 172.30.30.231. The CipherMail appliance should allow relaying from the Mailcow IP address (i.e., add 172.30.30.230 to My networks) The CipherMail gateway will receive every email from Mailcow and do it’s thing (encrypt, decrypt etc.). After handling, the email should be sen…

---

<div class="post-metadata">

**Author:** ![martijn](https://dub1.discourse-cdn.com/flex017/user_avatar/community.ciphermail.com/martijn/32/127_2.png) [@martijn](https://community.ciphermail.com/u/martijn)\
**Post date:** [November 20, 2023, 7:08pm UTC](https://community.ciphermail.com/t/instructions-for-configuring-mail-transfer-via-ciphermail/868/5 "2023-11-20T19:08:01Z")

</div>

Good to hear you got it working 🙂
