Re: Courier 20240725 development build

Sam Varshavchik <[email protected]> Wed, 11 Sep 2024 17:57:58 -0400
Newsgroups gmane.mail.imap.courier.general
Message-ID <[email protected]>
Bernd Wurst writes:

> In this query, using some SQL magic, I search for a plus sign and discard  
> everything afterwards to return back the "real" mailbox. SQL looks like this:
>
> MYSQL_SELECT_CLAUSE SELECT \
> 	account, cryptpass, clearpass, uid, gid, homedir, maildir, quota,  
> fullname, options \
> 	FROM courier_virtual_deliveries \
> 	WHERE '$(service)' IN ('courier', 'login') \
> 	AND (account='$(local_part)@$(domain)' OR \
> 	(account=CONCAT(SUBSTRING_INDEX('$(local_part)', '+', 1),'@', '$ 
> (domain)') AND \
> 	enableextensions=1)) \
> [...]
>
>
> With the latest courier upgrade, this SQL lost its magic because the $ 
> (local_part) gets substituted by courier to never contain any plus sign any  
> more BEFORE it's handed over to SQL.

To translate this into the New World Order: accounts that had  
enableextensions=1 should simply have a .courier-default file, and  
everything should continue to work as before, and the second half of this  
SQL can be simply dropped because it will not do anything.

> I'd really like this behavior to be configurable altogether or find a way to  
> do this only for local .courier file lookups and not for virtual address  
> handling.

It's still configurable, it's just that one would install a .courier-default  
in the account's home directory, instead of setting enableextensions=1.

The only situation where this won't work would be an unusual setup where all  
virtual accounts have the same pseudo-home directory but the maildir  
attribute sets a different maildir directory for each virtual account. But  
that kind of setup is problematic in other ways, as it does not allow other  
things as well – it would not be possible, for example, to use a per- 
account ~/.mailfilter, unless it twists itself into contortions by looking  
at the environment in order to figure out the right maildir.

It's unclear from your description whether this is what you have. But if you  
don't, if all your mailboxes have different home directories, then replacing  
enableextension with a .courier-default file containing (presumably):

./Maildir

then you'll be right back where you started.

_______________________________________________
courier-users mailing list
[email protected]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users
signature.asc (application/pgp-signature, 228 B)
-----BEGIN PGP SIGNATURE-----

iHUEABYKAB0WIQRupkKLJP96aW75pIOKYPgoojZS4gUCZuISZgAKCRCKYPgoojZS
4jzTAQCJpRk6ZndSIddcSkJfh5zFk/tih73pFNthXhvy03inqAEAgTJ3BhXmewjz
GKUaA4mieaXR/Fk0CGvgjXyb2im51Qk=
=qFQS
-----END PGP SIGNATURE-----