SA Bugzilla – Bug 2555
Add Exim-like search algorithm for virtual-user config-files
Last modified: 2018-09-04 22:35:24 UTC
This patch adds another search alogrithm for virtual-user config-files, trying first the full email-address and if it fails it uses only the domain-part. It applies to 2.55 and 2.60 (with offsets) and works with our setup for 3 months.
Created attachment 1457 [details] Exim-style lookup for virtual-user config-files
currently working on that code, will have a look
move bug to Future milestone (previously set to Future -- I hope)
Created attachment 4467 [details] Updated patch to v3.2.5
Created attachment 5029 [details] Updated patch to v3.3.1
Martin, Can I assume you've been using this since 2003 essentially? Are their any caveats that you see to implementing this because it looks like it uses the defaults as a fall back. At worst, it looks like this needs to be checked if it patches clean against trunk and the documentation updated about the feature.
Kevin, yes, you are right - this patch works with approximately 20,000 emails since 2003 per day. The default behaviour of spamassassin is retained, as the new code is only used if the newly introduced "%x" replacement appears in the configured directory. I would be happy to provide additional documentation if you could point me to the appropriate section.
(In reply to comment #7) > Kevin, > > yes, you are right - this patch works with approximately 20,000 emails since > 2003 per day. The default behaviour of spamassassin is retained, as the new > code is only used if the newly introduced "%x" replacement appears in the > configured directory. > > I would be happy to provide additional documentation if you could point me to > the appropriate section. I'm targeting this for 3.4.0. It won't block the release and I would like some votes on it but first, I need to see documentation. From reviewing your patch, it changes the behavior of the --virtual-config-dir So that is the documentation to change, I believe. Specifically: --virtual-config-dir=pattern This option specifies where per-user preferences can be found for virtual users, for the -x switch. The pattern is used as a base pattern for the directory name. Any of the following escapes can be used: %u -- replaced with the full name of the current user, as sent by spamc. %l -- replaced with the 'local part' of the current username. In other words, if the username is an email address, this is the part before the "@" sign. %d -- replaced with the 'domain' of the current username. In other words, if the username is an email address, this is the part after the "@" sign. %% -- replaced with a single percent sign (%). So for example, if "/vhome/users/%u/spamassassin" is specified, and spamc sends a virtual username of "jm@example.com", the directory "/vhome/users/jm@example.com/spamassassin" will be used. The set of characters allowed in the virtual username for this path are restricted to: A-Z a-z 0-9 - + _ . , @ = All others will be replaced by underscores ("_"). This path must be a writable directory. It will be created if it does not already exist. If a file called user_prefs exists in this directory (note: not in a ".spamassassin" subdirectory!), it will be loaded as the user's preferences. The Bayes databases for that user will be stored in this directory. Note that this requires that -x is used, and cannot be combined with SQL- or LDAP-based configuration. The pattern must expand to an absolute directory when spamd is running daemonized (-d). Currently, use of this without -u is not supported. This inhibits setuid.
Moving all open bugs where target is defined and 3.4.0 or lower to 3.4.1 target
Martin, Would like to get this patched in but need a CLA (see https://www.apache.org/licenses/) and some pointers for documentation as noted. Moving to 3.4.2 unless you can respond in the next day or two. Regards, KAM
Created attachment 5591 [details] Patch adapted to 3.4 and trunk of 2018-08-31 Do we really need a CLA for this relatively simple addition? Pushing to 3.4.3 pending a CLA or judgment of triviality
In reviewing again, it's trivial logic so I think you can do it without a CLA but see my note with all the documentation changes in comment 8
I signed and sent the ICLA just now. Cheers Martin
Bringing back to 3.4.2 because it's trivial AND we have a CLA coming :-) Bill, can you commit before our Noon deadline today?
(In reply to Kevin A. McGrail from comment #14) > Bringing back to 3.4.2 because it's trivial AND we have a CLA coming :-) > > > Bill, can you commit before our Noon deadline today? Code committed to 3.4 and trunk r1839832 Working on documentation.
Created attachment 5593 [details] Patch to documentation, describing the addition of '%x' token Documents code already committed. NEEDS REVIEW BEFORE COMMIT
Per https://wiki.apache.org/spamassassin/DevelopmentMode, documentation isn't required to follow R-T-C
Fixed in r 1840050