Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 29

Thread: Add Disclaimer to Email

  1. #11
    Join Date
    Feb 2006
    Posts
    61
    Rep Power
    9

    Default

    ps. this is why it's become especially important for the UK/Europe....

    From Jan 1 2007, every company now needs to list its company registration number, place of registration and registered office address on its website and in emails.

    http://www.publictechnology.net/modu...ticle&sid=7328

  2. #12
    Join Date
    May 2006
    Location
    England.
    Posts
    927
    Rep Power
    10

    Default

    Quote Originally Posted by gmsmith View Post
    Be sure to search Bugzilla and if its not in there submit it as a request and don't forget to vote for it!
    Possibly like this one: http://bugzilla.zimbra.com/show_bug.cgi?id=4720 which I voted on some time back and which was opened in November of 2005 ?

  3. #13
    Join Date
    Aug 2005
    Posts
    1,433
    Rep Power
    12

    Default Yep! Like that one!

    I'd expect that with the new EU requirements, you'll see more people voting for that bug. Vote count is one of the major ways enhancement requests get prioritized.
    Bugzilla - Wiki - Downloads - Before posting... Search!

  4. #14
    Join Date
    Jul 2006
    Location
    ireland
    Posts
    388
    Rep Power
    9

    Smile disclaimer script

    did some quick & dirty scripts for this:

    using add_disclaimer.sh (requires disclaimer, disclaimer.txt and altermime-0.?.?tar.gz )
    remove_disclaimer.sh should undo disclaimer

    Use at your own risk test on a dummy server first
    check steps here first: http://wiki.zimbra.com/index.php?tit...e%29_or_footer
    if you cut & paste do so carefully (check spacing)

    add_disclaimer.sh
    service nscd stop
    ################################################## ############
    # 1) unpack
    ################################################## ############
    tar -xzf altermime-*.tar.gz

    ################################################## ############
    # 2) Compile
    ################################################## ############
    cd altermime-*
    make

    ################################################## ############
    #3) Install altermime
    ################################################## ############
    /bin/cp -f altermime /usr/bin/
    cd ..
    chown root.root /usr/bin/altermime
    chmod 755 /usr/bin/altermime

    ################################################## ############
    #4) Add a "filter" user
    ################################################## ############
    useradd -r -c "Postfix Filters" -d /var/spool/filter filter

    ################################################## ############
    #5) Create a filter directory
    ################################################## ############
    mkdir /var/spool/filter
    chown filter.filter /var/spool/filter
    chmod 750 /var/spool/filter

    ################################################## ############
    ################################################## ############
    # Postfix
    ################################################## ############
    ################################################## ############

    ################################################## ############
    #6) Backup you master.cf file
    ################################################## ############
    /bin/cp -f /opt/zimbra/postfix/conf/master.cf /opt/zimbra/postfix/conf/master.cf.orig
    ################################################## ############
    #7) Modify /opt/zimbra/postfix/conf/master.cf
    ################################################## ############
    cat /opt/zimbra/postfix/conf/master.cf | sed -e 's/smtp inet/\#smtp inet/g' > /opt/zimbra/postfix/conf/master.cf.1

    cat << EOF> /opt/zimbra/postfix/conf/master.cf
    smtp inet n - n - - smtpd
    -o content_filter=dfilt:
    dfilt unix - n n - - pipe
    flags=Rq user=filter argv=/opt/zimbra/postfix/conf/disclaimer -f \${sender} -- \${recipient}
    EOF
    cat /opt/zimbra/postfix/conf/master.cf.1 >> /opt/zimbra/postfix/conf/master.cf

    ################################################## ############
    #8) Create a disclaimer file in /opt/zimbra/postfix/conf/disclaimer.txt
    ################################################## ############
    /bin/cp -f disclaimer.txt /opt/zimbra/postfix/conf

    ################################################## ############
    #9) Create disclaimer script in /opt/zimbra/postfix/conf/disclaimer
    ################################################## ############
    cp -f disclaimer /opt/zimbra/postfix/conf/disclaimer

    ################################################## ############
    #10) Set permissions
    ################################################## ############
    chgrp filter /opt/zimbra/postfix/conf/disclaimer
    chmod 750 /opt/zimbra/postfix/conf/disclaimer

    ################################################## ############
    #11) Restart Zimbra postfix
    ################################################## ############
    su - zimbra -c 'zmmtactl stop'
    su - zimbra -c 'zmmtactl start'

    disclaimer
    #!/bin/sh
    INSPECT_DIR=/var/spool/filter
    SENDMAIL=/opt/zimbra/postfix/sbin/sendmail

    # Exit codes from <sysexits.h>
    EX_TEMPFAIL=75
    EX_UNAVAILABLE=69

    # 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; }

    /usr/bin/altermime --input=in.$$ --disclaimer=/opt/zimbra/postfix/conf/disclaimer.txt --disclaimer-html=/opt/zimbra/postfix/conf/disclaimer.txt \
    --xheader="X-Copyrighted-Material: Please visit http://www.company.com/privacy.htm" || { echo Message content rejected; exit $EX_UNAVAILABLE; }

    $SENDMAIL "$@" < in.$$
    exit $?
    disclaimer.txt
    This email and any files transmitted with it are confidential and .....
    ...Company X, Suite# 1, Street, City, Country, www.company.com

    remove_disclaimer.sh
    rm -f /usr/bin/altermime
    #rm -rf altermime-0.?.? #put your own altermime-0.?.? version here & uncomment

    userdel filter

    rm -rf /var/spool/filter

    /bin/cp -f /opt/zimbra/postfix/conf/master.cf.orig /opt/zimbra/postfix/conf/master.cf

    rm -f /opt/zimbra/postfix/conf/disclaimer.txt
    rm -f /opt/zimbra/postfix/conf/disclaimer

    su - zimbra -c 'zmmtactl stop'
    su - zimbra -c 'zmmtactl start'
    Last edited by padraig; 02-16-2007 at 04:35 AM. Reason: typo

  5. #15
    Join Date
    Feb 2007
    Location
    Greece
    Posts
    27
    Rep Power
    8

    Default Disclaimer per Domain (3 or more)

    After a while i made this script for 3 or more domains.
    Code:
    #!/bin/sh 
    
    INSPECT_DIR=/var/spool/filter
    SENDMAIL=/opt/zimbra/postfix/sbin/sendmail
            
    # Exit codes from <sysexits.h>
    EX_TEMPFAIL=75
    EX_UNAVAILABLE=69
    	      
    # 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; }
            
      temp1=`grep  domain1.com in.$$ | grep From`
    	if [ "$temp1" != "" ]; then
    		/usr/bin/altermime --input=in.$$ --disclaimer=/opt/zimbra/footer/domain1.txt \
    		--disclaimer-html=/opt/zimbra/footer/domain1.html \
    		--xheader="X-Copyrighted-Material: Please visit http://www.domain2.gr" || { echo Message content rejected; exit $EX_UNAVAILABLE; }
    	fi
    
     temp2=`grep  domain2in.$$ | grep From`
            if [ "$temp2" != "" ]; then
                    /usr/bin/altermime --input=in.$$ --disclaimer=/opt/zimbra/footer/domain2.txt \
                    --disclaimer-html=/opt/zimbra/footer/domain2.html \
                    --xheader="X-Copyrighted-Material: Please visit http://www.domain2.gr" || { echo Message content rejected; exit $EX_UNAVAILABLE; }
            fi
    
     temp3=`grep  domain3 in.$$ | grep From`
            if [ "$temp3" != "" ]; then
                    /usr/bin/altermime --input=in.$$ --disclaimer=/opt/zimbra/footer/domain3.txt \
                    --disclaimer-html=/opt/zimbra/footer/domain3.html \
                    --xheader="X-Copyrighted-Material: Please visit http://www.domain3.gr" || { echo Message content rejected; exit $EX_UNAVAILABLE; }
            fi
    
    $SENDMAIL "$@" < in.$$
    				         
    exit $?
    And it does not need ant modifications to remove the disclaimer form the incoming mails.

    PS: working so far for 14 domains

  6. #16
    Join Date
    Jul 2006
    Location
    ireland
    Posts
    388
    Rep Power
    9

    Default disclaimer

    excellent thanks for the code RaNd

    just one tiny bug if you send and email out to a test account e.g. a gmail account
    then reply to this you still get the disclaimer added

  7. #17
    Join Date
    Jul 2006
    Location
    ireland
    Posts
    388
    Rep Power
    9

    Default sendmail -i

    $SENDMAIL "$@" < in.$$

    should be replace by:

    $SENDMAIL -i "$@" < in.$$

    to avoid an issue where some e-mails are cropped and end with no disclaimer.
    caused by a single dot (".") on a new line.

  8. #18
    Join Date
    Feb 2007
    Location
    Greece
    Posts
    27
    Rep Power
    8

    Default

    Quote Originally Posted by padraig View Post
    excellent thanks for the code RaNd

    just one tiny bug if you send and email out to a test account e.g. a gmail account
    then reply to this you still get the disclaimer added

    Yes, that is because it finds a "from" with your domain(s) is the message body . .

    if you find a workaround for this plz post it . .

  9. #19
    Join Date
    Apr 2006
    Posts
    76
    Rep Power
    9

    Default

    What should the ownership of disclaimer.txt be or does it even matter?

  10. #20
    Join Date
    Feb 2007
    Location
    Greece
    Posts
    27
    Rep Power
    8

    Default

    Quote Originally Posted by plan9 View Post
    What should the ownership of disclaimer.txt be or does it even matter?
    I have zimbra:zimbra and it's working . . .

Similar Threads

  1. need advice on configuring zimbra to work with fax server
    By pheonix1t in forum Administrators
    Replies: 0
    Last Post: 07-11-2007, 07:46 PM
  2. Email Disclaimer Max Size
    By kloose in forum Administrators
    Replies: 1
    Last Post: 01-11-2007, 06:28 PM
  3. upgrade to 4.0.3 antispam does'nt work
    By lucanannipieri in forum Administrators
    Replies: 14
    Last Post: 11-07-2006, 02:56 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •