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

RE: SMTP file naming issue?


As I dug through my problem earlier this month, I found it was more
about not having a log entry matching incoming message filename with
message spoolid.  My external processes (MailScanner in particular),
would create a new file and place it back in the queue for further
processing.  Inode and mtime are now different, zmailer sees the
original inode is now available, its next message gets that inode, and
now I can't tell what's coming or going!  Carlos' suggestion put me on
the right track to address that.

The issue of same inode and mtime (to ms) is only a minor annoyance and
since I'm on Linux I'll just live with that given it is pretty rare.
Nice to understand why it's happening and not indicative of a bug.

While I was working on this, I wrote a quick and dirty wrapper around
taspoolid.c to accept a filename and return spoolid calculation.  

Would you consider adding to the distribution?  Perhaps in the utilities
section?  I compile with:

gcc -o zmspid -include zmailer/lib/taspoolid.c zmspid.c

So, it'd need whatever magic makefile stuff is appropriate as well as a
quick review against your nanosecond changes to ensure there are no
string length incompatibilities.  I'm installing this in $MAILBIN; that
happening automatically at "make install" time would be an extra bonus!



-----Original Message-----
From: zmailer-owner@nic.funet.fi [mailto:zmailer-owner@nic.funet.fi] On
Behalf Of Matti Aarnio
Sent: Thursday, June 29, 2006 4:59 AM
To: Neal Morgan
Cc: zmailer@nic.funet.fi
Subject: Re: SMTP file naming issue?

On Fri, Jun 02, 2006 at 11:58:44PM -0700, Neal Morgan wrote:
> Hello Matti!
> I've been watching the files dropped into postoffice/router by
> SMTP sessions and I note the same file name is used several times.
> wondering if this is configurable, or a bug...  I have an external
> process that acts on the messages before the router picks them up for
> delivery.  I'd like to be able to track "chain of custody" per message
> using this file name, but am unable to do so if SMTP reuses the same
> name.

Like it has been told, the spool-id comes from file i-node number plus
its mtime timestamp.

I did finally write and commit codes that use file mtime with nanosecond
resolution, if available.  Now messages that arrive within same second
will still get different mtime timestamps - if chosen filesystem
such a thing..

Lattest Linux does not (I tried only EXT3, others may or may not),
but Solaris 10 UFS does have nanosecond times.

So: If you have a filesystem that supports nanosecond timestamps
    in your spool, the ZMailer spool-id will be unique.

> Regards,
> Neal Morgan

/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