Sitemap
Links
+++ erd.trabant +++

+++ erd.trabant +++

blablabla

blablabla

Exim4 - VHost/PGSQL/SA/VScan Configuration

  1. #main
  2. #sql makros
  3. #acl rcpt
  4. #acl data
  5. #router
  6. #transports
  7. #retry
  8. #rewrite
  9. #auth

#sql makros Exim4.6 Config


##########################################################
# SQL MACROS #
##########################################################
#Attention on naming the macros...! the macros are not defined in logical order, because a macro-name
#cannot contain a already defined macro-name as a substring! weird!


#${lookup pgsql{SQL_XXX}{$value}}

###greylisting
SQL_GREYLIST_TEST = SELECT CASE \
WHEN now() - block_expires > 0 THEN 2 \
ELSE 1 \
END \
FROM greylist \
WHERE relay_ip='${quote_pgsql:$sender_host_address}' \
AND from_domain='${quote_pgsql:$sender_address_domain}'

SQL_GREYLIST_ADD = INSERT INTO greylist (relay_ip, from_domain, \
block_expires, record_expires, create_time) \
VALUES ( \
'${quote_pgsql:$sender_host_address}', \
'${quote_pgsql:$sender_address_domain}', \
now()+ (interval '60 seconds'), \
now()+ (interval '1 week'), \
now() \
)

###copy mail
SQL_COPY_TO_ALIAS = select copy_to from account where \
"copy"='1' and alias='${quote_pgsql:$local_part}' \
and is_alias=1 and aktiv=1 \
and domain_id= \
(select id from domain where domain='${domain}' \
and aktiv=1 limit 1) \
and copy_to is not null limit 1

SQL_COPY_TO = select copy_to from account where \
"copy"='1' and name='${quote_pgsql:$local_part}' \
and is_alias=0 and aktiv=1 \
and domain_id= \
(select id from domain where domain='${domain}' \
and aktiv=1 limit 1) \
and copy_to is not null limit 1


