Monday, November 08, 2010 at 12:05 AM.

system.verbs.builtins.radio.utilities.mailConfiguration

<<Changes
	<<11/23/01; 4:40:20 PM by JES
		<<Changed user.radio.prefs.newsPageDeleteCheckboxesDefault to user.radio.prefs.flNewsPageDeleteCheckboxesDefault.
	<<10/24/01; 3:06:50 PM by PBS
		<<Adapted from script in myUserLand.root.
	<<2/25/01; 6:12:23 PM by JES
		<<Bug fix: myUserLandData.prefs.serviceListUrl is no longer defined. Don't try to email it. Send the value of myUserLandData.serviceLists.userlandAggregator instead.
	<<2/24/01; 1:58:41 AM by JES
		<<Fixed terminology mismatch; changed Blog Publish to Weblog Publish.
	<<2/23/01; 6:26:33 PM by PBS
		<<Don't email passwords.
	<<2/12/01; 4:21:12 PM by JES
		<<Added lots of new prefs. Changed email address to user.prefs.mailAddress.
		<<bundle //old code
			<<add ("Radio version: " + Frontier.version ())
			<<add ("IP address: " + tcp.dns.getMyDottedId ())
			<<add ("Radio folder: " + file.folderfrompath (frontier.getprogrampath ()))
			<<addOnOff ("Upstreaming", user.playlist.data.upstream.enabled)
			<<add ("www folder: " + user.playlist.prefs.wwwfolder)
			<<add ("www folder url: " + user.playlist.prefs.wwwUpstreamFolderUrl)
			<<addOnOff ("Web server", inetd.isDaemonRunning (@user.inetd.config.http))
			<<add ("Port: " + user.inetd.config.http.port)
local (mailtext = "", indentlevel = 0);
local (fldebug = false); //should false except when you're working on the script
on add (s) {
	mailtext = mailtext + string.filledstring ("   ", indentlevel) + s + "\r\n"};
on addOnOff (label, bool) {
	local (s = label + ": ");
	if bool {
		s = s + "On"}
	else {
		s = s + "Off"};
	add (s)};

add ("Radio UserLand configuration on " + clock.now () + "."); indentlevel++;
add ("");
bundle { //Installation information
	add ("Installation information:"); indentlevel++;
	add ("");
	add ("Radio version: " + Frontier.version ());
	local (os = "Windows");
	if system.environment.isMac {
		if system.environment.isCarbon {
			os = "Mac OS X"}
		else {
			os = "Mac OS"}};
	add ("Operating System: " + os);
	local (osVersion = system.environment.osVersionString);
	if system.environment.isCarbon {
		osVersion = string.replace (osVersion, "16", "10")};
	add ("OS Version: " + osVersion);
	add ("IP address: " + tcp.dns.getMyDottedId ());
	add ("Radio folder: " + file.folderfrompath (frontier.getprogrampath ()));
	add (""); indentlevel--};
bundle { //About you and your computer
	add ("About you and your computer:"); indentlevel++;
	add ("");
	add ("Name: " + user.prefs.name);
	if defined (user.radio.prefs.usernum) {
		add ("Usernum: " + user.radio.prefs.usernum)}
	else {
		add ("Usernum: [undefined]")};
	add ("Organization: " + user.prefs.organization);
	add ("Mail address: " + user.prefs.mailAddress);
	add ("Outgoing mail server: " + user.prefs.mailHost);
	add ("Web server folder: " + user.radio.prefs.wwwFolder);
	addOnOff ("Web server", inetd.isDaemonRunning (@user.inetd.config.http));
	add ("Port: " + user.inetd.config.http.port);
	addOnOff ("Web server (5335)", inetd.isDaemonRunning (@user.inetd.config.http2));
	add ("Log folder: " + user.log.prefs.folder);
	add (""); indentlevel--};
