{"id":28814482,"url":"https://github.com/devksingh4/mailcow-gmailify","last_synced_at":"2025-10-09T03:08:04.466Z","repository":{"id":271035000,"uuid":"912210786","full_name":"devksingh4/mailcow-gmailify","owner":"devksingh4","description":"Enable secure and consistent forwarding of email from Mailcow to Gmail","archived":false,"fork":false,"pushed_at":"2025-01-06T21:54:31.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-18T15:43:03.956Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/devksingh4.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-04T23:13:04.000Z","updated_at":"2025-01-06T21:54:34.000Z","dependencies_parsed_at":"2025-01-05T00:33:06.707Z","dependency_job_id":null,"html_url":"https://github.com/devksingh4/mailcow-gmailify","commit_stats":null,"previous_names":["devksingh4/mailcow-gmailify"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/devksingh4/mailcow-gmailify","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devksingh4%2Fmailcow-gmailify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devksingh4%2Fmailcow-gmailify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devksingh4%2Fmailcow-gmailify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devksingh4%2Fmailcow-gmailify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devksingh4","download_url":"https://codeload.github.com/devksingh4/mailcow-gmailify/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devksingh4%2Fmailcow-gmailify/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279000775,"owners_count":26082911,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-18T15:30:47.570Z","updated_at":"2025-10-09T03:08:04.461Z","avatar_url":"https://github.com/devksingh4.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mailcow-gmailify\nTweaks to enable secure and consistent Mailcow -\u003e Gmail forwarding.\n\n## Motivation\n\nI use mailcow as a secure forwarder to my Gmail account. Thus, there's a few functional requirements:\n\n* All emails are ARC-signed before being forwarded to Gmail via Sieve.\n* Gmail retrieves all emails via POP3, ignoring duplicate messages and saving new messages\n  * This is to ensure that any messages marked as Spam by either Gmail or Mailcow still get delivered into the Spam folder\n* Since Sieve requeues the message, a milter must be used to ensure that the return path does not point to the mailbox on Mailcow, but rather to the original sender.\n\n\nNote that although the SPF check fails, the DKIM/DMARC signature still works so mail deliverability works fine. In the event Gmail were to for some reason reject the message, it would be retrieved via POP anyway. \n\nThis follows much of the same approach as (Open)Gmailify: docs [here](https://www.gmailify.com/docs).\n\n# Usage\n\n## On the Server\n\n1. Add the `milter/` folder to the root of your Mailcow folder (usually `/opt/mailcow-dockerized`).\n2. Add/merge the `docker-compose.override.yml` file in the root of your Mailcow folder.\n3. Add the lines from extra.cf into `MAILCOW_ROOT/data/conf/postfix/extra.cf`.\n4. Run `docker compose build custom-reject-mailcow \u0026\u0026 docker compose up custom-reject-mailcow -d \u0026\u0026 docker compose restart postfix-mailcow`\n\n## In the Mailcow Admin UI\n1. Ensure that the basics for the domain are setup (SPF/DKIM/DMARC) per Mailcow instructions.\n2. Create a new Mailbox template as shown below:\n\n\u003cimg width=\"1568\" alt=\"image\" src=\"https://github.com/user-attachments/assets/16da2e8c-7c88-4bf8-bbcf-1d1210f7dea3\" /\u003e\n\n3. Create a new mailbox that represents the main forwarded email, using this new template. Generate a long, secure password (this is how Gmail will communicate with Mailcow, you won't use it.)\n4. Go to Filters and add the following **Sieve prefilter** for the mailbox and save:\n```\nrequire \"fileinto\";\nrequire \"editheader\";\n\nif header :contains \"X-Spam-Flag\" \"YES\" {\n\tfileinto \"INBOX\";\n\tstop;\n}\naddheader \"X-Gmail-Forwarded\" \"YES\";\nredirect \"\u003cYOUR GMAIL ADDRESS HERE\u003e\";\nfileinto \"INBOX\";\nkeep;\n```\n\n5. Add these credentials to Gmail's \"Check mail from other accounts\", making sure that Gmail **does not leave email on the server after retrieving**.\n6. Also add these credentials to Gmail's \"Send mail as\" section.\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevksingh4%2Fmailcow-gmailify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevksingh4%2Fmailcow-gmailify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevksingh4%2Fmailcow-gmailify/lists"}