Skip to main content

Tool to Convert Sendmail Alias Files to Proofpoint LDIF Format

Project description

Sendmail Alias File to Proofpoint LDIF Converter

PyPI Downloads
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 -i /etc/aliases -o /tmp/aliases.ldif -d acme.com

If other domains are listed with the -d argument as shown below.

sma2ldif -i /etc/aliases -o /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

Usage

usage: sma2ldif -i <aliases> -o <ldif> -d <domain> [<domain> ...]
                [-g <group> [<group> ...]]
                [--log-level {debug,info,warning,error,critical}]
                [-l LOG_FILE] [-s LOG_MAX_SIZE] [-c LOG_BACKUP_COUNT] [-h]

Convert Sendmail alias files to Proofpoint LDIF format.

Required Arguments:
  -i <aliases>, --input <aliases>                         Path to the input
                                                          Sendmail aliases
                                                          file.
  -o <ldif>, --output <ldif>                              Path to the output
                                                          LDIF file.
  -d <domain> [<domain> ...], --domains <domain> [<domain> ...]
                                                          List of domains for
                                                          alias processing
                                                          (first domain is
                                                          primary).

Optional Arguments:
  -g <group> [<group> ...], --groups <group> [<group> ...]
                                                          List of memberOf
                                                          groups for LDIF
                                                          entries (default:
                                                          none).
  --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).
  -h, --help                                              Show this help
                                                          message and exit.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sma2ldif-0.0.2.tar.gz (10.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sma2ldif-0.0.2-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

Details for the file sma2ldif-0.0.2.tar.gz.

File metadata

  • Download URL: sma2ldif-0.0.2.tar.gz
  • Upload date:
  • Size: 10.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.22

File hashes

Hashes for sma2ldif-0.0.2.tar.gz
Algorithm Hash digest
SHA256 5de4cce3a170bd4dd2651f8cece73d8a3f3ae465935c3e5609f88a0fbe736f9e
MD5 c00da05babab6d2b610d31291826be76
BLAKE2b-256 2c10e35bcf64f73c7b22c21f6ffc05ebbd0d07fa1dad4564e5ed3c63472c1055

See more details on using hashes here.

File details

Details for the file sma2ldif-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: sma2ldif-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 9.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.22

File hashes

Hashes for sma2ldif-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 886f885c093d44e965fa95e968dde68ed5a96a1da991982a48896cd49cf37acb
MD5 2f62e343ce3bfc25c69138241c777ff2
BLAKE2b-256 0d06d95aa1e2df78cd8c14469e740dc7296d04cecc2e70ea435dbd534921b0e8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page