Changeset 2424


Ignore:
Timestamp:
10/23/08 20:37:40 (5 years ago)
Author:
anarcat
Message:

configure alternc-slave as a primary MX for the main server

this aims to resolve a lot of mail problems we are having on our deployment at Koumbit

Location:
alternc/trunk
Files:
2 edited
2 copied

Legend:

Unmodified
Added
Removed
  • alternc/trunk/debian/alternc-slave.postinst

    r2407 r2424  
    180180 
    181181    echo "running alternc.install" 
    182     alternc.install 
     182    alternc.install -s 
    183183    ;; 
    184184 
  • alternc/trunk/etc/alternc/postfix-slave.cf

    r2421 r2424  
    2424enable_sasl_authentification = yes 
    2525broken_sasl_auth_clients = yes 
    26 alias_maps = mysql:/etc/postfix/myalias.cf hash:/etc/aliases 
    27 virtual_maps = proxy:mysql:/etc/postfix/mydomain.cf 
    28 virtual_mailbox_maps = proxy:mysql:/etc/postfix/myvirtual.cf 
    29 virtual_mailbox_base = / 
    30 virtual_minimum_uid = 1000 
    31 virtual_gid_maps = proxy:mysql:/etc/postfix/mygid.cf 
    32 virtual_uid_maps = static:33 
    33 default_privs = www-data 
     26alias_maps = hash:/etc/aliases 
     27virtual_maps =  
     28virtual_mailbox_maps =  
     29virtual_mailbox_base =  
     30virtual_gid_maps =  
     31virtual_uid_maps =  
     32default_privs = nobody 
     33transport_maps=proxy:mysql:/etc/postfix/myrelay.cf 
     34relay_domains=proxy:mysql:/etc/postfix/myrelay.cf 
     35relay_recipients_map=proxy:mysql:/etc/postfix/myvirtual.cf 
    3436smtpd_recipient_restrictions = reject_unlisted_recipient, permit_mynetworks, permit_sasl_authenticated, reject_non_fqdn_recipient, reject_unauth_destination, check_policy_service inet:127.0.0.1:60000, reject_rbl_client zen.spamhaus.org 
  • alternc/trunk/etc/alternc/templates/postfix/myrelay.cf

    r2421 r2424  
    77hosts =%%dbhost%% 
    88dbname = %%dbname%% 
    9 table = mail_users 
    10 select_field = path 
    11 where_field = alias 
     9table = mail_domain 
     10# this should by %%primary_mx%% 
     11select_field = relay:[%%mx%%] 
     12where_field = mail 
    1213 
  • alternc/trunk/install/alternc.install

    r2344 r2424  
    1111set -e  
    1212 
     13opts=`getopt "sf" $*` 
     14if [ $? -ne 0 ]; then 
     15    echo invalid syntax: $? 
     16fi 
     17set -- $opts 
     18for i; do 
     19    case "$i" in 
     20        -f|--force) 
     21            force=1; shift;; 
     22        -s|--slave) 
     23            slave=1; shift;; 
     24        --) 
     25            break;; 
     26        *) 
     27            echo "unknown option $i"; shift;; 
     28    esac 
     29done 
     30 
    1331. /usr/lib/alternc/functions.sh 
    1432 
     
    3351fi 
    3452if [ -d /etc/postfix ]; then 
    35     CONFIG_FILES="$CONFIG_FILES etc/postfix/myalias.cf 
     53    CONFIG_FILES="$CONFIG_FILES etc/postfix/myalias.cf etc/postfix/myrelay.cf 
    3654                  etc/postfix/mydomain.cf etc/postfix/mygid.cf 
    3755                  etc/postfix/myvirtual.cf etc/postfix/sasl/smtpd.conf" 
     
    5775              grep -v 'postfix/main.cf' | grep -v 'Uid differs'|grep -v 'Gid differs'  |grep -v 'Mode differs' |  
    5876              sed -e 's/^\([^:]*\).*/    \1/' | sort -u`" 
     77    # " shutup emacs 
    5978    if [ ! -z "$CHANGED" ]; then 
    6079        echo "The following configuration files has changed since last AlternC" 
     
    6281        echo "$CHANGED" 
    6382        echo "" 
    64         if [ "$1" = "force" ]; then 
     83        if [ "$force" = "1" ]; then 
    6584            echo "Replacing them as you requested." 
    6685        else 
     
    247266 
    248267# Attribute the correct rights to critical postfix files 
    249 if [ -e /etc/postfix/myalias.cf -o -e /etc/postfix/mydomain.cf -o -e /etc/postfix/mygid.cf -o -e /etc/postfix/myvirtual.cf ]; then 
     268if [ -e /etc/postfix/myalias.cf -o -e /etc/postfix/mydomain.cf -o -e /etc/postfix/mygid.cf -o -e /etc/postfix/myvirtual.cf -o -e /etc/postfix/myrelay.cf ]; then 
    250269    chown root:postfix /etc/postfix/my* 
    251270    chmod 640 /etc/postfix/my* 
    252271fi 
    253272 
    254 # configure postfix appropriatly for our needs" 
     273# configure postfix appropriatly for our needs 
     274if [ "$slave" = "1" ]; then 
     275    postfix_conf=/etc/alternc/postfix-slave.cf 
     276else 
     277    postfix_conf=/etc/alternc/postfix.cf 
     278fi 
    255279while read line 
    256280do 
    257281   postconf -e "$line" 
    258 done < /etc/alternc/postfix.cf 
    259  
    260 while read line 
    261 do 
    262    postconf -e "$line" 
    263 done <<EOF 
    264 myhostname = $FQDN 
    265 myorigin = $FQDN 
    266 EOF 
     282done < $postfix_conf 
    267283 
    268284if [ -e /etc/courier/authmysqlrc ] ; then 
Note: See TracChangeset for help on using the changeset viewer.