Skip to main content

collective.geotransform

Tests Meta

GEO stands for "Gracefully E-mail Obfuscation". This package implements the solution exposed in this post of A List Apart, authored by Roel Van Gils:

http://www.alistapart.com/articles/gracefulemailobfuscation/

collective.geotransform uses plone.transformchain to transform the response output from Zope before it reaches your browser. It searches for all "mailto:" occurrences inside the response and transforms them into encoded harmless links. It also searches for plain email addresses (without links) inside the response and transforms them into encrypted spans. This codification is done via a simple base64 encoding, but enough to fool a spam robot.

This is the form of the encoded mailto link:

<a rel="nofollow" href="geomailto:dmljdG9yLmZlcm5hbmRlejJAdXBjbmV0LmVz">Link text</a>

While this is the form of the encoded span for plain email address:

<span class="geomailaddress">dmljdG9yLmZlcm5hbmRlejJAdXBjbmV0LmVz</span>

On the browser side, the encoded links and spans are decoded to their original form by using a Javascript that restores them to normal "mailto:" links and decrypted plain text emails.

Authenticated responses are NOT affected by this transform. Only anonymous responses are modified.

Compatibility

Version 4.x supports Plone 6.1 on Python 3.10 to 3.13, and Plone 6.2 on Python 3.10 to 3.14.

Older versions support older Plone versions:

  • Plone 6.0: versions 3.x
  • Plone 5: versions 2.x
  • Plone 4: versions 1.x

Installation

Add collective.geotransform to the dependencies of your project (with pip, uv or buildout), restart Plone, then activate the add-on in the Add-ons control panel.

Development

Requires uv. This installs the package with Plone 6.2.3 in .venv (use PLONE_VERSION=6.1.6 make install for another version) and the prek git hook.

make install
make start          # Plone on http://localhost:8080 (admin / admin)
make console        # Python console with the Zope application as `app`

Create a Plone site, then activate collective.geotransform in the Add-ons control panel. The transform only applies to anonymous responses: log out (or use a private window) to see the obfuscated links.

Tests

Tests run through tox, as the CI does. The robot scenario checks that the browser decodes the links: it runs Selenium with headless Chrome.

make test                                   # Plone 6.2.3
uvx --with tox-uv tox -e py312-plone61      # one Plone / Python combination
make test-all                               # lint, every combination, dependencies

Without tox:

.venv/bin/zope-testrunner --all --test-path=src -s collective.geotransform

Lint

make check          # format then lint (pyupgrade, isort, black, flake8...)

.editorconfig, .flake8, .gitignore, .pre-commit-config.yaml, tox.ini, .github/ and the tool sections of pyproject.toml are generated by plone.meta: change .meta.toml, then run uvx --from plone.meta config-package --no-commit --branch current ..

Release

make release        # zest.releaser fullrelease, run through uvx

Contribute

License

The project is licensed under the GPLv2 or later.

TODO

  • Accessibility form and validators

Contributors

  • Víctor Fernández de Alba, Original Author
  • Laurent Lasudry
  • Philip Bauer
  • Benoît Suttor
  • Tom Gross
  • Christophe Boulanger
  • Martin Peeters
  • Gil Forcada Codinachs
  • Maarten Kling
  • Maik Derstappen
  • Thomas Massmann

Changelog

4.0.0 (2026-11-20)

  • Breaking: replace the pkg_resources namespace of collective with a PEP 420 native namespace, and move the package to a src/ layout. Support Plone 6.1 only on Python 3.10 to 3.13, and Plone 6.2 on Python 3.10 to 3.14. Use 3.x for Plone 6.0. [remdub]

  • Import safe_text, IFilterSchema and IBundleRegistry from plone.base instead of the aliases Plone 6.2 deprecates, use plone.testing.zope in the test layers, and drop six. [remdub]

  • Declare the dependencies the code imports. [remdub]

  • Configure the package with plone.meta 2.12.0 (test matrix on Plone 6.2.3 and 6.1), move its metadata to pyproject.toml, convert the documentation to Markdown and run the development environment on Plone 6.2.3 with uv instead of buildout. [remdub]

3.0 (2023-02-09)

  • Add Plone 6 compatibility, drop Plone 5 support [boulch]

2.1 (2023-01-31)

  • Add support for Python 3 and Plone 5.2. [pbauer]

2.0 (2020-11-18)

  • Fix obfuscation with mails within texts [laulaz]

  • Make mail detection in texts (outside textareas) more robust [laulaz]

  • Improve / add tests [laulaz]

2.0a1 (2018-09-24)

  • Plone 5 compatibility [tomgross]

  • Add browserlayer and uninstall profile (fixes #11) [tomgross]

1.0.4 (2020-11-18)

  • Make mail detection in texts (outside textareas) more robust [laulaz]

  • Improve / add tests [laulaz]

1.0.3 (2017-12-06)

  • Do not obfuscate mails inside textarea or value="" attribute (#15) [laulaz]

1.0.2 (2016-08-19)

  • Do not obfuscate mails when called from Ajax, because we don't know if they will be de-obfuscated and that the goal is to fool non-Javascript robots [laulaz]

1.0.1 (2015-02-03)

  • Add metadata.xml into profile. [bsuttor]

  • Decode utf8 if accent in mail [bsuttor]

  • Add upgradestep for import new metadata.xml [bsuttor]

1.0 (2014-10-22)

  • Obfuscate plain text mails (#8) [laulaz]

  • Avoid touching mailto tags content (#4) [laulaz]

  • Avoid trying to transform non-HTML requests [laulaz]

  • Handle links with subject and / or body (#1) [laulaz]

  • Fix check for anonymous (#2) and for portal url (#3) [laulaz]

  • Fix getSite location [laulaz]

  • Add tests [laulaz]

  • Add buildout and bootstrap [laulaz]

1.0a3 (2012-08-03)

  • Fix check for anonymous [pbauer]

1.0a2 (2010-11-24)

  • Fixed broken uploaded file to pypi

1.0a1 (2010-10-22)

  • Initial release

Metadata

Release files for collective.geotransform 4.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for collective.geotransform 4.0.0
File Size Uploaded Provenance Actions
collective_geotransform-4.0.0.tar.gz 61.4 kB Without provenance Details for collective_geotransform-4.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for collective.geotransform 4.0.0
File Interpreter ABI Platform Actions
collective_geotransform-4.0.0-py3-none-any.whl Python 3 none any Details for collective_geotransform-4.0.0-py3-none-any.whl

Total release size: 118.8 kB

Release files / collective_geotransform-4.0.0.tar.gz

Download URL collective_geotransform-4.0.0.tar.gz
Size 61.4 kB
Tags Source
SHA-256 checksum
How to use checksums
bfb5e9a40f59523ce4673378203ca133c039f39df0b9e4886d5b3bf927b7d5cb
BLAKE2b-256 checksum
How to use checksums
4e12ebd91f62dae4d8d9e79c2457495178ae07155bc1b66c9e2a07ebfaecc7fa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.3

Release files / collective_geotransform-4.0.0-py3-none-any.whl

Download URL collective_geotransform-4.0.0-py3-none-any.whl
Size 57.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f5049de9d4760b1bb792b8c2558c8fe4d6b0c8064969c53ee2827446a7fb23ac
BLAKE2b-256 checksum
How to use checksums
c1baf39b44bf10a53089432606a66547dc0d4baa4bbadb2141ef1490e21594aa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.3

Security for collective.geotransform 4.0.0

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page