Re: Missing LOGNAME

Sam Varshavchik <[email protected]> Thu, 27 Feb 2025 21:45:28 -0500
Newsgroups gmane.mail.imap.courier.general
Message-ID <[email protected]>
Alessandro Vesely writes:

> On Thu 27/Feb/2025 01:37:31 +0100 Sam Varshavchik wrote:
>> Alessandro Vesely writes:
>>
>>> I tried with and without import.  I never get Resent-From:.  I added the  
>>> following to resent.sh:
>>>
>>> echo "$HOME $LOCKSLEEP $DEFAULT $LOGNAME" >> /tmp/foo
>>>
>>> All values are printed, except LOGNAME.  Should I hardcode it?
>>
>> If you want to, sure.
>>
>> Depending on how maildrop gets invoked it will reset LOGNAME to what it  
>> thinks is responsible for its invocation, by looking up its real uid. If it  
>> getpwuid() fails, you'll get nothing. That is the most likely situation here  
>> -- it's being invoked under some virtual uid that does not have a username  
>> attached to it.
>
>
> I see.  I thought it could came from the transaction, with any extension the  
> user name may have had.
>
> Grabbing Delivered-To is overkill, methinks.

No, maildrop does not parse the Delivered-To:.

maildrop reads the real uid that invoked it, and attempts to look up the  
username for that uid.

It's just that the uid must be the common denominator that relates to both.  
If there's a username that's getting mapped to some numerical uid value, say  
via userdb, but the uid value is not getting mapped to the username, then  
maildrop effectively clears LOGNAME.

_______________________________________________
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-----

iHUEABYKAB0WIQRupkKLJP96aW75pIOKYPgoojZS4gUCZ8EjSAAKCRCKYPgoojZS
4qZNAP9kg6It8JuutvU/5sq+nhXEUg3/K9DVxXSkan7133+GhwEA5/dMQdefXHft
MI+ebJYKBxssMb1zLcpB4ybq9UaN8gY=
=/c0+
-----END PGP SIGNATURE-----