mail-hdrs - Mail Header control

This forum is for discussing Mailtraq's Scripting features. Get help with Mailtraq scripts, templates and external ActiveX scripting.

mail-hdrs - Mail Header control

Postby Martin Clayton » Tue Dec 11th, 2007 2:59pm

This script modifies message headers depending on sender and recipient. Settings are stored in .ini files based on the sender's envelope adddress. The attached notes describe the script so I'll just quote a few configuration examples here:

  1. All messages to have the Precedence header set to 'bulk' and any 'Newsgroups' header deleted -- unless the message is addressed to mary
    Code: Select all
    # mh~all-users.ini


  2. All Dr Jekyll's mail is set to show the recipient address in the From field (aka verp [variable envelope return path] addressing):
    Code: Select all
    # mh~henry.jekyll.ini
    From=Dr H Jekyll <hj-{$rcpt:verp}@{$sender:domain}>

    e.g. Sending to Danvers.Carew generates:
    Code: Select all
    From: Dr H Jekyll <>

    For this scheme the doctor would use a mailslot alias of "hj-*".

  3. If anyone replies to a message from Dilbert, the Cc recipient gets to deal with the response:

    Code: Select all
    # mh~dilbert.ini

    Reply-To={$CC:name} <{$CC}>
    Organization=Teamwork is when other people do your work for you

    With this scheme, Dilbert must remember to Cc a team mate in all messages. If he's particularly busy he could add "From={$CC:name} <{$CC}>" & "CC=".

  4. Add organisation headers to all messages:
    Code: Select all
    # mh~@all-users.ini

    Organization=Chaos Prison
    X-Company-Registration=Company 123456, VAT Reg GB 1234 5678 91
    X-Company-Address=Swing House, Garage, London EC1
    X-Company-Contact=Tel +44 123 4567 8910 email:
    X-Company-Disclaimer=Critical warning! This notice has no value


  5. Set verp-style addressing for all messages from all users, use sender-specific, date-based logging:

    Code: Select all
     # mh~@all-users.ini

    From={$From:name} <{$sender:user}-{$rcpt:verp}@{$sender:domain}>


I've been using it primarily for mail-id over the last few months - without any known issues, yet. If anyone wants to give it a go, post here with any questions on installation, configuration, etc.

Cheers, Martin
mail-hdrs.mtq 0.9 20-11-2007
mail-hdrs.txt 0.9
(14.59 KiB) Downloaded 748 times
User avatar
Martin Clayton
Expert User
Posts: 529
Joined: Sat Jan 15th, 2005 8:20am
Location: London, UK

Return to Mailtraq Scripting

Who is online

Users browsing this forum: No registered users and 2 guests