[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-user
Subject:    Re: KMail and Filter lists...
From:       Dave Spenceley <kdeinfo () karibu ! force9 ! net>
Date:       1999-02-28 11:47:55
[Download RAW message or body]

Attached simple hack shell script to extract sections (and counts
from kmailrc, puts section in /tmp/kmailrc.{section} and section
count in  /tmp/kmailrc.{section}.count.

Then you can append this to users kmailrc, but ensure you enter correct
filters={count} in [General] section.

Note: if users already have fillters the numbers will need incrementing.

Hope this helps, feel free to hack script

Regards

Dave

On Sat, 27 Feb 1999, David Rugge wrote:
|On Mon, 22 Feb 1999, Jason N Pratt wrote:
|>Question.. where does KMail keep it's filter lists... I set-up filters as root
|>and want to copy them or allow my other login users KMail to use the same
|>filters instead of creating all of them again....  Any ideas anyone?
|
|Filters are kept in the ~/.kde/share/config/kmailrc file.
|
|It won't be easy to just take all of the filters out at once since (at least
|for me) they appear in random locations in the settings file. You could copy
....<snip>

------------------<Cut Here>------------------------------------
#!/bin/sh
# Extract Sections from kmailrc

KMAILRC=~/.kde/share/config/kmailrc
TMP=/tmp

	# just in case you want to extract filters or folders.....
LIST="Filter "

for SECTION in $LIST
	# parse kmailrc & write section contents to ${TMP}/kmailrc.${SECTION}
	# and count to ${TMP}/kmailrc.${SECTION}.count
do
	rm -f ${TMP}/kmailrc.${SECTION}
	cat ${KMAILRC} |
	awk -v section=${SECTION} '{
		if ( substr($0,1,1)=="[" ) {
			select="no"
			if ( substr($0,2,length(section) )==section ) select="yes"
		}

		if ( select=="yes" ) print $0
		}' >> ${TMP}/kmailrc.${SECTION}
		
	# ** GET COUNT OF FILTERS / ACCOUNTS
	# This Goes into [General] section as :
	#		filters={count}
	#		accounts={count}
	grep -c "^\["$SECTION ${TMP}/kmailrc.${SECTION} > ${TMP}/kmailrc.${SECTION}.count

done
------------------<Cut Here & save, then chmod to executable >-----------------

-- 
Send posts to:  kde-user@lists.netcentral.net
 Send all commands to:  kde-user-request@lists.netcentral.net
  Put your command in the SUBJECT of the message:
   "subscribe", "unsubscribe", "set digest on", or "set digest off"

All kde mailing lists are archived at http://lists.kde.org
**********************************************************************
This list is from your pals at NetCentral <http://www.netcentral.net/>

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic