{"id":17223838,"url":"https://github.com/bartobri/listfix","last_synced_at":"2025-03-25T16:24:51.708Z","repository":{"id":82434665,"uuid":"468794825","full_name":"bartobri/listfix","owner":"bartobri","description":"Email list creation and management for the postfix email server.","archived":false,"fork":false,"pushed_at":"2023-02-17T17:27:44.000Z","size":64,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-30T14:33:24.235Z","etag":null,"topics":["email","list","manager","postfix"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bartobri.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2022-03-11T15:04:32.000Z","updated_at":"2023-07-25T14:55:19.000Z","dependencies_parsed_at":"2023-06-15T16:30:14.833Z","dependency_job_id":null,"html_url":"https://github.com/bartobri/listfix","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bartobri%2Flistfix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bartobri%2Flistfix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bartobri%2Flistfix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bartobri%2Flistfix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bartobri","download_url":"https://codeload.github.com/bartobri/listfix/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245497940,"owners_count":20625085,"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","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":["email","list","manager","postfix"],"created_at":"2024-10-15T04:09:23.190Z","updated_at":"2025-03-25T16:24:51.701Z","avatar_url":"https://github.com/bartobri.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Version](https://img.shields.io/badge/Version-1.0.0-green.svg)\n\nListfix\n=======\n\nListfix is an email list manager for the postfix email server. It is\ndesigned with minimal features to be quick to set up, easy to integrate with\npostfix, and simple to create and administer lists.\n\nListfix allows you to create and manage multiple email lists through a simple\ncommand line interface (CLI). Integration with the postfix email server is\ngenerally only a matter of a couple easy configuration changes (this assumes\nyou already have postfix installed and configured to send and receive email).\n\nOnce integrated, postfix will hand off emails to listfix if the recipient is\nan email list address that is configured in listfix. Listfix will then\nmodify the headers (most importantly, the 'To' header), and\nresubmit an new email back to postfix for each recipient in the email list.\nPostfix will then deliver the new email to each recipient.\n\nListfix uses a json database which allows for simple viewing and direct\nmanipulation via your preferred text editor. This json format also allows for\neasy plugin compatibility via custom written scripts or other software.\n\nTable of Contents\n-----------------\n\n1. [Download](#download)\n2. [Usage](#usage)\n    * [Create a new email list](#create-a-new-email-list)\n    * [List all email lists](#list-all-email-lists)\n    * [Add a recipient to an email list](#add-a-recipient-to-an-email-list)\n    * [List all recipients in an email list](#list-all-recipients-in-an-email-list)\n    * [Remove a recipient in an email list](#remove-a-recipient-in-an-email-list)\n    * [Destroy an email list](#destroy-an-email-list)\n3. [Postfix Integration](#postfix-integration)\n    * [Configure virtual_alias_maps](#configure-virtual_alias_maps)\n    * [Configure /etc/aliases](#configure-etcaliases)\n    * [Log and Database Permissions](#log-and-database-permissions)\n4. [License](#license)\n\nDownload\n--------\n\n#### Requirements:\n\nThis project was built using python version 3.7. It has not been tested with\nlower versions. I suggest using at least python 3.7 to avoid any potential\nissues.\n\n#### Download from git:\n```\n$ git clone git@github.com:bartobri/listfix.git\n```\n\nUsage\n-----\n\nBasic Usage: `listfix.py \u003ccommand\u003e [\u003carg_1\u003e,\u003carg_2\u003e,...]`\n\nAfter downloading the listfix git repo, cd to the listfix directory. Next use\nthe following commands to create and manage your email list database.\n\nWe'll be using the example everyone@smith-family.com for our email list address.\n\n#### Create a new email list\n\nUsage: `listfix.py create \u003cemail_list_address\u003e \u003cemail_list_name\u003e`\n\n```\n$ ./listfix.py create everyone@smith-family.com \"Smith Family\"\nNew list (everyone@smith-family.com) added.\n$\n```\n\n#### List all email lists\n\nUsage: `listfix.py lists`\n\n```\n$ ./listfix.py lists\neveryone@smith-family.com (Smith Family)\n$\n```\n\n#### Add a recipient to an email list\n\nUsage: `listfix.py add \u003cemail_list_address\u003e \u003crecipient_address\u003e \u003crecipient_name\u003e`\n\n```\n$ ./listfix.py add everyone@smith-family.com mom@example.com \"Sue Smith\"\nNew recipient (mom@example.com) added to list (everyone@smith-family.com)\n$ ./listfix.py add everyone@smith-family.com dad@example.com \"Bob Smith\"\nNew recipient (dad@example.com) added to list (everyone@smith-family.com)\n$ ./listfix.py add everyone@smith-family.com me@example.com \"Joe Smith\"\nNew recipient (me@example.com) added to list (everyone@smith-family.com)\n```\n\n#### List all recipients in an email list\n\nUsage: `listfix.py dump \u003cemail_list_address\u003e`\n\n```\n$ ./listfix.py dump everyone@smith-family.com\nmom@example.com (Sue Smith)\ndad@example.com (Bob Smith)\nme@example.com (Joe Smith)\n$\n```\n\n#### Remove a recipient in an email list\n\nUsage: `listfix.py remove \u003cemail_list_address\u003e \u003crecipient_address\u003e`\n\n```\n$ ./listfix.py remove everyone@smith-family.com mom@example.com\nRecipient (mom@example.com) removed from list (everyone@smith-family.com)\n$\n```\n\n#### Destroy an email list\n\nUsage: `listfix.py destroy \u003cemail_list_address\u003e`\n\n```\n$ ./listfix.py destroy everyone@smith-family.com\nEmail list (everyone@smith-family.com) destroyed\n$\n```\n\nPostfix Integration\n-------------------\n\nThese instructions assume you have the postfix email server set up on a unix or\nlinux system and you have virtual domain settings enabled. Setting up and\nthe postfix email server is not within scope for these instructions.\n\n#### Configure virtual_alias_maps\n\nConfirm that the virtual_alias_maps configuration setting exists in the postfix\nmain.cf config file. If it does not exist, you will have to add it. A common\nsetting looks something like this:\n\n```\nvirtual_alias_maps = hash:/etc/postfix/virtual\n```\n\nNext add your email list(s) to the file (or resource) that is configured for\nvirtual_alias_maps. If it is configured similarly to the above example, open\nthis file and add a new line for each email list you want to manage via listfix.\nEach new line should consist of two parts separated by a space. The first\npart is the email address for the list. The domain name for this address should\nbe one that you have previously configured postfix to receive email for. The\nsecond part is a unique id. You can make the unique id anything you want, but\neach list must have its own unique id and it must conform to system userid\ncharacter requirements. It also can not match any userid on the system. See the\nbelow example:\n\n```\neveryone@smith-family.com list-smith-family\n```\n\nAfter you save the changes you will need to rebuild your virtual alias database\nand restart postfix:\n\n```\n$ sudo postmap /etc/postfix/virtual\n$ sudo service postfix restart\n```\n\n#### Configure /etc/aliases\n\nNext you need to add an entry to the /etc/aliases file for each unique id you\nadded to the postfix virtual_alias_maps file. Each entry should start with the\nunique id, followed by a colon and space, and then a command that pipes data\nto listfix. Be sure to use the listfix 'filter' command followed\nby the email address of the list that corresponds to the unique id. See the\nexample below:\n\n```\nlist-smith-family: \"| /path/to/listfix.py filter everyone@smith-family.com\"\n```\n\nAfter saving the changes you will need to rebuild the aliases database:\n\n```\n$ sudo newaliases\n```\n\nNow postfix will hand off emails to listfix when it receives an incoming \nemail addressed to one of the email list addresses configured in postfix's\nvirtual alias maps.\n\n#### Log and Database Permissions\n\nWhen postfix hands off an email to listfix, it simultaneously executes the\nlistfix script. The userid that postfix uses when it executes listfix needs to\nhave read/write access to the listfix log and database files. Until you grant\nthis access, listfix will likely generate read/write errors and will not\nfunction as expected.\n\nChange to the directory that listfix.py resides in. This is the same directory\nwhere listfix creates its database and log files. You should see one or both of\nthese files.\n\n##### listfix.json\n\nIf you have created an email list per the instructions above, you should see the\nfile listfix.json, which is the database file. Change the permissions to 664 so\nthat it is both owner and group writable. Next change the group to 'nogroup'\nwhich is the group for the postfix default user 'nobody' that it uses for\nhandoffs. This will allow the user 'nobody' to write to this file.\n\n```\n$ chmod 664 listfix.json\n$ sudo chown :nogroup listfix.json\n```\n\n##### listfix.log\n\nIf you made any errors while creating the database, you will also see the file\nlistfix.log. If that file does not exist, create it and leave it empty. Next,\nmake the same permission changes to this file so that the user 'nobody' can\nwrite to it.\n\n```\n$ chmod 664 listfix.log\n$ sudo chown :nogroup listfix.log\n```\n\nNow you should be able to test listfix and confirm it is working as expected.\n\nLicense\n-------\n\nThis program is free software; you can redistribute it and/or modify it\nunder the terms of the GNU General Public License. See [LICENSE](LICENSE) for\nmore details.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbartobri%2Flistfix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbartobri%2Flistfix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbartobri%2Flistfix/lists"}