Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Attach some text to each SMTP sent message

  1. #1
    Join Date
    Jun 2012
    Posts
    11
    Rep Power
    3

    Default Attach some text to each SMTP sent message

    Hi all,
    it is possible to configure Zimbra in order to attach some text file on each message sent via SMTP? Moreover it is possible to activate this selectively for some domains and not on others?

    Thanks

  2. #2
    Join Date
    Jun 2012
    Posts
    11
    Rep Power
    3

    Default

    By following this wiki: Adding a disclaimer (altermime) or footer - Zimbra :: Wiki

    i've setup the system, but nothing happens, the server seems to ignore dfilt;

    this is my master.cf.in: anything wrong?
    Thanks

    Code:
    #
    # Postfix master process configuration file.  For details on the format
    # of the file, see the Postfix master(5) manual page.
    #
    # ==========================================================================
    # service type  private unpriv  chroot  wakeup  maxproc command + args
    #               (yes)   (yes)   (yes)   (never) (100)
    # ==========================================================================
    smtp      inet  n       -       n       -       -       smtpd
    	-o content_filter=dfilt:
    465    inet  n       -       n       -       -       smtpd
      -o smtpd_tls_wrappermode=yes 
      -o smtpd_sasl_auth_enable=yes
    submission inet n      -       n       -       -       smtpd
    	-o smtpd_etrn_restrictions=reject
    	-o smtpd_sasl_auth_enable=%%zimbraMtaSaslAuthEnable%%
    	-o smtpd_client_restrictions=permit_sasl_authenticated,reject
    	-o smtpd_tls_security_level=%%zimbraMtaTlsSecurityLevel%%
    	-o content_filter=dfilt:
    pickup    fifo  n       -       n       60      1       pickup
    cleanup   unix  n       -       n       -       0       cleanup
    qmgr      fifo  n       -       n       300     1       qmgr
    tlsmgr    unix  -       -       n       1000?   1       tlsmgr
    rewrite   unix  -       -       n       -       -       trivial-rewrite
    bounce    unix  -       -       n       -       0       bounce
    defer     unix  -       -       n       -       0       bounce
    trace     unix  -       -       n       -       0       bounce
    verify    unix  -       -       n       -       1       verify
    flush     unix  n       -       n       1000?   0       flush
    proxymap  unix  -       -       n       -       -       proxymap
    smtp      unix  -       -       n       -       -       smtp
    # When relaying mail as backup MX, disable fallback_relay to avoid MX loops
    relay     unix  -       -       n       -       -       smtp
    #	-o fallback_relay=
    showq     unix  n       -       n       -       -       showq
    error     unix  -       -       n       -       -       error
    retry     unix  -       -       n       -       -       error
    discard   unix  -       -       n       -       -       discard
    local     unix  -       n       n       -       -       local
    virtual   unix  -       n       n       -       -       virtual
    lmtp      unix  -       -       n       -       -       lmtp
    anvil     unix  -       -       n       -       1       anvil
    scache	  unix	-	-	n	-	1	scache
    %%uncomment LOCAL:postfix_enable_smtpd_policyd%%policy    unix  -       n       n       -       0       spawn
    %%uncomment LOCAL:postfix_enable_smtpd_policyd%%	user=zimbra argv=/usr/bin/perl /opt/zimbra/libexec/zmpostfixpolicyd
    #
    # ====================================================================
    # Interfaces to non-Postfix software. Be sure to examine the manual
    # pages of the non-Postfix software to find out what options it wants.
    #
    # Many of the following services use the Postfix pipe(8) delivery
    # agent.  See the pipe(8) man page for information about ${recipient}
    # and other message envelope options.
    # ====================================================================
    #
    # maildrop. See the Postfix MAILDROP_README file for details.
    # Also specify in main.cf: maildrop_destination_recipient_limit=1
    #
    maildrop  unix  -       n       n       -       -       pipe
      flags=DRhu user=vmail argv=/usr/local/bin/maildrop -d ${recipient}
    #
    # The Cyrus deliver program has changed incompatibly, multiple times.
    #
    old-cyrus unix  -       n       n       -       -       pipe
      flags=R user=cyrus argv=/cyrus/bin/deliver -e -m ${extension} ${user}
    # Cyrus 2.1.5 (Amos Gouaux)
    # Also specify in main.cf: cyrus_destination_recipient_limit=1
    cyrus     unix  -       n       n       -       -       pipe
      user=cyrus argv=/cyrus/bin/deliver -e -r ${sender} -m ${extension} ${user}
    #
    # See the Postfix UUCP_README file for configuration details.
    #
    uucp      unix  -       n       n       -       -       pipe
      flags=Fqhu user=uucp argv=uux -r -n -z -a$sender - $nexthop!rmail ($recipient)
    #
    # Other external delivery methods.
    #
    ifmail    unix  -       n       n       -       -       pipe
      flags=F user=ftn argv=/usr/lib/ifmail/ifmail -r $nexthop ($recipient)
    bsmtp     unix  -       n       n       -       -       pipe
      flags=Fq. user=foo argv=/usr/local/sbin/bsmtp -f $sender $nexthop $recipient
    #
    # AMAVISD-NEW
    #
    smtp-amavis unix -      -       n       -       10  smtp
    	-o smtp_data_done_timeout=1200
    	-o smtp_send_xforward_command=yes
    	-o disable_dns_lookups=yes
    	-o max_use=20
    %%zimbraLocalBindAddress%%:10025 inet n  -       n       -       -  smtpd
    	-o content_filter=
    	-o local_recipient_maps=
    	-o virtual_mailbox_maps=
    	-o virtual_alias_maps=
    	-o relay_recipient_maps=
    	-o smtpd_restriction_classes=
    	-o smtpd_delay_reject=no
    	-o smtpd_client_restrictions=permit_mynetworks,reject
    	-o smtpd_helo_restrictions=
    	-o smtpd_milters=
    	-o smtpd_sender_restrictions=
    	-o smtpd_recipient_restrictions=permit_mynetworks,reject
    	-o mynetworks_style=host
    	-o mynetworks=127.0.0.0/8,[::1]/128
    	-o strict_rfc821_envelopes=yes
    	-o smtpd_error_sleep_time=0
    	-o smtpd_soft_error_limit=1001
    	-o smtpd_hard_error_limit=1000
    	-o smtpd_client_connection_count_limit=0
    	-o smtpd_client_connection_rate_limit=0
    	-o receive_override_options=no_header_body_checks,no_unknown_recipient_checks,no_address_mappings
    	-o local_header_rewrite_clients=
    
    dfilt   unix    -       n       n       -       -       pipe
          flags=Rq user=filter argv=/opt/zimbra/postfix/conf/disclaimer -f ${sender} -- ${recipient}

  3. #3
    Join Date
    Oct 2009
    Location
    Dublin, IRELAND
    Posts
    712
    Rep Power
    7

    Default

    What ZCS version are you running ?

    If it is newer than 6.0.?? (.8 maybe) then there a built-in feature for this, and you should not be trying to do it outside of the product.

    Take a look at the bottom of page 88 of this Admin Guide. http://files.zimbra.com/website/docs...uide_7.2.1.pdf

    For the moment it is a system-wide setting. I believe there is a bug/enhancement request open to make it configurable per domain. Search bugzilla and vote for it.

  4. #4
    Join Date
    Jun 2012
    Posts
    11
    Rep Power
    3

    Default

    Quote Originally Posted by liverpoolfcfan View Post
    What ZCS version are you running ?

    If it is newer than 6.0.?? (.8 maybe) then there a built-in feature for this, and you should not be trying to do it outside of the product.

    Take a look at the bottom of page 88 of this Admin Guide. http://files.zimbra.com/website/docs...uide_7.2.1.pdf

    For the moment it is a system-wide setting. I believe there is a bug/enhancement request open to make it configurable per domain. Search bugzilla and vote for it.
    Yes, i'm running version 8.0.0, thanks.

  5. #5
    Join Date
    Oct 2009
    Location
    Dublin, IRELAND
    Posts
    712
    Rep Power
    7

    Default

    By the way, I have found the zmprov storing of the text strips out a lot of formatting/line breaks/etc. so I keep a copy of both the text and HTML signature files formatted as I like, and saved off to a folder outside of zimbra.

    Whenever you modify the signatures with zmprov it saves a copy of the text/html into the configuration of the server, and also outputs it's version of them to the two files

    Text: /opt/zimbra/data/altermime/global-default.txt
    HTML: /opt/zimbra/data/altermime/global-default.html

    So - for our system I manually edited these files to format the text as I wanted it, then saved off a copy of each to be used to replace the system-generated ones after every upgrade.

    If you have a short signature with no formatting required - this would not be necessary - but I found it the easiest way to maintain the disclaimer text.

  6. #6
    Join Date
    Jun 2012
    Posts
    11
    Rep Power
    3

    Default

    Quote Originally Posted by liverpoolfcfan View Post
    By the way, I have found the zmprov storing of the text strips out a lot of formatting/line breaks/etc. so I keep a copy of both the text and HTML signature files formatted as I like, and saved off to a folder outside of zimbra.

    Whenever you modify the signatures with zmprov it saves a copy of the text/html into the configuration of the server, and also outputs it's version of them to the two files

    Text: /opt/zimbra/data/altermime/global-default.txt
    HTML: /opt/zimbra/data/altermime/global-default.html

    So - for our system I manually edited these files to format the text as I wanted it, then saved off a copy of each to be used to replace the system-generated ones after every upgrade.

    If you have a short signature with no formatting required - this would not be necessary - but I found it the easiest way to maintain the disclaimer text.
    Done everything, but zimbra seems to be ignoring zimbraDomainMandatoryMailSignatureEnabled. Any Clue?

  7. #7
    Join Date
    Oct 2009
    Location
    Dublin, IRELAND
    Posts
    712
    Rep Power
    7

    Default

    What version of zimbra are you running ?

    You can verify the settings you entered using

    su - zimbra
    zmprov gacf | grep Mandatory

    You should see the 3 items.

    zimbraDomainMandatoryMailSignatureEnabled: TRUE
    zimbraDomainMandatoryMailSignatureHTML: <html><body>Whatever</body></html>
    zimbraDomainMandatoryMailSignatureText: Whatever

    Note the instructions for the text step are a little confusing - you should not have your text in < " ... " > but rather just in quotes " ... "
    zmprov mcf zimbraDomainMandatoryMailSignatureText "Whatever"

    When you ran the command

    /opt/zimbra/bin/zmamavisdctl restart
    did you see the Stopping/Starting messages ?

    Stopping amavisd... done.
    Starting amavisd...done.

    Once it is restarted the files should be in the directory.

    I just walked through the steps above on a newly created z8 test box, and they worked correctly there just as they have always done for me on later 6.0.x releases and 7.x.x releases


    By the way - this one caught me out more than once ... Any chance you are using WinSCP or similar client that caches the directory structure/contents and won't show the new files until you refresh ?

  8. #8
    Join Date
    Jun 2012
    Posts
    11
    Rep Power
    3

    Default

    This is my output:

    Code:
    zimbra@mail3:~$ zmprov gacf | grep Mandatory
    zimbraDomainMandatoryMailSignatureEnabled: TRUE
    zimbraDomainMandatoryMailSignatureHTML: .
    zimbraDomainMandatoryMailSignatureText: .
    My zimbra is 8.0.0
    thanks

  9. #9
    Join Date
    Oct 2009
    Location
    Dublin, IRELAND
    Posts
    712
    Rep Power
    7

    Default

    Quote Originally Posted by michelev View Post
    This is my output:

    Code:
    zimbra@mail3:~$ zmprov gacf | grep Mandatory
    zimbraDomainMandatoryMailSignatureEnabled: TRUE
    zimbraDomainMandatoryMailSignatureHTML: .
    zimbraDomainMandatoryMailSignatureText: .
    My zimbra is 8.0.0
    thanks
    So run

    Code:
    zmprov mcf zimbraDomainMandatoryMailSignatureHTML "<html><body>My HTML</body></html>"
    zmprov mcf zimbraDomainMandatoryMailSignatureText "My Text"
    Then verify again.

    Assuming you get the expected output, then run

    Code:
    /opt/zimbra/bin/zmamavisdctl restart
    and go and check the altermime directory for the files.

  10. #10
    Join Date
    Jun 2012
    Posts
    11
    Rep Power
    3

    Default

    Quote Originally Posted by liverpoolfcfan View Post
    So run

    Code:
    zmprov mcf zimbraDomainMandatoryMailSignatureHTML "<html><body>My HTML</body></html>"
    zmprov mcf zimbraDomainMandatoryMailSignatureText "My Text"
    Then verify again.

    Assuming you get the expected output, then run

    Code:
    /opt/zimbra/bin/zmamavisdctl restart
    and go and check the altermime directory for the files.
    After analyzing log files i've seen that was missing a /opt/zimbra/altermime/bin/altermime symlink. Now the disclaimer is working but there is another problem: it works only for web mail client, not for smtp connections.
    It is possibile to enable this functionality for each client using smtp (such as from Outlook)?

Similar Threads

  1. Message view 'As HTML' 'As Text'
    By tpaulic in forum Users
    Replies: 1
    Last Post: 12-12-2011, 04:16 PM
  2. New Message, Attach files from Briefcase
    By bertie_uk in forum Users
    Replies: 5
    Last Post: 08-10-2009, 01:09 AM
  3. Replies: 9
    Last Post: 01-05-2009, 12:53 AM
  4. Replies: 4
    Last Post: 12-08-2008, 10:42 PM
  5. attach file to a new message
    By ragheb.adel in forum Zimlets
    Replies: 1
    Last Post: 09-23-2008, 06: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
  •