Postfix + Postfixadmin + Dovecot + SASL — CentOS

Postfix Installation:

Add user:

useradd vmail
id vmail
uid=501(vmail) gid=501(vmail) groups=501(vmail) context=user_u:system_r:unconfined_t

Install postfix with mysql support (default is without mysql):

    vi /etc/yum.repos.d/CentOS-Base.repo

    [base] and [update] sections of /etc/yum.repos.d/CentOS-Base.repo added
    exclude=postfix-*

    [centosplus]
    name=CentOS-$releasever - Plus
    mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
    #baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
    gpgcheck=1
    enabled=1
    gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4
    includepkgs=postfix-*
    
    yum install postfix
    Installed:                postfix.x86_64 2:2.3.3-2.1.centos.mysql_pgsql
    
    postconf -m
    
    btree
    cidr
    environ
    hash
    ldap
    mysql
    nis
    pcre
    pgsql
    proxy
    regexp
    static
    unix
    
    whereis postfix
    postfix: /usr/sbin/postfix /etc/postfix /usr/libexec/postfix /usr/share/man/man1/postfix.1.gz
    
    vi /etc/postfix/main.cf
    

    Find this line and insert below:
    debug_peer_level = 2

    smtpd_tls_auth_only = no
    smtpd_sasl_auth_enable = yes
    smtpd_sasl_type = dovecot
    smtpd_sasl_path = private/auth
    smtpd_sasl_application_name = smtpd
    smtpd_sasl_security_options = noanonymous
    smtpd_sasl_local_domain = $myhostname
    broken_sasl_auth_clients = yes
    smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination,reject_rbl_client zen.spamhaus.org
    virtual_transport = virtual
    virtual_mailbox_domains = mysql:/etc/postfix/mysql-domains.cf
    virtual_mailbox_maps = mysql:/etc/postfix/mysql-users.cfvirtual_alias_maps = mysql:/etc/postfix/mysql-aliases.cf
    virtual_mailbox_base = /home/vmail
    virtual_uid_maps = static:501
    virtual_gid_maps = static:501 

    permit_mynetwork= $mynetworks
    check_relay_domains = $relay_domains, $inet_interfaces
    smtpd_helo_required = yes
    disable_vrfy_command = yes

    vi /etc/postfix/mysql-domains.cf
    

    host = localhost
    user = root
    password =
    dbname = postfix
    table = domain
    select_field = domain
    where_field = domain
    additional_conditions = and backupmx = '0' and active = '1'

  1. # Side work — postfixadmin
    # add domains ex: mydomain.com
    # add email address ex: [email protected]

Страниц: 1 2 3 4

Добавить комментарий