Blame tests/p_postfix/40_postfix_sasl.sh

Christoph Galuschka 47aac2
#!/bin/sh
Christoph Galuschka 47aac2
# Author: Christoph Galuschka <christoph.galuschka@chello.at>
Christoph Galuschka 47aac2
Christoph Galuschka 47aac2
t_Log "Running $0 - Postfix plain SASL test."
Christoph Galuschka 47aac2
t_Log "Installing prerequisits"
Christoph Galuschka 47aac2
Christoph Galuschka 47aac2
t_InstallPackage dovecot nc
Christoph Galuschka 47aac2
Christoph Galuschka 47aac2
if [ $centos_ver = 6 ]
Christoph Galuschka 47aac2
  then
Christoph Galuschka 47aac2
  #adding parameters to postfix
Christoph Galuschka 47aac2
  cat >> /etc/postfix/main.cf <
Christoph Galuschka 47aac2
  smtpd_sasl_auth_enable = yes
Christoph Galuschka 47aac2
  broken_sasl_auth_clients = yes
Christoph Galuschka 47aac2
  smtpd_sasl_type = dovecot
Christoph Galuschka 47aac2
  smtpd_sasl_path = private/auth
Christoph Galuschka 47aac2
  smtpd_sasl_security_options = noanonymous
Christoph Galuschka 47aac2
Christoph Galuschka 47aac2
  smtpd_recipient_restrictions =
Christoph Galuschka 47aac2
      permit_mynetworks,
Christoph Galuschka 47aac2
      permit_sasl_authenticated,
Christoph Galuschka 47aac2
      reject_unauth_destination
Christoph Galuschka 47aac2
  EOF
Christoph Galuschka 47aac2
  #adding parameters to dovecot
Christoph Galuschka 47aac2
  cat >> /etc/dovecot/dovecot.conf <
Christoph Galuschka 47aac2
  service auth {
Christoph Galuschka 47aac2
    unix_listener /var/spool/postfix/private/auth {
Christoph Galuschka 47aac2
      mode = 0660
Christoph Galuschka 47aac2
      user = postfix
Christoph Galuschka 47aac2
      group = postfix        
Christoph Galuschka 47aac2
    }
Christoph Galuschka 47aac2
  }
Christoph Galuschka 47aac2
  EOF
Christoph Galuschka 47aac2
  #restarting services
Christoph Galuschka 47aac2
  t_ServiceControl postfix restart
Christoph Galuschka 47aac2
  t_ServiceControl dovecot restart
Christoph Galuschka 47aac2
Christoph Galuschka 47aac2
  #Running test
Christoph Galuschka 47aac2
  echo "ehlo test" | nc -w 3 localhost 25 | grep -q 'AUTH PLAIN'
Christoph Galuschka 47aac2
  ret_val = $?
Christoph Galuschka 47aac2
else
Christoph Galuschka 47aac2
  t_Log 'C5 System, test not yet working, skipping'
Christoph Galuschka 47aac2
  ret_val = 0
Christoph Galuschka 47aac2
fi
Christoph Galuschka 47aac2
t_CheckExitStatus $ret_val