track_msg is a tool for tracking email messages as they appear in a postfix log file. It finds the email(s) by making a match on sender and recipient, it will then follow the email(s) as they are queued and sent using postfix.
For detailed usage options please use
$ track_msg -h
The following parameters are mandatory:
One of :
- sender's email address the canonical email address of the sender. i.e:
firstname.lastname@example.org. No regex matching is done on this address.
- receipient's email address a partial matching of the recipient's email address. So jane and jane.doe will both match the recipient
- message id of the email.
$ track_msg -s email@example.com -t firstname.lastname@example.org -c postfix.log
Code for termcolor.py was obtained from PyPi
If using the official version, there's a patch that needs to be applied. The patch below fixes the problem of color reset when there's no color set.
--- termcolor-1.1.0.py 2012-09-28 13:51:18.000000000 -0400 +++ termcolor.py 2012-09-28 13:47:31.000000000 -0400 @@ -111,7 +111,8 @@ for attr in attrs: text = fmt_str % (ATTRIBUTES[attr], text) - text += RESET + if (color is not None) or (on_color is not None) or (attrs is not None): + text += RESET return text
This code is licensed under the MIT License