{"id":13557464,"url":"https://github.com/ixs/lmtp_proxy","last_synced_at":"2025-04-03T11:32:13.283Z","repository":{"id":137068885,"uuid":"101740122","full_name":"ixs/lmtp_proxy","owner":"ixs","description":"A simple LMTP delivery proxy that is able to deliver to different backends depending on the rcpt to user","archived":false,"fork":false,"pushed_at":"2022-10-11T12:00:47.000Z","size":17,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-04T07:36:05.342Z","etag":null,"topics":["imap","imap-server","lmtp","proxy","proxy-server","smtp","smtp-server"],"latest_commit_sha":null,"homepage":null,"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/ixs.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}},"created_at":"2017-08-29T08:50:01.000Z","updated_at":"2023-12-17T17:49:52.000Z","dependencies_parsed_at":"2024-01-19T18:02:30.125Z","dependency_job_id":null,"html_url":"https://github.com/ixs/lmtp_proxy","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/ixs%2Flmtp_proxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ixs%2Flmtp_proxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ixs%2Flmtp_proxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ixs%2Flmtp_proxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ixs","download_url":"https://codeload.github.com/ixs/lmtp_proxy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246993173,"owners_count":20865953,"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":["imap","imap-server","lmtp","proxy","proxy-server","smtp","smtp-server"],"created_at":"2024-08-01T12:04:22.182Z","updated_at":"2025-04-03T11:32:08.274Z","avatar_url":"https://github.com/ixs.png","language":"Python","funding_links":[],"categories":["Python","others"],"sub_categories":[],"readme":"# lmtp_proxy\nA simple LMTP delivery proxy that is able to deliver to different backends depending on the rcpt to user\n\n\n## Function\nLMTP is often used for for communication between message transfer agent and message delivery agent/local delivery agent. https://en.wikipedia.org/wiki/Local_Mail_Transfer_Protoc$\n\nWhen doing maintenance or upgrades on an SMTP system it might be useful to be able to redirect delivery temporarily to a different storage backend.\n\nThis LMTP proxy was written to do a no-downtime migration of users from a cyrus based IMAP server to a newer version of the IMAP server.\nPerdition is used to redirect the end users from the old to the new imap service while this lmtp proxy is used to redirect the incoming mail\nfrom postfix to the right backend store.\n\n\n## Commandline parameters\n```\nusage: lmtp-proxy [-h] [-c [CONFIG]] [-D]\n\nAn LMTP Proxy server. Accepts mail via LMTP on an incoming socket and can\nforward to different lmtp sockets depending on the destination address.\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -c [CONFIG], --config [CONFIG]\n                        Configuration file location\n  -D, --daemonize       Deamonize program. If unspecified, run in foreground\n```\n\n\n## Configuration\nA configuration file is necessary to run the proxy. As a format for the config yaml was chosen as it can be easily updated\nvia scripts.\n\n* config: Basic configuration items for lmtp-proxy.\n  * socket: Either a full path to the incoming unix domain socket or a list of two items, host and port.\n  * owner: The owner of the unix domain socket. Ignored when not using a unix domain socket.\n  * group: The group owner of the unix domain socket. Ignored when not using a unix domain socket.\n  * permissions: Permissions of the unix domain socket file. Ignored when not using a unix domain socket. Needs to be in octal, e.g. 0660 instead of just 660.\n  * ignoreDomain: Boolean to specify whether the full destination address (user@example.com) is used for the user table lookup or just the localpart (user).\n  * fallback_backend: The backend to use in case the user could not be found in the lookup table.\n  * pid: PID file location when using --daemonize, defaults to /var/run/lmtp-proxy.pid when unspecified.\n* backends: Dictionary of backend names each containing the following configuration items:\n  * socket: Full path of the local unix domain socket to reach the backend LMTP server.\n  * host: Hostname of backend server. Ignored if using a local unix domain socket.\n  * port: Port of the backend server. Ignored if using a local unix domain socket.\n  * user: Username for authentication if needed for LMTP delivery.\n  * password: Password for authentication if needed for LMTP delivery.\n* users: Mapping table of users. username: backendname.\n  `reject` is a special backend, which will send a 4xx status code back to the LMTP client indicating a temporary error and instruct the service to try again.\n\n\n## Signals\n\n* SIGUSR1: Reload the configuration. This will effectively update the list of backends and the user mapping table\n  This allows for changing the user mapping table without having to restart the lmtp daemon.\n\n\n## Minmal downtime migration of users\n\n### System setup\n```\n                                - imap -\u003e cyrus-old \u003c- lmtp -\n                              /                               \\\nenduser - imap -\u003e perdition -                                   - lmtp-proxy \u003c- mta/postfix\n                              \\                               /\n                                - imap -\u003e cyrus-new \u003c- lmtp -\n```\n\n### Steps\n1. Migrate imap store from old to new server, e.g. using imapsync\n2. Prevent the user from accessing the imap store either by temporarily modifying the password\n   or by changing the perdition redirection\n3. Prevent mail from being delivered to the imap store using the reject backend of the lmtp-proxy\n4. Final imapsync, both stores are now completely in sync\n5. Have mail delivery go to the new imap store using lmtp-proxy\n6. Configure perdition to redirect the user to the new imap store\n7. If applicable, reset user password to allow login\n\nIf done scripted, downtime for the user itself is only the final imapsync which usually is less than 10 seconds.\nThe full system does not experience any downtime at all.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fixs%2Flmtp_proxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fixs%2Flmtp_proxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fixs%2Flmtp_proxy/lists"}