4

I am running a basic iredmail install with amavis, postfix, dovecot. I want to use the declaimer feature to automatically append a disclaimer (in our case a signature).

The reasoning for this is that clients (ipad, outlook, etc) don’t have to be configured with signature settings, and that we have corporate control over the actual signatures that are posted.

Instead of:

'boss@domain.com' => 'boss.domain.com.txt'

I am trying to get to

%mailbox + ‘@’ + %domain =>  %mailbox + “.” + %domain + ‘.txt’

This way we can simply use a script to generate the .txt / .htm signature files using just mysql / php.

chicks
  • 3,793
  • 10
  • 27
  • 36
Frank
  • 119
  • 3
  • 11
  • @sebelk I wanted to let your title change through and make some other fixes without deciding about the tags. If you'd like to try again with new tags it would be better to propose them in meta first. – chicks Nov 11 '17 at 01:43

1 Answers1

5

Solved on Amavis Users Group... Thanks Mark Martinec Requires two changes:

In /etc/amavis/conf.d/50-user add this:

################## ---- CUSTOM SIGNATURES AS DISCLAIMERS ------- ###############################
# uses altermime to insert a different signatue per users
# signatures are located in teh /etc/postfix/signatures/ directory
# also needs a small change to amavisd code:
# nano /usr/sbin/amavisd-new  - $disclaimer_options = untaint($opt);  (add the "untaint" word before ($opt)
# each user needs two signatures (html / txt)   user.domain.com.txt user.domain.com.html


  $altermime = '/usr/bin/altermime';

  $defang_maps_by_ccat{+CC_CATCHALL} = [ 'disclaimer' ];
  @disclaimer_options_bysender_maps = ( { '.' => '$3.$5' } );
  @altermime_args_disclaimer = qw(--disclaimer=/etc/postfix/signatures/_OPTION_.txt --disclaimer-html=/etc/postfix/signatures/_OPTION_.html --force-for-bad-html);


################## ---- END CUSTOM SIGNATURES AS DISCLAIMERS ------- ###############################

Make sure allow disclaimer is not commented out and => 1

$policy_bank{'MYNETS'} = {   # mail originating from @mynetworks
  originating => 1,  # is true in MYNETS by default, but let's make it explicit
  os_fingerprint_method => undef,  # don't query p0f for internal clients
  allow_disclaimers => 1,  # enables disclaimer insertion if available
};

Make a minor change to Altermime:

nano /usr/sbin/amavisd-new  - $disclaimer_options = untaint($opt);  (add the "untaint" word before ($opt)

Restart Amavis (might have to kill the process)

Frank
  • 119
  • 3
  • 11
  • 1
    Still trying to figure out how to avoid duplicate signatures. I cannot give the bounty to myself, so if anyone wants it... please lets get this resolved!!!! – Frank Jun 30 '12 at 14:56