How to configure my postfix to use Outlook,Thunderbird [closed]

北城以北 提交于 2019-12-13 09:38:13

问题


I have a VPS with postfix installed and i want to configure my postfix and dovecot to be used by a client like outlook, mail, thunderbird or other, but when i configure my mail i always receive the message from the smtp server "username o password is incorrect" or Cannot connect to this SMTP server...i tried using different combinations, please any suggestion, sorry but i'm new in this area.

this is my postfix.conf

# TLS parameters
smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.

smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = mail.kitlearn.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = $myhostname, mail.kitlearn.com, localhost.kitlearn.com, , localhost,kitlearn.com,brinapptics.com
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 189.180.0.0/16
mailbox_size_limit = 0
recipient_delimiter = +
inet_protocols = all
virtual_alias_maps = hash:/etc/postfix/virtual
sender_bcc_maps = hash:/etc/postfix/bcc
mailbox_command = /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME
home_mailbox = Maildir/
smtpd_sasl_auth_enable = yes
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions = permit_mynetworks permit_sasl_authenticated reject_unauth_destination
smtp_tls_security_level = may
allow_percent_hack = no
mynetworks_style = subnet
relayhost = [mail.kitlearn.com]:587

回答1:


Based on your config you haven't actually defined how to sasl auth to postfix, only that sasl auth is allowed for SMTP connections.

From my postconf -n

smtpd_sasl_auth_enable = yes
smtpd_sasl_path = private/auth
smtpd_sasl_type = dovecot

I'm using dovecot as my auth provider, you need to make sure dovecot is allowing postfix to query for auth requests -- From dovecot config

service auth {
  unix_listener /var/spool/postfix/private/auth {
    group = postfix
    mode = 0666
    user = postfix
  }
  unix_listener auth-client {
    group = postfix
    mode = 0660
    user = postfix
  }
  unix_listener auth-master {
    group = vmail
    mode = 0660
    user = vmail
  }
  unix_listener auth-userdb {
    mode = 0600
    user = vmail
  }
  user = dovecot
}
userdb {
  args = /etc/dovecot/dovecot-sql.conf.ext
  driver = sql
}

Then you need to have the auth configuration, mine is through a mysql table -- Example from /etc/dovecot/dovecot-sql.conf.ext

driver = mysql
connect = host=localhost dbname=postfixadmin user=postfixadmin password=postfixadmin
default_pass_scheme = MD5-CRYPT
password_query = SELECT username as user, password, '/home/vmail/%d/%n' as userdb_home, 'maildir:/home/vmail/%d/%n' as userdb_mail, 150 as userdb_uid, 8 as userdb_gid FROM mailbox WHERE username = '%u' AND active = '1'
user_query = SELECT '/home/vmail/%d/%n' as home, 'maildir:/home/vmail/%d/%n' as mail, 2000 AS uid, 2000 AS gid, CONCAT('*:storage=',round(quota/1024)) AS quota_rule FROM mailbox WHERE username = '%u' AND active = '1'


来源:https://stackoverflow.com/questions/51281299/how-to-configure-my-postfix-to-use-outlook-thunderbird

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!