Tom Collins wrote:

I agree that adding an extra set of valias_ functions to just get a list of aliases would be helpful. It will need to be implemented for each of the database backends and .qmail-alias files (vpalias.c). valias_select_all() should remain though.

I just submitted a patch (895348) to vpopmail-4.5.0 that adds the following functions to vpalias.c:


char *valias_select_names( char *domain )
char *valias_select_names_next()
void  valias_select_names_end()


They do return the alias names in alpha order. The valias_select_all* functions now call valias_select_names* and valias_select* functions to do the job. This is good for cdb, but probably not efficient for the database modules. This looked like a quick, easy way to return sorted alias names.


valias_select_names* will return a single entry containing the string "EzMLM Mailing List" when it encounters a block of symlinks created by exmlm. I think it would be good to add a similar entry to the alias list in the database modules. That way you only have to consult the alias list and the user list to get all the addresses possible in a domain. (This assumes that mailing lists are stored in the database.) vDeliverMail should never have see mailing lists because the symlinks are checked first.

Also, valias.c has been modified to allow a -n option to list only the names of aliases within a domain.

I have NOT attempted to do anything in any of the database modules.


I agree as well. It will just be a matter of making sure callers of those functions call a cleanup function when they're done so we can release any allocated memory.

If valias_select_names_end() can be called from vclose() somewhere, that will do the job of cleaning up. If you call valias_select_names() more than once, it triggers a cleanup, and valias_select_names_end() only acts if there is something to clean up.


Would that be the vclose() in vcdb.c?


Rick




Reply via email to