Re: Missing LOGNAME
Alessandro Vesely <[email protected]> Fri, 28 Feb 2025 13:16:01 +0100
| Newsgroups | gmane.mail.imap.courier.general |
|---|---|
| Message-ID | <[email protected]> |
On Fri 28/Feb/2025 03:45:28 +0100 Sam Varshavchik wrote: > 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:. I meant I could grab it with something like /^Delivered-To: (.*)/ and $MATCH1. It comes with the original recipient extension and capitalization. Alternatively, I can hard code the recipient and add -$EXT if $EXT is not set. Or forget about EXT? In theory, Resent-From: can even contain the display-name. I'm still not clear what would that data be used for. However, I read a Best practices for forwarding email to Gmail[*] where they suggest to add forwarding headers, mentioning X-Forwarded-For: and X-Forwarded-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. Got it. Best Ale -- [*] https://support.google.com/mail/answer/175365?sjid=3371529845334100081-EU _______________________________________________ courier-users mailing list [email protected] Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users