Simon Thorpe (PST) via Postfix-users:
> Hi
> 
> I am working on a Postfix server which accepts email for the domain it's
> authoritative for (e.g. mydomain.com) and then duplicates each email to a
> configurable list of other domains, i.e. an email to al...@mydomain.com is
> forwarded onto al...@anotherdomain.com and al...@whatdomain.com.
> 
> This server is being used for the demonstration of our own email security
> systems, where different sales people can get a steady flow of email to
> populate their own email inboxes.
> 
> So far I have successfully built a Postfix server, configured it to accept
> mail and then I have a Python script which runs for each email received and
> enumerates through each domain I want to send to. So far, an initial
> prototype shows it is working. However, I want to now add a lot more
> logging and have the domain configuration come from a database.
> 
> Ideally I want to be writing the Python in VSCode and running Postfix in a
> debug environment where I can step through code and develop quickly.
> 
> I've tried searching, but I cannot find a way to debug Python scripts
> running in Postfix. I don't like the idea of writing out a lot of logging
> lines, that's a slow way to develop the code.
> 
> Anyone have experience with debugging Python scripts in Postfix? I'm
> running version 3.6.4

It depends on how a Python script is controlled by a debugger.

By design, Postfix isolates progreams from the user who sends email.
That eliminates a huge number of privilege escalation exploits.

This means that Postfix does not propagate your debugging file
handles and environment variables to programs that Postfix runs.

You can configure Postfix to export environment settings to programs
that it runs. The default exports are:

main.cf:
    export_environment = TZ MAIL_CONFIG LANG

You can add to this like so:

main.cf:
    export_environment = TZ MAIL_CONFIG LANG foo=bar

Maybe you can modify the python code, and somehow import the remote
contrils that you need for debugging.

        Wietse

        Wietse
_______________________________________________
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org

Reply via email to