bundle { //Weblog prefs
	if defined (weblogData) {
		local (adrBlog = @weblogData);
		bundle { //Basic info
			add ("Weblog -- Basic info:"); indentlevel++;
			add ("");
			add ("Title: " + adrblog^.prefs.title);
			add ("Description: " + string (adrblog^.prefs.description));
			add ("Your name: " + adrblog^.prefs.authorName);
			add ("Mail address: " + adrblog^.prefs.authorMailAddress);
			add ("Home page path: " + adrblog^.prefs.homePageFilePath);
			add ("RSS file path: " + adrblog^.prefs.rssFilePath);
			add ("Number of days on home page: " + adrblog^.prefs.ctDaysToDisplay);
			add ("Number of items on editing page: " + adrblog^.prefs.viewing.ctPosts);
			addOnOff ("List your weblog on the UserLand updates page", adrblog^.prefs.flPublicBlog);
			addOnOff ("Show category checkboxes on editing page", adrblog^.prefs.flCategoryCheckboxes);
			add (""); indentlevel--};
		bundle { //Mail-to-weblog
			add ("Weblog -- Mail-to-Weblog:"); indentlevel++;
			add ("");
			addOnOff ("Enabled", weblogData.prefs.mailPosting.enabled);
			add ("POP server: " + weblogData.prefs.mailPosting.server);
			add ("Account name: " + weblogData.prefs.mailPosting.account);
			add (""); indentlevel--}}};
bundle { //Safety and performance
	add ("Safety and performance:"); indentlevel++;
	add ("");
	addOnOff ("Save changed databases every minute", user.radio.prefs.flSaveDatabasesEveryMinute);
	add (""); indentlevel--};
bundle { //Aggregator
	add ("News reading and scanning:");  indentlevel++;
	add ("");
	if defined (aggregatorData) {
		addOnOff ("Enabled", aggregatorData.prefs.enabled);
		add ("Scan at x minutes into the hour: " + aggregatorData.prefs.minuteToRead);
		add ("# stories on home page: " + user.radio.prefs.ctStoriesOnNewsPage);
		add ("# Channels to read at once: " + aggregatorData.prefs.maxThreads);
		addOnOff ("Cache stories list", user.radio.prefs.flCacheNewsItemsPage);
		addOnOff ("Delete old stories", aggregatorData.prefs.flArchive);
		add ("Archive stories older than: " + aggregatorData.prefs.hoursBeforeArchive);
		add ("Delete old stories at x minutes into the hour: " + aggregatorData.prefs.minuteToArchive);
		addOnOff ("Archive as XML", aggregatorData.prefs.flSaveArchiveXmlFiles);
		addOnOff ("Maintain subscriptions.opml", user.radio.prefs.flSaveServicesXml);
		addOnOff ("Checkboxes checked by default", user.radio.prefs.flNewsPageDeleteCheckboxesDefault);
		if defined (aggregatorData.trash) {
			add ("# items in trash: " + sizeOf (aggregatorData.trash))};
		if defined (aggregatorData.stories) {
			add ("# items in stories: " + sizeOf (aggregatorData.stories))};
		if defined (aggregatorData.services) {
			add ("# items in stories: " + sizeOf (aggregatorData.services))}};
	add (""); indentlevel--};
bundle { //Remote access
	add ("Remote access: "); indentlevel++;
	add ("");
	addOnOff ("Remote access enabled", user.radio.prefs.security.allowRemoteViewing);
	addOnOff ("Remote posts enabled", user.radio.prefs.security.allowRemotePost);
	addOnOff ("Remote access security", user.radio.prefs.security.requireRemoteLogin);
	add ("Remote access username: " + user.radio.prefs.security.remoteUsername);
	<<add ("Remote access password: " + user.radio.prefs.security.remotePassword)
	add (""); indentlevel--};
