Mailing List Archive

[Bug 2956] util to convert message id to human-readable time
https://bugs.exim.org/show_bug.cgi?id=2956

Andrew Aitchison <exim@aitchison.me.uk> changed:

What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED

--- Comment #1 from Andrew Aitchison <exim@aitchison.me.uk> ---
exim/test/runtest munges test output. Lines 496-499 say:
# Dates and times are all turned into the same value - trying to turn
# them into different ones cannot be done repeatedly because they are
# real time stamps generated while running the test. The actual date and
# time used was fixed when I first started running automatic Exim tests.

... which makes the test suite almost useless for this application, though we
can still use it to test command line arguments.

I may attempt to add an option to the test suite to disable this feature :-(

--
You are receiving this mail because:
You are on the CC list for the bug.
--
## List details at https://lists.exim.org/mailman/listinfo/exim-dev Exim details at http://www.exim.org/ ##
[Bug 2956] util to convert message id to human-readable time [ In reply to ]
https://bugs.exim.org/show_bug.cgi?id=2956

--- Comment #2 from Jeremy Harris <jgh146exb@wizmail.org> ---
Hmm, yes, that will indeed make the testsuite awkward.

That's the right set of lines to be bypassing in runtest.
Options are parsed around line 3060.
Add a bit in README about the optinn you invent.

--
You are receiving this mail because:
You are on the CC list for the bug.
--
## List details at https://lists.exim.org/mailman/listinfo/exim-dev Exim details at http://www.exim.org/ ##
[Bug 2956] util to convert message id to human-readable time [ In reply to ]
https://bugs.exim.org/show_bug.cgi?id=2956

--- Comment #3 from Andrew Aitchison <exim@aitchison.me.uk> ---
I have a patch ready to submit, but I am not sure what to call the utility.
My working name is exim_msgdate but it should really have "msgid" in it.
eximmsgiddate has doubled letters in the wrong places.
Existing tools start with
exi_ (exim_checkaccess exim_dbmbuild exim_dumpdb exim_fixdb exim_lock
exim_msgdate eximstats exim_tidydb)
exi (exicyclog exigrep exinext exipick exiqgrep exiqsumm exiwhat)
or exim (eximstats)
so perhaps exi_msgid_date ?


----------------------------


I have had to use the new (to exim build) feature ${parameter:-word} in the
make shell script of src/OS/Makefile-Base.
What shells are used inside make on the various platforms ?

set BASE_62=36
echo BASE_62 | sed -e "s?BASE_62?${BASE_62:-62}?"
gives 36 on the shells I've tested (bash, dash = sh, ksh on Ubuntu 22:10 and
bash and sh on RedHat 6!) but these are modern, posix-type shells.

Can anyone test this on the other platforms on the build farm ?
Use

Or should I just submit the patch as it is ?

--
You are receiving this mail because:
You are on the CC list for the bug.
--
## List details at https://lists.exim.org/mailman/listinfo/exim-dev Exim details at http://www.exim.org/ ##
[Bug 2956] util to convert message id to human-readable time [ In reply to ]
https://bugs.exim.org/show_bug.cgi?id=2956

--- Comment #4 from Andrew Aitchison <exim@aitchison.me.uk> ---
Oops. Accidentally submitted the previous comment prematurely.
Part 2 should have included the suggestion:

Use
echo BASE_62 | sed -e "s?BASE_62?$${BASE_62:-62}?"
with doubled $ if you test inside a Makefile.

Still interested in thoughts on the utilitiy's name.

--
You are receiving this mail because:
You are on the CC list for the bug.
--
## List details at https://lists.exim.org/mailman/listinfo/exim-dev Exim details at http://www.exim.org/ ##
[Bug 2956] util to convert message id to human-readable time [ In reply to ]
https://bugs.exim.org/show_bug.cgi?id=2956

--- Comment #5 from Andrew Aitchison <exim@aitchison.me.uk> ---
Created attachment 1435
--> https://bugs.exim.org/attachment.cgi?id=1435&action=edit
exim_msgdate utility

Thought I might as well give you the patch.

--
You are receiving this mail because:
You are on the CC list for the bug.
--
## List details at https://lists.exim.org/mailman/listinfo/exim-dev Exim details at http://www.exim.org/ ##
[Bug 2956] util to convert message id to human-readable time [ In reply to ]
https://bugs.exim.org/show_bug.cgi?id=2956

