Folder entry date for a message

This forum contains features that has been archived. This section contains implemented features, duplicate requests, and requests which we have decided not to implement.
Post Reply

Do you need this feature?

Yes
5
71%
No
2
29%
 
Total votes: 7

philip
New user
New user
Posts: 20
Joined: 2005-10-19 01:02

Folder entry date for a message

Post by philip » 2006-01-12 02:17

I would like for there to be a property on a message that tells me the date the message was first placed in its current folder. This will allow me to delete messages that have been in a folder for a specific amount of time using a script.

For example, a user deletes and e-mail which goes to the Deleted Items folder. After two weeks this message is automatically removed from the system with a script -> http://www.hmailserver.com/forum/viewtopic.php?t=3039

Currently I use the message creation date so if someone deletes a message from their inbox that is 2+ weeks old, it is removed from the system the next time the script runs, instead of staying in Deleted Items for two weeks.

Thanks for your hard work!

chrislees
Normal user
Normal user
Posts: 63
Joined: 2006-11-04 18:30
Location: UK

Post by chrislees » 2006-11-22 14:17

Yes, I would find this useful. When a message is received from a host with an incorrect date (for example, you must have had messages dated 1 Jan 1970) then my nightly script to remove junk/spam and deleted mails over 20 days old removes badly dated messages on the first night.

I have been thinking of writing a script to run during the OnAccept event that rewrites the date to Now() if the date on the message is more than 19 days out of date but a) I haven't got around to it, and b) I don't really want to mess with characteristics of the message that originated with the sender (just doesn't seem right).

^DooM^
Site Admin
Posts: 13861
Joined: 2005-07-29 16:18
Location: UK

Post by ^DooM^ » 2006-11-22 14:51

Maybe you could add a custom header to all incoming emails instead of messing with the date that's already on there then just iterate through the emails as you already do but look for your custom header date instead.

chrislees
Normal user
Normal user
Posts: 63
Joined: 2006-11-04 18:30
Location: UK

Post by chrislees » 2006-11-22 21:47

Nice.

I can never see the wood for the trees. Far too literally minded. That would work perfectly.

^DooM^, you strike me as just the person to ask. Are there any standards I ought to follow when decided how to name the header. Any suggestions to avoid complicating other mail systems etc should the message containing such a header ever be forwarded after passing through my hMailServer with this (future) script running?

^DooM^
Site Admin
Posts: 13861
Joined: 2005-07-29 16:18
Location: UK

Post by ^DooM^ » 2006-11-22 22:09

I am not 100% sure but the normal extra added headers start with X- then whatever name you want to give it

So to that end you could use something like X-Incoming-Date as your custom header. I am pretty sure all email servers ignore headers that start with X- (Unless specifically looking for something) and it is done this way for the very reason you were concerned about.

chrislees
Normal user
Normal user
Posts: 63
Joined: 2006-11-04 18:30
Location: UK

Post by chrislees » 2006-11-22 22:22

Cheers, I had already started work and called it LocallyProcessedDate, so perhaps I'll just amend that to X-LocallyProcessedDate.

^DooM^
Site Admin
Posts: 13861
Joined: 2005-07-29 16:18
Location: UK

Post by ^DooM^ » 2006-11-22 22:59

Sounds like the way to go. :)

User avatar
martin
Developer
Developer
Posts: 6834
Joined: 2003-11-21 01:09
Location: Sweden
Contact:

Post by martin » 2006-12-07 22:39

In hMailServer 4.4, there will be a property called InternalDate of the message. This property will return the creation-time of the email message. (The time the message was added to the hMailServer database)

Post Reply