<<bundle //Hourly tasks
	<<add ("Hourly tasks:"); indentlevel++
	<<add ("")
	<<add ("Scan for news at " + myUserLandData.prefs.minuteToDoHourlyScan + " minutes into the hour.")
	<<add ("Scan for new sources at " + myUserLandData.prefs.minuteToReadServiceLists + " minutes into the hour.")
	<<add ("Get Weblogs.Com changes at " + myUserLandData.prefs.minuteToReadWeblogsCom + " minutes into the hour.")
	<<add (""); indentlevel--
bundle { //Downloads
	add ("Downloading enclosures:"); indentlevel++;
	add ("");
	addOnOff ("Download enclosures overnight", user.radio.prefs.enclosures.flDownloadsEnabled);
	add ("Start downloading at " + user.radio.prefs.enclosures.hourToStartDownloads + " AM.");
	add ("Stop downloading at " + user.radio.prefs.enclosures.hourToStopDownloads + " AM.");
	addOnOff ("Create outline", user.radio.prefs.enclosures.flOutlineEnclosures);
	add ("Folder: " + user.radio.prefs.enclosures.enclosureFolder);
	if defined (weblogData) {
		addOnOff ("Add enclosures to your own channels", weblogData.prefs.flEnclosureField)};
	add (""); indentlevel--};
bundle { //Logging
	add ("Event logging:"); indentlevel++;
	add ("");
	addOnOff ("Logging", user.radio.prefs.flAddToDailyLogDatabase);
	addOnOff ("New sources", user.radio.prefs.flLogNewSources);
	<<addOnOff ("Please notify", user.radio.prefs.flLogPleaseNotify)
	<<addOnOff ("Hourly scan", user.radio.prefs.flLogHourlyScan)
	<<addOnOff ("Channel change", myUserLandData.prefs.flLogChannelChange)
	addOnOff ("Nightly update", user.radio.prefs.flLogNightlyUpdate);
	<<addOnOff ("Enclosure download", myUserLandData.prefs.flLogEnclosureDownloads)
	<<addOnOff ("Archive", myUserLandData.prefs.flLogArchiveStories)
	addOnOff ("Weblog publish", user.radio.prefs.flLogWeblogPublish);
	<<addOnOff ("Weblogs.Com", myUserLandData.prefs.flLogWeblogsComRead)
	<<addOnOff ("Upstream", user.playlist.data.upstream.logging)
	add (""); indentlevel--};
bundle { //RSS output
	add ("RSS output files:"); indentlevel++;
	add ("");
	if defined (weblogData) {
		add ("Managing editor: " + weblogData.prefs.managingEditor);
		add ("Webmaster: " + weblogData.prefs.webmaster);
		add ("Maximum items per channel: " + weblogData.prefs.maxOutputItemsPerChannel)};
	add (""); indentlevel--};
bundle { //Proxy server
	add ("Proxy server:"); indentlevel++;
	add ("");
	add ("Domain: " + user.webbrowser.proxy.domain);
	add ("Port: " + user.webbrowser.proxy.port);
	add ("Username: " + user.webbrowser.proxy.username);
	<<add ("Password: " + user.webbrowser.proxy.password)
	add (""); indentlevel--};
bundle { //Upstreaming
	add ("Upstreaming servers:"); indentlevel++;
	add ("");
	addOnOff ("Upstreaming", user.radio.prefs.upstream.enabled);
	add ("Folder: " + user.radio.prefs.upstream.folder);
	addOnOff ("Logging", user.radio.prefs.upstream.logging);
	<<add ("Account (email address): " + user.playlist.prefs.account.email)
	<<add ("Password: " + user.playlist.prefs.account.password)
	<<add ("Server: " + playlist.data.upstream.server)
	<<add ("Port: " + playlist.data.upstream.port)
	<<add ("Procedure: " + playlist.data.upstream.saveprocedure)
	local (adr);
	for adr in @user.radio.prefs.upstream.servers {
		local (name = nameOf (adr^));
		add ("");
		add ("Server: " + name);
		try {add ("XML URL: " + adr^.serverCapabilities.xmlFolderUrl)};
		try {add ("Folder URL: " + adr^.serverCapabilities.yourUpstreamFolderUrl)}};
	add (""); indentlevel--};
