Re: [exim] Ok, this time with feeling!

Page principale
Supprimer ce message
Répondre à ce message
Auteur: Tony Finch
Date:  
À: Sherwood Botsford
CC: exim-users
Sujet: Re: [exim] Ok, this time with feeling!
On Tue, 5 Oct 2004, Sherwood Botsford wrote:
>
> One of the reasons I switched to exim years ago was that the conf files
> were much more readable than sendmail conf files. Alas, conditions are
> pushing in this direction. (I have to use the bracket matching feature
> in vi to parse them just reading them.)


Careful layout can help a lot. Here's a relatively complicated example
from my configuration which shows a few features of my layout style.

  deny     message       = Please use your name when saying HELO (not $sender_helo_name)
          !verify        = helo
           condition     = ${if or{ \
                         { eq{$acl_c1}{bad} } \
                         { isip{$sender_helo_name} } \
                         { eq{$sender_helo_name}{$local_part} } \
                         { match_domain{$sender_helo_name}{+our_domains} } \
                                  } {yes} {no} }
           set acl_c1    = bad


The one that really takes the biscuit, though, is:

# tweaked so that it is clear which way the message arrived
# for reference, the default is:
#
# received_header_text = Received: \
#    ${if def:sender_rcvhost \
#         {from $sender_rcvhost\n\t} \
#         {${if def:sender_ident {from $sender_ident } \
#           }${if def:sender_helo_name {(helo=$sender_helo_name)\n\t} }} \
#     }\
#    by $primary_hostname \
#    ${if def:received_protocol {with $received_protocol} } \
#    ${if def:tls_cipher {($tls_cipher)\n\t} }\
#    (Exim $version_number)\n\t\
#    id $message_id\
#    ${if def:received_for {\n\tfor $received_for} }
#
received_header_text = Received: \
    ${if def:sender_rcvhost \
             {from $sender_rcvhost\n\t} \
         {${if def:sender_ident {from $sender_ident } \
           }${if def:sender_helo_name {(helo=$sender_helo_name)\n\t} }} \
     }\
    by FULL_HOSTINFO\n\t\
    ${if def:received_protocol {with $received_protocol } }\
    ${if def:authenticated_id {($authenticated_id) } }\
    ${if def:tls_cipher {($tls_cipher) } }\
    (Exim $version_number)\
    ${if def:received_for \
             {\n\tid $message_id (return-path <$sender_address>)\n\t\
          for $received_for} \
             { id $message_id\n\t\
           (return-path <$sender_address>)} }


The macro definitions include:

NAME    = ${lookup {$interface_address}cdb{DB/ipaddr2name.cdb} \
               {$value} {localhost} }


FULL_HOSTINFO    = $primary_hostname (${if def:interface_address \
            {NAME [$interface_address]:$interface_port} \
            {NAME} })


Tony.
--
f.a.n.finch <dot@???> http://dotat.at/
RATTRAY HEAD TO BERWICK ON TWEED: SOUTHWEST 6 TO GALE 8, POSSIBLY SEVERE GALE
9 OFF THE FORTH AND TAY, VEERING WESTERLY 5 TO 7 LATER ON WEDNESDAY.
OCCASIONAL SHOWERS. MAINLY GOOD. MODERATE, BUT ROUGH NEAR EXPOSED HEADLANDS.