Article View: news.software.readers
Article #262836Re: [dialog] Set the header date to a different TIMEZONE than the machine time zone?
From: R Radev
Date: Sun, 02 Sep 2018 08:26
Date: Sun, 02 Sep 2018 08:26
154 lines
8045 bytes
8045 bytes
Bernd Rose <b.rose.tmpbox@arcor.de> - 2018/09/02 > I'm not convinced, that your intentions really are beneficial (or at least > non-harmful) to the Usenet. But since there are several obvious ways (some > of them already pointed out by you) to spoof the timezone information, and > you /may/ need to cover participation in a political discourse from an > undemocratic government or the like, I'll give you some loose pointers: Thanks Bernd for suggesting a possible timezone setting method in Dialog. Note that I've roughly duplicated your headers simply by way of example. (I didn't bother getting an Albasani account although I could have if I had enough time to obtain one before sending this message out as an example.) I can already change the time zone manually from within Windows, so what I simply need is to figure out the best way to get Dialog to change the time zone. NOTE: I'm using Dialog for this message. As far as I know, the easiest non-Dialog way to change JUST the timezone on Windows 10 is to have dialog run a simple script such as this one. @echo off REM tzset_tehran.bat C:\Windows\System32\tzutil.exe /s "Iran Standard Time" exit Where it's easy to check the current time zone using something like echo off REM tzlist_current.bat C:\Windows\System32\tzutil.exe /g pause exit As far as I can tell, this causes absolutely zero problems for Usenet since the local time in the newly set timezone automatically adjusts perfectly. The question is how to get Dialog to run that script, I guess, if that's the only way the system timezone can be changed from within Dialog. NOTE: I do not want to set the whole static date like I did with the message id of this message, so I have no intention of manually setting the entire Date header (although I certainly can do that - it's not elegant in the least and it's too manual). I guess I could have dialog figure out the system time though, and THEN set the date header based on the current system time and the desired time zone. Is _that_ what you're suggesting? > OnBeforeSendingMessage can not only be used to delete headers, but also > to modify them. I have never been able to get the time-zone related headers modified in OnBeforeSendingMessage without having to change the _entire_ Date header (which isn't what I want unless that's the _only_ way to set the timezone from inside of Dialog). Certainly OnBeforeSendingMessage can easily delete (and reset as desired) the following local headers such that they are never sent to the nntp server by Dialog. 'Date: ' 'User-Agent: ' 'Message-ID: ' 'Mime-Version: ' 'Content-Type: ' 'Content-Transfer-Encoding: ' But unless you explicitly set the entire date (which isn't the question), I have never found a way yet to change JUST the timezone that Dialog reports to the nntp server from within OnBeforeSendingMessage scripts. I should repeat that I have zero intention to set the entire date field. I only want to change the timezone. Nothing else. The time and date should AUTOMATICALLY set themselves based on the TZ. > You'd need to modify the timezone offset as well as the > hour part to get consistent information. I apologize for not being clear in that I have no intention to change the time or date. I ONLY want to set the TIMEZONE. Nothing else. As noted, I can easily do this OUTSIDE of Dialog (using tzutil.exe). I'm just asking for a way to do it INSIDE of Dialog. > And if you cross midnight doing > so, you'd need to adjust date information (including the weekday string), > as well. The Dialog Script Library may give you some ideas: > > http://dialog.datalist.org/scripts/script_library.html I've been there MANY times. Many many many times. For example, this removes any of those easily removed headers. http://dialog.datalist.org/scripts/RemoveAnyHeader.html And this changes a header: http://dialog.datalist.org/scripts/ScriptChangeheader.html And this customizes the user agent: http://dialog.datalist.org/scripts/CustomizeUserAgent.html As I said, I can remove & statically set any of these default headers: 'Date: ' 'User-Agent: ' 'Message-ID: ' 'Mime-Version: ' 'Content-Type: ' 'Content-Transfer-Encoding: ' The problem is setting JUST the time zone. I don't want to set the date. Of course _that_ would work to set the date manually. I guess I could script a lookup that figures out the current date and then given the desired GMT offset it writes the date code exactly for each message. Is _that_ what you suggest? Allow me to be clear that I didn't want to do that - but is that what you're suggesting which is to write a script that figures out the current date and then which applies its own offset to that current date and sends that static date as a STATIC Date header? > There have been versions of the nFilter news proxy program around, which > supported the modification of /outgoing/ messages as well as incoming. > There may be other tools available, doing the same. I am not sure what NFilter does, but I already have no problem modifying outgoing messages with STATIC complete headers such as the Date header. But I don't want to write a STATIC date header if I can avoid it. I just want to change the TIMEZONE that Dialog uses when communicating to the nntp news server. The question is whether that is possible or not. > If you run Dialog inside a virtual machine, you can set its date to > whatever timezone you like. - Independently to your main (host) machine. Yes. Agreed. It's easier though to just set the TimeZone using the Windows tzutil.exe command since it can be placed in a batch script. I just got an idea though. Maybe I can get OnBeforeSendingMessage to run that batch script to set the system timezone (tzset_tehran.bat) and then, after the message is sent, then Dialog could reset the system timezone back to the original (tzset_london.bat)? Would you suggest that approach? > Dialog .84 is in Alpha state with no real functional updates Thanks for that advice. I can use any Dialog and I've been using the current version for many years, but if it crashes too much, I can change the version without any problems whatsoever. Thanks for that advice.
Technical Details
Message-ID:
<000wbldbyre5s.dlg@b.rose.tmpbox.news.arcor.de>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.(126883).mbox.7z!not-for-mailReferences:
<pmfd3c$uop$1@neodome.net> <176wbldbyre5s.dlg@b.rose.tmpbox.news.arcor.de>Show Full Headers
Complete Article Headers
Message-ID: <000wbldbyre5s.dlg@b.rose.tmpbox.news.arcor.de> Subject: Re: [dialog] Set the header date to a different TIMEZONE than the machine time zone? Date: Sun, 2 Sep 2018 10:26:26 +0200 From: R Radev <rradev098765@blizoo.bg> References: <pmfd3c$uop$1@neodome.net> <176wbldbyre5s.dlg@b.rose.tmpbox.news.arcor.de> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.(126883).mbox.7z!not-for-mail Newsgroups: news.software.readers Organization: albasani.net Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Injection-Info: neodome.net; posting-account="TrGds/Nd8yKV3VYlBOrr9Kc77Q9UtwSMdtLAvTh63MNuKIymI4spJm0+oz Awcb/6vySUjEDzkuj2qttk0GJAR2eD6h3+rhFM26SSPkMdoYIupvyahWvEs82yHD78EUtIC/GF9 9sGjt3Qb/mbhGNDaPsZTbps3YoGwhpzXfwiUEXcjVeTQXDJtQLe2gkeezN/OI1s1vlOLiesBXWA 9/dJfKOHRWKTGwDYhNKyvnRgTXhvuUnnB1zxwYP1CqmLJc32XmsVtXq7EXlnwOSHtXt2wXsc09M EsVF/lfb0esN3zUK+mPU4Ddoww4CL9OXs58du4pSRk5BPu+rUQW3CWEGYEw=="; posting-host="jVi1+NI4uM5kNu6yJFQAaI784z0ZyvpRZGdZgS7x3u5kSwBVH+oTetHmVDgxz 2DrlAgFEUHjzpFhclwwFn67uRLSop3MEDHs1GAx+Uu/1s/ApntO7W+TK7XEZahoiXYpMYfGFb/i zsZEqHwm9hscFU0D+lYGAxoqSrgpyKx25t89/b9VpDsDHIAL5OHnmhOGhwOzxuXiXSJM27X7w/9 ivw59ULWIqjv5NUUic8IWyK2tvi0K6L3C3CZfVLsGS2msFV7ktqKKEmb5UAG0bCYpHFib99fudP LkQ8YZXfVsOFd1kpocG51B/5iecu5k27HCu7Fk94prcPnXZER08kMg5w=="; logging-data="7783"; mail-complaints-to="abuse@neodome.net" User-Agent: 40tude_Dialog/2.0.15.41 (1731940b.222.399) X-Received-Bytes: 7987 X-Received-Body-CRC: 3301225071