<<bundle //Miscellaneous
	<<add ("Miscellaneous:"); indentlevel++
	<<add ("")
	<<add ("Number of news items on home page: " + myUserLandData.prefs.ctStoriesOnHomePage)
	<<add ("Service list URL: " + myUserLandData.serviceLists.userlandAggregator)
	<<add ("Glossary URL: " + myUserLandData.prefs.glossaryUrl)
	<<add (""); indentlevel--
bundle { //Installed tools
	add ("Installed tools:"); indentlevel++;
	add ("");
	local (adrItem);
	for adrItem in @user.tools.databases {
		if adrItem^.flInstalled {
			add (nameOf (adrItem^))}};
	add (""); indentlevel--};
bundle { //Open Databases
	add ("Open Databases:"); indentlevel++;
	add ("");
	on visit (f) {
		local (fname = file.fileFromPath (f));
		local (folder = file.folderFromPath (f));
		local (folderName = file.fileFromPath (folder));
		folderName = string.popTrailing (folderName, file.getPathChar ());
		local (size = string.megabyteString (file.size (f)));
		add (folderName + "/" + fname + ": " + size)};
	table.visitOpenDatabases (@visit);
	add (""); indentlevel--};
bundle { //Tools folder contents
	add ("Tools folder:"); indentlevel++;
	add ("");
	local (f);
	fileloop (f in Frontier.tools.getToolsFolderPath ()) {
		local (fname = file.fileFromPath (f));
		local (size = string.megabyteString (file.size (f)));
		add (fname + ": " + size)};
	add (""); indentlevel--};
bundle { //agents
	add ("Agents:"); indentlevel++;
	add ("");
	local (adrItem);
	for adrItem in @system.agents {
		add (nameOf (adrItem^))};
	add (""); indentlevel--};
bundle { //threads
	add ("Threads:"); indentlevel++;
	add ("");
	local (adrItem);
	for adrItem in @user.scheduler.threads {
		local (flDefined = true, flEnabled = true);
		if not defined (adrItem^) {
			flDefined = false}
		else {
			if not (adrItem^^.enabled) {
				flEnabled = false}};
		local (threadName = nameOf (adrItem^));
		if not flDefined {
			add (threadName + ": [not defined]")}
		else {
			if not flEnabled {
				add (threadName + ": [disabled]")}
			else {
				add (threadName + ": " + adrItem^)}}};
	add (""); indentlevel--};
bundle { //XML-RPC
	add ("XML-RPC:"); indentlevel++;
	add ("");
	local (ctOutgoingAsynchMessages = 0);
	if defined (user.betty.queueOutgoing.table) {
		ctOutgoingAsynchMessages = sizeOf (user.betty.queueOutgoing.table)};
	addOnOff ("Allow by IP Only", user.betty.prefs.flAllowByIPOnly);
	addOnOff ("Keep Asynch Client Log", user.betty.prefs.flKeepAsynchClientLog);
	addOnOff ("Keep Server Log", user.betty.prefs.flKeepServerLog);
	add ("RPC Client Default Path: " + user.betty.prefs.rpcClientDefaultPath);
	add ("RPC Client Default Timeout: " + user.betty.prefs.rpcClientDefaultTimeout);
	add ("# Pending Asynch Messages: " + ctOutgoingAsynchMessages);
	add ("");
	add ("Handlers:"); indentlevel++;
	add ("");
	local (adr);
	for adr in @user.betty.rpcHandlers {
		local (name = nameOf (adr^));
		local (type = typeOf (adr^));
		local (val = "");
		case type {
			tableType {
				val = sizeOf (adr^) + " items"};
			scriptType {
				val = sizeOf (adr^) + " lines"};
			addressType {
				val = adr^}};
		if val == "" {
			add (name)}
		else {
			add (name + ": " + val)}};
	add ("");
	indentlevel--;
	addOnOff ("RPC2 responder enabled", defined (user.webserver.responders.RPC2.enabled) and user.webserver.responders.RPC2.enabled);
	add (""); indentlevel--};
