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 example.com have the Precedence header set to 'bulk' and any 'Newsgroups' header deleted -- unless the message is addressed to mary @example.com.
    Code: Select all
    # mh~all-users.ini

    [*@example.com,~mary@*]
    Precedence=bulk
    Newsgroups=

  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}>
    Reply-To=

    e.g. Sending to Danvers.Carew @example.net generates:
    Code: Select all
    From: Dr H Jekyll <hj-Danvers.Carew=example.net@my-domain.com>

    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

    [_default]
    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: asizes@example.net
    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

    [_default]
    cfg:skip_null_sender=true
    From={$From:name} <{$sender:user}-{$rcpt:verp}@{$sender:domain}>
    cfg:log_file=mh-{$yyyy}-{$mm}-{$sender:user}.log

    [*]

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
Attachments
mail-hdrs.zip
mail-hdrs.mtq 0.9 20-11-2007
mail-hdrs.txt 0.9
(14.59 KiB) Downloaded 740 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 1 guest

cron