Bug 215507 - Environment variable expansion not performed on Organisation config entry
Summary: Environment variable expansion not performed on Organisation config entry
Status: RESOLVED NOT A BUG
Alias: None
Product: knode
Classification: Miscellaneous
Component: general (show other bugs)
Version: 4.3.2
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-21 00:57 UTC by Travers Carter
Modified: 2009-12-07 22:33 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
A screenshot of the initial knode config dialog just after startup (84.76 KB, image/png)
2009-11-30 04:57 UTC, Travers Carter
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Travers Carter 2009-11-21 00:57:52 UTC
Version:           4.3.2 (using KDE 4.3.2)
OS:                Linux
Installed from:    Fedora RPMs

When reading it's configuration for the default user identity knode does not expand environment variables in the Organisation (Org=) field when read from a non-user config file.  This is true regardless of whether the field is read from /etc/kde/emailidentities or /etc/kde/knoderc.  When the config is placed in the per-user file (~/.kde/share/config/knoderc) the field is correctly expanded.  Other fields in the config including at least the Full Name, Email Address and Signature do correctly expand environment variables regardless of which config file they originate from.

To replicate delete or move ~/.kde/share/config/knoderc and put the following in a system config file (eg /etc/kde/knoderc)

-----%<----------
[IDENTITY]
Org[$e]=${ORGANISATION}
-----%<----------

When knode is started the Organisation field in the settings will read literally "${ORGANSIATION}" instead of the contents of the ORGANISATION environment variable.

Slightly off topic for this bug report, but it may also make sense for knode to default to using the "Inline Signature" field in the emailidentities config file for the "Sig" IDENITITY entry.
Comment 1 Olivier Trichet 2009-11-29 18:22:52 UTC
Hello,

I can not reproduce what you see (not expanding variable).
Moreover when there is no knoderc (actually when the "Version" field of its "GENERAL" section is missing), a default IDENTITY section is created with information from emaildefaults. So there is no way, the "Org" field (of the system config knoderc) could be used with no existing user's knoderc.

When I only remove the IDENTITY section of my user's knoderc, any environment variable place in the system wide knoderc is correctly expanded.


Could you run the command "kde4-config --path config" and past the content of each knoderc that could exist in a directory from the returned list?
Do you really remove your user's knoderc entirely while reproducing you problem?
Comment 2 Travers Carter 2009-11-30 04:56:44 UTC
Perhaps it's not expanding when it reads from emaildefaults and that's overriding knoderc? I started out with no knoderc and noticed that the organisation field was being set to ${ORGANISAION}, which is the mail reason I created the system-wide knoderc in the first place.

Anyway here are the details you requested, this is just before launching knode (after running rm ~/.kde/share/config/knoderc).  I'll attach a screen shot of the initial config dialog before any changes are made too.

Also I've upgraded to from KDE 4.3.2 to 4.3.3 (Fedora 12 rpms) with no change.

[trav@whirlwind ~]$ kde4-config --path config
/home/users/trav/.kde/share/config/:/etc/kde/:/usr/share/kde-settings/kde-profile/default/share/config/:/usr/share/config/

[trav@whirlwind ~]$ IFS=':'; for i in `kde4-config --path config`; do echo ${i}knoderc: ; [ -f ${i}knoderc ] && cat ${i}knoderc || echo '<No File>'; echo; done
/home/users/trav/.kde/share/config/knoderc:
<No File>

/etc/kde/knoderc:
[IDENTITY]
Email[$e]=${EMAIL}
Mail-Copies-To=
Name[$e]=${FULLNAME}
Org[$e]=${ORGANISATION}
Reply-To=
SigningKey=
UseSigFile=false
UseSigGenerator=false
sigText[$e]=${FULLNAME}\nNoggin IT  •  Level 8, 28 Foveaux St, Surry Hills NSW Australia 2010\nT: +61 2 9219 8800  •  F: +61 2 9280 4669  •  E: ${EMAIL}\nhttp://www.noggin.com.au\n


/usr/share/kde-settings/kde-profile/default/share/config/knoderc:
<No File>

/usr/share/config/knoderc:
<No File>


I also have the following pre-configured files (which pre-dated /etc/kde/knoderc):

=== /etc/kde/emaildefaults:
[Defaults]
Profile=Default

[PROFILE_Default]
FullName[$e]=${FULLNAME}
EmailAddress[$e]=${EMAIL}
Organization=${ORGANISATION}
OutgoingServer=mail.noggin.com.au

=== /etc/kde/emailidentities:
[General]
Default Identity=90661902

[Identity #0]
Dictionary=English (Australia)
Name[$e]=${FULLNAME}
Email Address[$e]=${EMAIL}
Organization[$e]=${ORGANISATION}
Inline Signature[$e]=${FULLNAME}\nNoggin IT  •  Level 8, 28 Foveaux St, Surry Hills NSW Australia 2010\nT: +61 2 9219 8800  •  F: +61 2 9280 4669  •  E:  {EMAIL}\nhttp://www.noggin.com.au\n
Identity=Default
Inlined Html=false
Signature Type=inline
uoid=90661902
Comment 3 Travers Carter 2009-11-30 04:57:56 UTC
Created attachment 38707 [details]
A screenshot of the initial knode config dialog just after startup
Comment 4 Olivier Trichet 2009-12-05 22:48:28 UTC
Hello,

Your guess was correct. The line "Organization=${ORGANISATION}" in emaildefault should be "Organization[$e]=${ORGANISATION}" to be expanded.
Could you test this, please ?


Note that if you do not want the system knoderc to be overwritten (by the content of emaildefault) when there is no local knoderc, you must add the following in the system knoderc:
[GENERAL]
Version=4
Otherwise, only the signature is read from it.
Comment 5 Travers Carter 2009-12-07 22:33:32 UTC
I've confirmed the problem was caused by my typo in emaildefaults as you suggested, and fixing that gets everything working as expected.

Sorry for the noise, and thanks for investigating this.