###domain aliasing
SQL_DOMAIN_ALIAS = select domain from domain where \
aktiv=1 and is_alias=0 \
and id= \
(select alias_for from domain where \
domain='${domain}' \
and aktiv=1 and is_alias=1 limit 1

#local user alias forward
SQL_FORWARD_LOCAL_ALIAS = select forward from account where \
alias='${quote_pgsql:$local_part}' \
and is_alias=1 and aktiv=1 \
and domain_id= \
(select id from domain where \
domain='${domain}' and aktiv=1 \
and "local"=1 limit 1) \
and forward is not null limit 1

#local user forward
SQL_FORWARD_LOCAL = select forward from account where \
name='${quote_pgsql:$local_part}' and is_alias=0 and aktiv=1 \
and domain_id= \
(select id from domain where \
domain='${domain}' and aktiv=1 \
and "local"=1 limit 1) \
and forward is not null limit 1

#local user alias
SQL_LOCAL_ALIAS = select domain from domain where \
domain='$domain' \
and id= \
(select domain_id from account \
where alias='${quote_pgsql:$local_part}' and is_alias=1 \
and domain_id= \
(select id from domain where \
domain='$domain' and aktiv=1 \
and "local"='1') \
and aktiv=1 and is_alias=1) \
and aktiv=1 and "local"='1'

#vuser alias forward
SQL_FORWARD_ALIAS = select forward from account where \
alias='${quote_pgsql:$local_part}' and is_alias=1 and aktiv=1 \
and domain_id= \
(select id from domain where \
domain='${domain}' and aktiv=1 limit 1) \
and forward is not null limit 1

#vuser forward
SQL_FORWARD = select forward from account \
where name='${quote_pgsql:$local_part}' and is_alias=0 and aktiv=1 \
and domain_id= \
(select id from domain where \
domain='${domain}' and aktiv=1 limit 1) \
and forward is not null limit 1

#vuser alias autoresponder
SQL_AUTORESPOND_ALIAS = SELECT autorespond FROM account WHERE \
autorespond='1' AND alias='${quote_pgsql:$local_part}' and is_alias='1' \
AND aktiv='1' \
AND domain_id= \
(select id from domain where \
domain='$domain' and aktiv='1' \
and "local"='0')

SQL_AUTORESPOND_SUBJECT_ALIAS = SELECT autorespond_subject FROM account WHERE \
alias='${quote_pgsql:$local_part}' and is_alias='1' \
AND domain_id= \
(select id from domain where \
aktiv='1' and domain='$domain') \
and aktiv='1'

SQL_AUTORESPOND_TEXT_ALIAS = SELECT autorespond_body FROM account WHERE \
alias='${quote_pgsql:$local_part}' \
AND is_alias='1' \
AND aktiv='1' \
AND domain_id= \
(SELECT id FROM domain WHERE aktiv='1' \
AND domain='$domain' \
AND "local"=0)

#vuser autoresponder
SQL_AUTORESPOND_SUBJECT = SELECT autorespond_subject FROM account WHERE \
name='${quote_pgsql:$local_part}' and is_alias='0' \
AND domain_id= \
(select id from domain where \
aktiv='1' and domain='$domain') \
and aktiv='1'

SQL_AUTORESPOND_TEXT = SELECT autorespond_body FROM account WHERE \
name='${quote_pgsql:$local_part}' \
AND is_alias='0' \
AND aktiv='1' \
AND domain_id= \
(SELECT id FROM domain WHERE \
aktiv='1' \
AND domain='$domain' \
AND "local"=0)

SQL_AUTORESPOND = SELECT autorespond \
FROM account WHERE autorespond='1' \
and name='${quote_pgsql:$local_part}' and is_alias='0'\
AND aktiv='1' \
AND domain_id= \
(select id from domain where \
domain='$domain' and aktiv='1' \
and "local"='0')

##virtual accounts

SQL_VDOMAIN_ALIAS = select domain from domain where \
domain='$domain' \
and id= \
(select domain_id from account where \
alias='${quote_pgsql:$local_part}' \
and domain_id= \
(select id from domain where \
domain='$domain' and aktiv=1 \
and "local"='0') \
and aktiv=1 and is_alias=1) \
and aktiv=1 and "local"='0'

SQL_VDOMAIN_UNKNOWN = select domain from domain where \
domain='$domain' and aktiv=1 and "local"=0 \
and id in \
(select domain_id from account where \
catchall='1' and aktiv='1') \
limit 1

SQL_VDOMAIN = select domain from domain where \
domain='$domain' \
and id= \
(select domain_id from account \
where name='${quote_pgsql:$local_part}' \
and domain_id= \
(select id from domain where \
domain='$domain' and aktiv=1 \
and "local"='0') \
and aktiv=1 \
and is_alias=0) \
and aktiv=1 and "local"='0'


##sql for transports delivery to maildir

#local aliases
SQL_HOME_LOCAL_ALIAS = select home from account where \
alias='${quote_pgsql:$local_part}' \
and is_alias=1 and aktiv=1 \
and domain_id= \
(select id from domain where \
domain='${domain}' and aktiv=1 and "local"=1 limit 1) \
limit 1

SQL_MAILDIR_LOCAL_ALIAS = select maildir from account where \
alias='${quote_pgsql:$local_part}' \
and is_alias=1 and aktiv=1 \
and domain_id= \
(select id from domain where \
domain='${domain}' and aktiv=1 and "local"=1 limit 1) \
limit 1

#virtual known user alias
SQL_HOME_VUSER_ALIAS = select home from account where \
alias='${quote_pgsql:$local_part}' \
and is_alias=1 and aktiv=1 \
and domain_id= \
(select id from domain where \
domain='${domain}' and aktiv=1 limit 1) \
limit 1

SQL_MAILDIR_VUSER_ALIAS = select maildir from account where \
alias='${quote_pgsql:$local_part}' and is_alias=1 and aktiv=1 \
and domain_id= \
(select id from domain where \
domain='${domain}' and aktiv=1 limit 1) \
limit 1

#virtual unknown, catchall user
SQL_HOME_VUSER_CATCHALL = select home from account where \
catchall=1 and aktiv=1 \
and domain_id= \
(select id from domain where \
domain='${domain}' and aktiv=1 limit 1) \
limit 1

SQL_MAILDIR_VUSER_CATCHALL = select maildir from account where \
catchall=1 and aktiv=1 \
and domain_id= \
(select id from domain where \
domain='${domain}' and aktiv=1 limit 1) \
limit 1

#virtual known user
SQL_HOME_VUSER = select home from account where \
name='${quote_pgsql:$local_part}' \
and aktiv=1 \
and domain_id= \
(select id from domain where \
domain='${domain}' and aktiv=1 limit 1) \
limit 1

SQL_MAILDIR_VUSER = select maildir from account where \
name='${quote_pgsql:$local_part}' \
and aktiv=1 \
and domain_id= \
(select id from domain where \
domain='${domain}' and aktiv=1 limit 1) \
limit 1


SQL_ACCOUNT_NAME = select account from account where \
( \
adr='${quote_pgsql:$sender_address}' \
) \
and aktiv=1 \
and domain_id= \
(select id from domain where \
domain='${domain}' and aktiv=1 limit 1) \
limit 1

#########################################################

>>PopUP / Drucken / Print<<
blablabla