Entries
RSS 2.0

Tip: Add Disclaimer To Only Outgoing Email Using Altermime

On our mail server at work, we added a disclaimer to all outgoing emails using Altermime. This has been working fine for a few months now. There was just one thing that annoyed me about it, it added to all outgoing emails, including internal mail between users.

So I went about trying to find a solution and eventually found out how to do it so thought I’d share it here and also keep it as a reference to me as it took me ages to find it :P

# wget http://www.pldaniels.com/altermime/altermime-0.2.2.tar.gz
# tar -xzvf altermime-0.2.2.tar.gz
# cd altermime-0.2.2
# make

# cp altermime /usr/bin/
# chown root.root /usr/bin/altermime
# chmod 755 /usr/bin/altermime

# useradd -r -c “Postfix Filters” -d /var/spool/filter filter
# mkdir /var/spool/filter
# chown filter.filter /var/spool/filter
# chmod 750 /var/spool/filter
# Creating The Script To Run alterMIME

# vi /etc/postfix/disclaimer

#!/bin/sh
# Localize these.
INSPECT_DIR=/var/spool/filter
SENDMAIL=/usr/sbin/sendmail

#Exit codes from
EX_TEMPFAIL=75
EX_UNAVAILABLE=69

RECIP=`echo $* | awk '{print $NF}'| tr [A-Z] [a-z]`
SENDER=`echo $* | awk '{print $2}'| tr [A-Z] [a-z]`
RECIP_DOMAIN=`echo $RECIP | awk -F"@" '{print $2}'`
SEND_DOMAIN=`echo $SENDER | awk -F"@" '{print $2}'`

# Clean up when done or when aborting.
trap "rm -f in.$$" 0 1 2 3 15

# Start processing.
cd $INSPECT_DIR || { echo $INSPECT_DIR does not exist; exit $EX_TEMPFAIL; }
cat >in.$$ || { echo Cannot save mail to file; exit $EX_TEMPFAIL; }

if [ $RECIP_DOMAIN == $SEND_DOMAIN ]; then
DISCLAIMER=/etc/postfix/empty_disclaimer.txt
else
DISCLAIMER=/etc/postfix/disclaimer.txt
fi

/usr/bin/altermime --input=in.$$
--disclaimer=$DISCLAIMER
--disclaimer-html=$DISCLAIMER ||
{ echo Message content rejected; exit $EX_UNAVAILABLE; }
$SENDMAIL "$@" 

# chgrp filter /etc/postfix/disclaimer
# chmod 750 /etc/postfix/disclaimer

/etc/postfix/empty_disclaimer.txt is the disclaimer which will get used for internal email, ie when the sending domain is the same as the receiving domain, in my case I made it a blank file.
/etc/postfix/disclaimer.txt is the disclaimer which gets added to all other emails, in that we have some stuff saying it may be copyrighted or something, can’t remember now.

# Creating The Disclaimer Files

# vi /etc/postfix/disclaimer.txt
# vi /etc/postfix/empty_disclaimer.txt

# Postfix Configuration

Edit master.cf :

# vi /etc/postfix/master.cf

127.0.0.1:smtp inet n - y - - smtpd
smtp inet n - y - - smtpd
-o content_filter=dfilt:
dfilt unix - n n - - pipe
flags=Rq user=filter argv=/etc/postfix/disclaimer -f ${sender} — ${recipient}
# Restart Postfix

# postfix reload

Tip: Stop a progam apprearing in start menu

The start menu in Windows XP and I assume Vista can be set to list frequently used programs. This can be all fine and dandy, but what if you don’t want it to?

Well there’s not a pretty way to do it, you have to dive into the registry, but here it is:

Click Start - Run and type regedit and click OK. Navigate to ‘HKEY_CLASSES_ROOT\Applications\YourAppName.exe Add a new REG_SZ string value and call it ‘NoStartPage’ Quit Registry Editor, and then restart the computer.

The program will no longer appear in the most frequently used programs list.

Tip: Stop websites resizing Firefox window

Does it annoy you when you visit a website and it automatically adjusts YOUR window to fit THEIR website?

Well be annoyed no more!  Here is a quick tip to disallow websites from doing this again!

Tools  –>  Options  –>  Content Tab  –>  Enable JavaScript - Advanced Button  –>  Uncheck ‘Move or resize existing windows’

Jod Done :)

Firefox Disable Window Resize

Tip: Firefox Tabs in Background

After using Safari on OS X for a bit lately on my MacBook at work, returning to using Firefox on Windows annoyed me when I opened up new tabs and they took focus, I liked the way thay Safari opened them in the background.

A quick Google search and I found the solution :D

Navigate to ‘about:config’
Change ‘browser.tabs.loadDivertedInBackground’ to true

Job done :)

Thanks Teuton :)


You are viewing a mobilized version of this site...
View original page here

How do you rate mobile version of this page?

Mobilized by Mowser Mowser