Lloyd Zusman writes:

However, I'm looking for the actual queue ID, as shown in the mailq
command:

IIIIIIII.TTTTTTTT.PPPPPPPP

... where IIIIIIII is the control file inode in hex
          TTTTTTTT is the injection time in hex
          PPPPPPPP is the pid in hex

I presume that I can generate this second ID by taking the injection
time and pid from the first ID and converting to hex, and by taking the
hex representation of the inode of the control file whose name is
specified with the full pathname returned by
SubmitFile::name1stctlfile().

Is that correct?

This is the code in submit2.C that generates the queue ID:

â
               << COMCTLFILE_MSGID << ino_buf << '.' << basemsgid << endl;
â

ino_buf is the control file's inode number.  basemsgid is generated a few
lines earlier, like this:

       char    time_buf[sizeof(time_t)*2+1];
       char    pid_buf[sizeof(time_t)*2+1];
       char    msgidbuf[sizeof(time_buf)+sizeof(pid_buf)];

               ctltimestamp=stat_buf.st_mtime;
               ctlpid=getpid();

               strcat(strcat(strcpy(msgidbuf,
                       libmail_strh_time_t(ctltimestamp, time_buf)), "."),
                       libmail_strh_pid_t(getpid(), pid_buf));

basemsgid=msgidbuf;

So the control file is used as the source for the inode and the timestamp;
the process ID is submit's process ID.



Attachment: pgp00000.pgp
Description: PGP signature

Reply via email to