Sendmail Alias File to Proofpoint LDIF Converter
Tool to Convert Sendmail Alias Files to Proofpoint LDIF Format
Requirements:
- Python 3.9+
Installing the Package
You can install the tool using the following command directly from GitHub.
pip install git+https://github.com/pfptcommunity/sma2ldif.git
or can install the tool using pip.
# When testing on Ubuntu 24.04 the following will not work:
pip install sma2ldif
If you see an error similar to the following:
error: externally-managed-environment
× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
python3-xyz, where xyz is the package you are trying to
install.
If you wish to install a non-Debian-packaged Python package,
create a virtual environment using python3 -m venv path/to/venv.
Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
sure you have python3-full installed.
If you wish to install a non-Debian packaged Python application,
it may be easiest to use pipx install xyz, which will manage a
virtual environment for you. Make sure you have pipx installed.
See /usr/share/doc/python3.12/README.venv for more information.
note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.
You should use install pipx or you can configure your own virtual environment and use the command referenced above.
pipx install sma2ldif
Use Cases
In certain Proofpoint on Demand setups, valid recipient addresses may not be listed in Azure, LDAP, or Active Directory. Some organizations use aliases on an internal Sendmail system to direct messages to mailing lists or other destinations. This tool converts Sendmail alias configurations into LDIF format for import into a Proofpoint on Demand cluster. The aliases are added as contact lists, enabling recipient verification without disrupting custom email workflows. An example of a converted alias entry is provided below.
dn: 1002d@acme.com
uid: 9cf8803e-fc8c-5d4a-8381-e59b33eaa8a5
description: Auto generated by sma2ldif
givenName: 1002d
sn: sma2ldif
profileType: 1
mail: 1002d@acme.com
The the example above was generated using the following arguments:
sma2ldif --alias-file /etc/aliases --ldif-file /tmp/aliases.ldif -d acme.com
If other domains are listed with the -d argument as shown below.
sma2ldif --alias-file /etc/aliases --ldif-file /tmp/aliases.ldif -d acme.com, example.com, foo.com
The result would look similar to the following.
dn: 1002d@acme.com
uid: 9cf8803e-fc8c-5d4a-8381-e59b33eaa8a5
description: Auto generated by sma2ldif
givenName: 1002d
sn: sma2ldif
profileType: 1
mail: 1002d@acme.com
proxyAddresses: 1002d@example.com
proxyAddresses: 1002d@foo.com
If other domains are listed with the -d and the --expand-proxy argument is used the proxyAddresses would be expanded to their own DN entries.
sma2ldif --alias-file /etc/aliases --ldif-file /tmp/aliases.ldif -d acme.com, example.com, foo.com --expand-proxy
The result would look similar to the following.
dn: 1002d@acme.com
uid: 9cf8803e-fc8c-5d4a-8381-e59b33eaa8a5
description: Auto generated by sma2ldif
givenName: 1002d
sn: sma2ldif
profileType: 1
mail: 1002d@acme.com
dn: 1002d@example.com
uid: 1fe96894-171f-5053-bbc6-ec8e8670bfe9
description: Auto generated by sma2ldif
givenName: 1002d
sn: sma2ldif
profileType: 1
mail: 1002d@example.com
dn: 1002d@foo.com
uid: a1a955e8-771f-52af-8f8a-707c82c4f0f5
description: Auto generated by sma2ldif
givenName: 1002d
sn: sma2ldif
profileType: 1
mail: 1002d@foo.com
Usage
usage: sma2ldif --alias-file <aliases> --ldif-file <ldif> -d <domain> [<domain> ...] [-g <group> [<group> ...]] [-e]
[--exclude PATTERN] [--include PATTERN] [--exclude-target PATTERN] [--include-target PATTERN]
[--log-level {debug,info,warning,error,critical}] [-l LOG_FILE] [-s LOG_MAX_SIZE]
[-c LOG_BACKUP_COUNT] [--version] [-h]
Convert Sendmail alias files to Proofpoint LDIF format.
Required Arguments:
--alias-file <aliases> Path to the input Sendmail aliases file.
--ldif-file <ldif> Path to the output LDIF file.
-d <domain> [<domain> ...], --domains <domain> [<domain> ...] List of domains for alias processing (first domain is
primary).
Processing Arguments (Optional):
-g <group> [<group> ...], --groups <group> [<group> ...] List of memberOf groups for LDIF entries (default:
none).
-e, --expand-proxy Expand proxyAddresses into unique DN entries.
--exclude PATTERN Regular expression pattern to exclude aliases. Use
'=' before patterns starting with a hyphen. (e.g.
--exclude="-(approval|outgoing|request)$")
--include PATTERN Regular expression pattern to include aliases. Use
'=' before patterns starting with a hyphen. (e.g.
--include="-(approval|outgoing|request)$")
--exclude-target PATTERN Regular expression pattern to exclude aliases by
alias target. The variable ${lhs} can be used as a
reference to the alias name. Use '=' before patterns
starting with a hyphen. (e.g. --exclude-
target="${lhs}@domain"
--include-target PATTERN Regular expression pattern to include aliases by
alias target. The variable ${lhs} can be used as a
reference to the alias name. Use '=' before patterns
starting with a hyphen. (e.g. --include-
target="${lhs}@domain"
Logging Arguments (Optional):
--log-level {debug,info,warning,error,critical} Set the logging level (default: warning).
-l LOG_FILE, --log-file LOG_FILE Set the log file location (default: sma2ldif.log).
-s LOG_MAX_SIZE, --log-max-size LOG_MAX_SIZE Maximum size of log file in bytes before rotation
(default: 10485760).
-c LOG_BACKUP_COUNT, --log-backup-count LOG_BACKUP_COUNT Number of backup log files to keep (default: 5).
Help / Version Arguments:
--version Show the program's version and exit
-h, --help Show this help message and exit.
Metadata
Release files for sma2ldif 0.0.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| sma2ldif-0.0.8.tar.gz | 15.2 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| sma2ldif-0.0.8-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 28.8 kB
Release files / sma2ldif-0.0.8.tar.gz
| Download URL | sma2ldif-0.0.8.tar.gz |
|---|---|
| Size | 15.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
87f6846515ef716aec4e9c13bead20d5c9dab49fc7ffed1fdf858dfef309e1b3
|
|
BLAKE2b-256 checksum How to use checksums |
b6cea088356cd5b9647e7764aabfa002c4dce62d133dc2045d054f11987b1c88
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.22
|
Release files / sma2ldif-0.0.8-py3-none-any.whl
| Download URL | sma2ldif-0.0.8-py3-none-any.whl |
|---|---|
| Size | 13.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d29c0b517e127f2079665efc503fdc4fa5ff2fc169356d25bc59623a8592df0b
|
|
BLAKE2b-256 checksum How to use checksums |
c7c8c98a136046fa394d7f902fd102010504cebaf09a317148ea4789af255c17
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.22
|
Security for sma2ldif 0.0.8
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.