On 05/13/2014 04:35 PM, Sam Varshavchik wrote: > Wayne Conrad writes: > >> Are there any X-Headers or other mechanisms through which I can cause >> Courier to have a custom queuetime for some emails, such that those >> emails will bounce after one day? > > No, there are no per-message queue lifetime configuration. > > One thing that can be done fairly easy, though, is to write a script > that finds all messages more than a day old, from a particular sender, > and then use the cancelmsg command to bounce them.
Sam, Thanks, and sorry for the late reply. I finally found where our spam filter was putting emails from this list. Your suggestion will work fine: * I can use `mailq -batch` to get the message IDs. * I can use cancelmsg <ID> to cancel a message (but I had to add root to the "daemon" group to get it to work). I thought I was going to have to read the messages in order to identify which ones to cancel, but it turns out that I don't need to: The messages subject to early cancellation have a distinct "from" address. Since mailq gives me the Queue ID, the from address, and the date the message was enqueued, I've got everything I need. But, suppose I did need to read the message, perhaps to examine some headers. How, given a Queue ID, can I get the message? I've tried: * Finding which one of the many courier programs do this. Still looking. * Looking at the files in /var/lib/courier/msgs, but the filenames don't have an obvious relationship to the message IDs shown by mailq. * Looking at the hard links in /var/lib/courier/msgq, but those filenames also don't have an obvious relationship to the message IDs. * I see that the control files have the message ID in them, so I guess I could just read each control file, but that seems clunky and wasteful. 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. -- Wayne Conrad ------------------------------------------------------------------------------ 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 [email protected] Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users
