John Peacock wrote: > David Sparks wrote: > >> I wanted to add some kind of extended config support for plugins that >> I'm writing that run at connect, mail from and rcpt to stages. I hacked >> in YAML support into lib/Qpsmtpd.pm (the diff is below but I'm not >> submitting this as a patch ... at this point at least). > > > Robert, at least, has expressed a distinct lack of interest in adding > YAML support to the core code. As long as the "damage" is limited to > your own plugins, though, I don't think it should be a problem.
Ok thanks. The reason I'm using YAML is that the config files are hundreds of lines and yaml allowed me to express complex relationships (initially I used a Perl data structure and eval'd that into existence). The idea is something like this (feeds are spamtrap feeds): [EMAIL PROTECTED]: feed: feedname1 [EMAIL PROTECTED]: feed: feedname2 queue: [EMAIL PROTECTED] sales@: reject: no such address '@host2': feed: feedname3 queue: [EMAIL PROTECTED] >> I've noticed >> that the config file is loaded every time a new connection comes in (I >> put the config into connection->notes()). > > > Unless you are running the forkserver (or Apache?) variant, there is no > persistent object to store global configurations in (if you run with > tcpserver, you have a completely new process every time). Sorry I should've mentioned that I'm running from the high_perf branch. I guess caching was a moot issue under forkserver. >> I was also unsure of how to get the config read relative to qpsmtpd on >> disk so I hacked config_dir() to look for a config directory relative to >> the current dir. What is the proper way of doing this? > > > Don't change the core code and just dump your config file into the > ./config directory. That's how the config code works; it pulls from > ./config unless it is one of the special qmail control files, in which > case it pulls from /var/qmail/control (typical installation). Why do > you want to have the YAML file outside of ./config? I tried to put my config files in a subdir of ./config. I can see that the core code should've worked but it didn't for me for some reason. I'll try to figure out why this didn't work later (perhaps another `setuidgid` issue?) Thanks, ds