bundle { //SOAP
	add ("SOAP:"); indentlevel++;
	add ("");
	add ("RPC Client Default Timeout: " + user.soap.prefs.rpcClientDefaultTimeout);
	add ("");
	add ("Handlers:"); indentlevel++;
	add ("");
	local (adr);
	for adr in @user.soap.rpcHandlers {
		local (name = nameOf (adr^));
		local (type = typeOf (adr^));
		local (val = "");
		case type {
			tableType {
				val = sizeOf (adr^) + " items"};
			scriptType {
				val = sizeOf (adr^) + " lines"};
			addressType {
				val = adr^}};
		if val == "" {
			add (name)}
		else {
			add (name + ": " + val)}};
	add ("");
	indentlevel--;
	addOnOff ("SOAP responder enabled", defined (user.webserver.responders.soap.enabled) and user.webserver.responders.soap.enabled);
	add (""); indentlevel--};
bundle { //Responders
	add ("Responders:"); indentlevel++;
	add ("");
	local (adr);
	for adr in @user.webserver.responders {
		local (name = nameOf (adr^));
		while (typeOf (adr^) == addressType) {
			adr = adr^};
		local (flEnabled = adr^.enabled);
		addOnOff (name, flEnabled)};
	add (""); indentlevel--};
bundle { //Webserver stats
	add ("Webserver stats:"); indentlevel++;
	add ("");
	add ("Hits: " + user.webserver.stats.hits);
	add ("Max connections: " + user.webserver.stats.maxConnections);
	add ("Max memory available: " + user.webserver.stats.maxMemAvail);
	add ("Min memory available: " + user.webserver.stats.minMemAvail);
	add ("Up since: " + user.webserver.stats.upSince);
	if defined (user.webserver.stats.wormHits) {
		add ("Worm hits: " + user.webserver.stats.wormHits)};
	add (""); indentlevel--};
bundle { //Webserver prefs
	add ("Webserver prefs:"); indentlevel++;
	add ("");
	add ("Default responder: " + user.webserver.prefs.defaultResponder);
	addOnOff ("Debugging", user.webserver.prefs.fldebug);
	addOnOff ("Domain stats", user.webserver.prefs.flDomainStats);
	addOnOff ("DNS Lookups", user.webserver.prefs.flUseDns);
	add (""); indentlevel--};
bundle { //Webserver prefilters
	add ("Webserver PreFilters:"); indentlevel++;
	add ("");
	local (adrItem);
	for adrItem in @user.webserver.preFilters {
		if typeOf (adrItem^) == addressType {
			add (nameOf (adrItem^) + ": " + adrItem^)}
		else {
			add (nameOf (adrItem^))}};
	add (""); indentlevel--};
bundle { //Webserver postfilters
	add ("Webserver PostFilters:"); indentlevel++;
	add ("");
	local (adrItem);
	for adrItem in @user.webserver.postFilters {
		if typeOf (adrItem^) == addressType {
			add (nameOf (adrItem^) + ": " + adrItem^)}
		else {
			add (nameOf (adrItem^))}};
	add (""); indentlevel--};

if fldebug {
	wp.newTextObject (mailText, @temp.radioConfiguration);
	edit (@temp.radioConfiguration)}
else {
	<<tcp.sendmail (user.prefs.mailAddress, "My Radio Configuration", mailtext)
	tcp.sendmail ("userland-internal@userland.com", "My Radio Configuration", mailtext)}



This listing is for code that runs in the OPML Editor environment. I created these listings because I wanted the search engines to index it, so that when I want to look up something in my codebase I don't have to use the much slower search functionality in my object database. Dave Winer.