AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 409828
Accepted
QuantumMechanic
QuantumMechanic
Asked: 2012-07-21 20:34:24 +0800 CST2012-07-21 20:34:24 +0800 CST 2012-07-21 20:34:24 +0800 CST

无法让 SASL auxprop/sasldb 使用 postfix/Ubuntu 12.04

  • 772

我有一个运行 Postfix 2.5.1 的 Ubuntu 8.04LTS 系统。在该系统上,SMTP AUTH 运行良好。的内容 /etc/postfix/sasl/smtpd.conf是:

pwcheck_method: auxprop
auxprop_plugin: sasldb
mech_list: PLAIN

SASL 相关的属性是:

smtpd_sasl_type = cyrus
smtpd_sasl_auth_enable = yes
smtpd_sasl_path = smtpd
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_sasl_local_domain = $myhostname

当我这样做时,sudo sasldblistusers2我得到:

[email protected]: userPassword

正如我所说,在 8.04LTS 系统上一切正常。

但是,我正在尝试将它迁移到运行 Postfix 2.9.3 的 Ubuntu 12.04LTS 系统,但我无法让它工作。我做的一切都是一样的,但 postfix 每次都会提供身份验证失败。

这不是/etc/sasldb2文件。我试过从旧系统中取出文件,但没有用。我使用以下方法创建了一个新文件:

saslpasswd2 -c -u mail.mydomain.com authusername

这是行不通的,尽管如果我将它复制到旧系统它会在旧系统上工作,这就是我知道文件没有问题的方式。

同样,我知道 postfix 正在查看该smtpd.conf文件。如果我mech_list在文件行中添加更多机制,当我连接到 smtpd 守护程序时,我会看到这些额外机制被通告。当我移除它们时,它们又消失了。/etc/postfix/sasl/smtpd.conf显然已经习惯了。

我正在通过使用实际的邮件客户端和在使用此生成令牌后手动与服务器对话来进行测试:

perl -MMIME::Base64 -e 'print encode_base64("\000authusername\000thePassword");'

然后:

openssl s_client -quiet -starttls smtp -connect the.newsystem.com:587

结果对话是:

250 DSN
EHLO example.com
250-the.newsystem.com
250-PIPELINING
250-SIZE 20971520
250-ETRN
250-AUTH PLAIN
250-AUTH=PLAIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
AUTH PLAIN theBase64EncodedToken
535 5.7.8 Error: authentication failed: authentication failure

但是,如果我改为连接the.oldsystem.com:587并做同样的事情,我会得到:

235 2.7.0 Authentication successful

saslfinger 在新机器上的输出是:

# sudoh saslfinger -s
saslfinger - postfix Cyrus sasl configuration Sat Jul 21 00:24:24 EDT 2012
version: 1.0.4
mode: server-side SMTP AUTH

-- basics --
Postfix: 2.9.3
System: Ubuntu 12.04 LTS \n \l

-- smtpd is linked to --
        libsasl2.so.2 => /usr/lib/i386-linux-gnu/libsasl2.so.2 (0xb76c5000)


-- active SMTP AUTH and TLS parameters for smtpd --
broken_sasl_auth_clients = yes
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = $myhostname
smtpd_sasl_path = smtpd
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = cyrus
smtpd_tls_CAfile = /etc/ssl/certs/MyCA.pem
smtpd_tls_auth_only = yes
smtpd_tls_cert_file = /etc/postfix/ssl/server.crt
smtpd_tls_key_file = /etc/postfix/ssl/server.key
smtpd_tls_loglevel = 1
smtpd_tls_security_level = may
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtpd_tls_session_cache_timeout = 3600s


-- listing of /usr/lib/sasl2 --
total 16
drwxr-xr-x  2 root root 4096 Jul 20 23:00 .
drwxr-xr-x 67 root root 8192 Jul 20 21:25 ..
-rw-r--r--  1 root root    1 May  4 00:17 berkeley_db.txt

-- listing of /etc/postfix/sasl --
total 20
drwxr-xr-x 2 root root 4096 Jul 20 21:29 .
drwxr-xr-x 5 root root 4096 Jul 20 23:58 ..
-rw-r--r-- 1 root root   64 Jul 20 21:29 smtpd.conf



-- content of /etc/postfix/sasl/smtpd.conf --
pwcheck_method: auxprop
auxprop_plugin: sasldb
mech_list: PLAIN

-- content of /etc/postfix/sasl/smtpd.conf --
pwcheck_method: auxprop
auxprop_plugin: sasldb
mech_list: PLAIN


-- active services in /etc/postfix/master.cf --
# service type  private unpriv  chroot  wakeup  maxproc command + args
#               (yes)   (yes)   (yes)   (never) (100)
smtp      inet  n       -       -       -       -       smtpd
submission inet n       -       -       -       -       smtpd
  -o syslog_name=postfix/submission
  -o smtpd_tls_security_level=encrypt
  -o smtpd_sasl_auth_enable=yes
  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
  -o milter_macro_daemon_name=ORIGINATING

[snipping the rest of the services]

-- mechanisms on localhost --

-- end of saslfinger output --

我可能遗漏/做错了什么?据我所知,所有的配置都是一样的,但它不能在新系统上运行。

ubuntu
  • 3 3 个回答
  • 7309 Views

3 个回答

  • Voted
  1. Best Answer
    QuantumMechanic
    2012-07-22T04:48:37+08:002012-07-22T04:48:37+08:00

    赠品在这里:

    -- active services in /etc/postfix/master.cf --
    # service type  private unpriv  chroot  wakeup  maxproc command + args
    #               (yes)   (yes)   (yes)   (never) (100)
    smtp      inet  n       -       -       -       -       smtpd
    submission inet n       -       -       -       -       smtpd
    

    端口上的smtpd进程submission以 chroot 模式运行(因为-该列中有一个表示默认值(即yes)适用,因此看不到/etc/sasldb2.

    当我复制/etc/sasldb2到/var/spool/postfix/etc身份验证时开始正常工作。

    • 16
  2. WawaBrother
    2014-09-08T17:03:00+08:002014-09-08T17:03:00+08:00

    chroot 肯定是原因,但就我而言,复制到/var/spool/postfix/etc无效。

    所以我摆脱了 chroot,这对我有用。

    为了做到这一点,您需要编辑 /etc/postfix/master.cf 找到以下行:

    smtp      inet  n       -       -       -       -       smtpd
    

    并修改如下:

    smtp      inet  n       -       n       -       -       smtpd
    
    • 5
  3. Josh
    2017-04-11T18:54:30+08:002017-04-11T18:54:30+08:00

    将 sasldb2 文件同步到 postfix 的默认 chroot jail 的另一种方法是添加一个硬链接到它:

    ln /etc/sasldb2 /var/spool/postfix/etc/
    

    请注意,符号链接将不起作用,因为无法从监狱内部访问符号链接,但可以访问硬链接。这比简单地复制文件有优势,因为未来的新用户和密码更改将自动同步,甚至无需重新加载后缀。

    • 4

相关问题

  • 无法通过 Ubuntu VPN 访问外部网络

  • ubuntu apt-get upgrade - 如何在 shell 中单击确定?

  • VirtualBox 上 Ubuntu 的访客优化技巧 [关闭]

  • 外部硬盘上的 virtualbox 虚拟硬盘驱动器(Vista 主机上的 ubuntu 客户机)

  • 如何在 Ubuntu 上挂载 LVM 分区?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve