[Raw Msg Headers][Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Where in queue? ;-)

On Sat, May 10, 2003 at 02:06:08AM +0200, Marek Kowal wrote:
> Hi there,
> How do I get to know (and is it possible at all) to get to know the name of
> the directory in postoffice/queue (or postoffice/transport) where the file
> willl be "routed" in process.cf? I need to know the path before calling
> rfc822().

  It all depends on what you want to do with it.

  It is quite deterministic, so there could be a new function, which
  calculates the new path for a given file.  Essentially:

	sprintf(qpath, "../%s/%s%s", QUEUEDIR, subdirhash, file);
	if (... || (erename(file, qpath) != 0)) ...

	sprintf(path, "../%s/%s%s", TRANSPORTDIR, subdirhash, file);
	if (erename(ofpname, path) < 0)

  Where 'file' is input given to the 'rfc822()' function, and
  calculation of  'subdirhash'  is done at the beginning of
  the  sequencer()  function in  router/rfc822.c  file.

  Thinking of that ... looks like use of ZENV variable  ROUTERDIRHASH
  might cause some trouble to the system!   -- or maybe not..
  Apparently the system is calling rename(2) in order to move file
  located in some subdir into primary router directory's root
  when it begins processing.

  That is actually _extra_ work, which could be avoided, but avoiding
  it properly needs carefull code changes all over the place.
  (At least:   router/damemonsub.c, router/rfc822.c )

> Cheers,
> Marek.
> Ps. In worst case I could also get to know it after calling rfc822(), though
> this might create some race condidtion. But any solution will do...

/Matti Aarnio	<mea@nic.funet.fi>
To unsubscribe from this list: send the line "unsubscribe zmailer" in
the body of a message to majordomo@nic.funet.fi