On Mon, Jul 8, 2024 at 3:21 PM Bill Cole via Postfix-users < postfix-users@postfix.org> wrote:
> On 2024-07-08 at 17:03:47 UTC-0400 (Mon, 8 Jul 2024 14:03:47 -0700) > Simon Thorpe (PST) via Postfix-users <stho...@cloudflare.com> > is rumored to have said: > > 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. > > Easily configured as described in Postfix itself without additional > software. If the list of inbound to outbound mappings is large, you might > want to do it with an external DB such as MySQL. > Ahh ok, then I need to do more reading. I essentially want the following... All emails to {alias}@mydomain.com sent onto any of a list of other domains, i.e. {alias}@domain1.com, {alias}@domain2.com, etc. If I can do this without code and purely in config, perfect. > 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. > > What interface to Postfix are you using? Postfix has multiple ways it can > connect to external software. However, none of them provide any sort of > debug facility to step through running external code. Postfix is not a > development environment. Postfix doesn't know anything about Python. > > Postfix DOES have extensive built-in support for distributing mail in very > versatile ways. What you have described would not seem to demand additional > new software. > I was using a custom filter in the master.cf, mailrepeater-filter unix - n n - - pipe flags=Rq user=nobody argv=/opt/python/forward_email.py > I've tried searching, but I cannot find a way to debug Python scripts > running in Postfix. > > And you never will. Python scripts DO NOT "run in Postfix" at all. It has > various interfaces for external tools: Milter, policy daemon, SMTP proxy, > content_filter and delivery via pipe are the main ones. It does not have > any capacity to debug those external programs, as it does not control their > execution environments. > > I don't like the idea of writing out a lot of logging > lines, that's a slow way to develop the code. > > Welcome to the development of mail software. You will do a lot of logging. > Heh, ok. I mean, it's a way to solve an issue. But i'm used to developing in a full debugger and able to step through things. But if I can achieve this all with config, I can avoid writing any code! > > b...@scconsult.com or billc...@apache.org > (AKA @grumpybozo@toad.social and many *@billmail.scconsult.com addresses) > Not Currently Available For Hire > > _______________________________________________ > Postfix-users mailing list -- postfix-users@postfix.org > To unsubscribe send an email to postfix-users-le...@postfix.org >
_______________________________________________ Postfix-users mailing list -- postfix-users@postfix.org To unsubscribe send an email to postfix-users-le...@postfix.org