--- Comment #6 from Jeremy Harris <jgh146exb@wizmail.org> ---
- It's using a hardwired config file path, at least in the testsuite.
Noticing the -C the testharness gave it would be good; but for production
use - how about using `exim -bP localhost_number' as a default for
no "-C foo" given?

- I like single-char options where feasible, at least for common-use ones.
Maybe "-z" as an alternate for --zulu, as sed bu exim_dumpdb?
Also the help text should define the default.

- On the name, I'm easy. exim_msgdate is as good as any.

- Makefile/shell syntax - we'll run with that until we find a platform
that can't handle it.

- Are you OK with GPLv2-or-later? Needs an SPDX line.

- Some verbiage in doc/doc-doc-book/spec.xfpt please.

--
You are receiving this mail because:
You are on the CC list for the bug.
--
## List details at https://lists.exim.org/mailman/listinfo/exim-dev Exim details at http://www.exim.org/ ##
[Bug 2956] util to convert message id to human-readable time [ In reply to ]
https://bugs.exim.org/show_bug.cgi?id=2956

--- Comment #8 from Jeremy Harris <jgh146exb@wizmail.org> ---
(In reply to Andrew Aitchison from comment #7)
> > It's using a hardwired config file path, at least in the testsuite.
> > Noticing the -C the testharness gave it would be good;
>
> I've got that working, which confuses me. I had expected that to pass one of
> the configs in test/confs/

It does; the one you supplied as confs/0700 - but the code picks up
the -C option and ignores it.

The hardcoded file is just after a commented-out "die".

>
> > but for production use - how about using `exim -bP localhost_number'
> > as a default for no "-C foo" given?
>
> That makes some sense, but exim_msgtime has perl taint set, so I cannot
> easily run a binary by name given as an argument.

I was assuming exim in $PATH - but I don't know how perl taint restricts
that.

> Also, do we know the name of the exim executable at make time ?
> I think $(BIN_DIRECTORY) gives us the path, but Debian and Ubuntu change the
> name to exim4.

Sigh, good point. Maybe yet another build-config item, to handle such
bloody-awkward distros (Exim version 3 was twenty years ago, dammit).
But given the below, moot.

> It isn't working in attachment 1435 [details], but after a bug-fix, the
> build now correctly writes the configfile list into the script and I can
> search that for localhost_number.

That'll be fine apart from the testsuite, which needs the -C value to
take precedence.

--
You are receiving this mail because:
You are on the CC list for the bug.
--
## List details at https://lists.exim.org/mailman/listinfo/exim-dev Exim details at http://www.exim.org/ ##
[Bug 2956] util to convert message id to human-readable time [ In reply to ]
https://bugs.exim.org/show_bug.cgi?id=2956

John Jetmore <jj33@pobox.com> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |jj33@pobox.com

--- Comment #9 from John Jetmore <jj33@pobox.com> ---
(In reply to Jeremy Harris from comment #8)
> (In reply to Andrew Aitchison from comment #7)
>
> > Also, do we know the name of the exim executable at make time ?
> > I think $(BIN_DIRECTORY) gives us the path, but Debian and Ubuntu change the
> > name to exim4.
>
> Sigh, good point. Maybe yet another build-config item, to handle such
> bloody-awkward distros (Exim version 3 was twenty years ago, dammit).
> But given the below, moot.

I perked up at this because I thought it was a perl question I could help with
but I now realize it's not. Apologies if I am addressing a different issue
than what is asked.

I think what you are saying is "exim_msgdate needs to call exim, which it
refers to as 'BIN_DIRECTORY/exim', with BIN_DIRECTORY getting replaced by the
build process. Therefore how does the build process handle distros that use a
different binary name than exim4"

Assuming I read that right, the correct answer is it's not the exim distro's
problem. There are already tools like this (see exiqgrep.src), and they are
handled by the packager who chooses to change the binary name, as is proper
(see https://sources.debian.org/src/exim4/4.96-13/src/exiqgrep.src/ which
refers to BIN_DIRECTORY/exim4)

--
You are receiving this mail because:
You are on the CC list for the bug.
--
## List details at https://lists.exim.org/mailman/listinfo/exim-dev Exim details at http://www.exim.org/ ##
[Bug 2956] util to convert message id to human-readable time [ In reply to ]
https://bugs.exim.org/show_bug.cgi?id=2956

Jasen Betts <jasen@treshna.com> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |jasen@treshna.com

--- Comment #10 from Jasen Betts <jasen@treshna.com> ---
Debian provides /usr/sbin/exim as a symlink to /usr/sbin/exim4. so you probably
don't need to worry about exim4 because "exim" should work for most purposes.

--
You are receiving this mail because:
You are on the CC list for the bug.
--
## List details at https://lists.exim.org/mailman/listinfo/exim-dev Exim details at http://www.exim.org/ ##