Disclaimer variables passed from amavis to altermime.

Mark Martinec Mark.Martinec+amavis at ijs.si
Sun Jul 1 22:20:10 CEST 2012


Frank,


> So far this is what I get in my mail log:
> Jun 29 18:59:18 mercury amavis[15239]: (15239-01) (!)mangling by altermime
> failed: Program /usr/bin/altermime failed: 1536,  at /usr/sbin/amavisd-new
> line 12473, <GEN36> line 97., mail will pass unmodified.
> 
> I am guessing its because of the taint issue you brought up.

Right.

>   # make_query_keys:
>   # $1 = User+Foo at Sub.Example.COM
>   # $2 = User+Foo
>   # $3 = user  (lc if localpart_is_case_sensitive)
>   # $4 = +foo  (lc if localpart_is_case_sensitive)
>   # $5 = sub.example.com (lowercased unconditionally)
> 
> Couple more quick questions:
> 1. The commented lines #make query keys.  Do I need to uncomment any of
> these?

No, I just showed these comments from code for quick reference
to explain what the $3 and $5 on the righthand side of a hash lookup
could do.

> 2. The format I am using for disclaimers is   username.domain.com.txt
> username.domain.com.html  is this corrected for my disclaimer files?

Yes, considering the righthand side of a lookup: { '.' => '$3.$5' }
and the use of _OPTION_ in an altermime template:
  --disclaimer=/etc/postfix/disclaimer/_OPTION_.txt
  --disclaimer-html=/etc/postfix/disclaimer/_OPTION_.html

> I got everything to work thanks to your suggestion.

Good!

> Is there a way I can configure it to only write the disclaimer on fresh
> email and not replies?

Not easily. One could perhaps use some custom hook hack,
or use some custom shell wrapper around altermime.

> The only small glitch is that when a conversation takes place over email the
> number of duplicate disclaimers add up. 
> 
> Only problem I have now is that the signatures repeat on consequent
> replies. An email conversation with a lot of back and forth causes a
> footer with multiple signatures.

It is usual that a MUA when replying strips off a signature from
quoted text.  Signatures are by convention delimited from text
by an '--' line.


> I noticed amavis adds a header.  Can I make it add a custom header
> such as x-custom-signature = true.
> And then can I have amavis check to see if this header exists before
> appending the signature the 2nd round ?

Not off-the-shelf. Some hack with a custom hook could so the job.

Zhang Huangbin wrote:
> It doesn't work for me with below settings on CentOS 6.2, with
> Amavisd-new-2.6.6.
> run_command: [3055] /usr/bin/altermime --[...]
> (!)run_command: child process [3055]: Insecure dependency in exec
> while running with -T switch at /usr/sbin/amavisd line 3088

Right. I said so in my posting.

  Mark


More information about the amavis-users mailing list