Wayne Conrad writes:
Given a queue ID that I got from mailq, how can I get the content of the email, or identify which file I could read to get the content? Thanks.
The three parts of the queue ID are in hexadecimal. First, convert them to decimal:
00000000002811AD.[something else] This becomes: 2625965.[something else] The first part gives you the filename directly: # ls -al /var/spool/courier/msgs/65/D2625965 -rw-rw---- 1 mrsam daemon 625 Jun 5 18:44 /var/spool/courier/msgs/65/D2625965"D" plus the first part gives you the filename. The subdirectory under msgs is always the last two characters of the full filename.
Now, you have to be very careful here. The first part of the queue ID is actually the inode number of the D file. Its theoretically possible for the message getting delivered and removed from the queue, and a new message getting created whose D file ends up getting the same inode number, between the time you read the output of mailq, and the time you get around to reading the contents of the D file. Entirely possible. Very unlikely, but the changes of that happening are not a mathematical zero.
So, after you open the D file, and look at it, in order to prove that this has not occured, /after/ looking at the D file you need to open the corresponding C file and look for the line that starts with the 'M' character, which will have the complete queue ID, as shown by mailq. This will prove that between the time you read the output of mailq, and the time you read the C file, the message wasn't switched out from under you.
If you can't open the D file, or you can't open the C file, or the 'M' line in the C file is something else, whatever you just did is no longer relevant. The cancel command is going to fail, because the current message in the queue is going to have the same first part, but different 2nd and 3rd parts.
pgpRv5xqDer21.pgp
Description: PGP signature
------------------------------------------------------------------------------ Learn Graph Databases - Download FREE O'Reilly Book "Graph Databases" is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/NeoTech
_______________________________________________ courier-users mailing list courier-users@lists.sourceforge.net Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users