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 / 问题

问题[saslauthd](server)

Martin Hope
Old Geezer
Asked: 2021-02-20 00:56:10 +0800 CST

让 SENDMAIL(作为客户端)使用 AUTH LOGIN

  • 2

我正在尝试在网络中的 Pi 上使用 SENDMAIL (v8.15) 将邮件转发到我的 SendGrid 帐户。这是必需的,因为我网络上的旧网络摄像头无法使用 SendGrid 所需的非常长的密码。

基本的 SENDMAIL 工作正常,但连接到 SendGrid 时未使用 AUTH LOGIN。我已经安装了sasl2-bin软件包。如何“链接”SENDMAIL 以使用机器上安装的 SASL?在这种情况下,当 SENDMAIL 作为客户端运行时,是否还需要 SASL?

我的authinfo文件包含:

 AuthInfo:smtp.sendgrid.net "U:api.key" "P=cGFzc3dvcmQ=" "M:LOGIN PLAIN"

sendmail.mc除了我的文件中的以下内容外,几乎所有其他内容都是开箱即用的:

FEATURE(`authinfo')
define(`RELAY_MAILER_ARGS',`TCP $h 25')dnl
define(`SMART_HOST',`smtp.sendgrid.net')dnl
define(`confAUTH_MECHANISMS',`EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
define(`confAUTH_OPTIONS',`A')dnl

重建和重新启动后,我仍然得到:

AUTH=client,可用机制不满足要求

AUTH=client,relay=smtp.sendgrid.net.,临时失败,连接中止

stat=Deferred:临时 AUTH 失败。

我使用 TCPDUMP 跟踪流量,并在 SendGrid 的 EHLO 响应后看到:

250-smtp.sendgrid.net
250-8BITMIME
250-PIPELINING
250-SIZE 31457280
250-STARTTLS
250-AUTH PLAIN LOGIN
250 AUTH=PLAIN LOGIN

Pi 发送 QUIT 命令。它没有尝试AUTH LOGIN。

使 SENDMAIL 作为客户端使用 AUTH LOGIN 需要什么?

sendmail saslauthd sasl
  • 1 个回答
  • 1455 Views
Martin Hope
Nick Clifford
Asked: 2017-01-09 10:09:54 +0800 CST

apt-get purge 删除看似无关的软件包

  • 3

在为 Postfix 安装身份验证时,我以某种方式设法删除了该/var/run/saslauthd目录,因此我试图apt-get purge然后重新安装各种saslauthd软件包以重新生成所有文件。但是,当我尝试运行时apt-get purge libsasl2-2 sasl2-bin libsasl2-modules,APT 试图删除一堆不相关的包,例如 Apache 和 Git。

root@localhost:~# apt-get purge libsasl2-2 sasl2-bin libsasl2-modules
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  apache2-data apache2-utils bsdtar db-util db5.3-util debugedit fonts-droid-fallback fonts-noto-mono gamin ghostscript git-man imagemagick-common libapr1 libapr1-dev libaprutil1 libaprutil1-dbd-sqlite3 libarchive-tools libarchive13
  libconfig-file-perl libcupsfilters1 libcupsimage2 libecap3 liberror-perl libfftw3-double3 libgamin0 libgs9 libgs9-common libijs-0.35 libjbig2dec0 liblqr-1-0 liblua5.1-0 liblzo2-2 libm17n-0 libmagickcore-6.q16-2 libmagickwand-6.q16-2
  libminiupnpc10 libnatpmp1 libotf0 libpaper-utils libpaper1 libregexp-assemble-perl librpm3 librpmbuild3 librpmio3 librpmsign3 librtmp1 libsctp-dev libsctp1 libsqlite0 lksctp-tools m17n-db poppler-data python-libxml2 python-lzma
  python-rpm python-sqlite python-sqlitecachec python3-xkit rpm rpm-common rpm2cpio ruby-childprocess ruby-domain-name ruby-erubis ruby-ffi ruby-http-cookie ruby-i18n ruby-listen ruby-log4r ruby-mime-types ruby-net-scp ruby-net-sftp
  ruby-net-ssh ruby-netrc ruby-nokogiri ruby-pkg-config ruby-rb-inotify ruby-rest-client ruby-sqlite3 ruby-unf ruby-unf-ext spawn-fcgi sqlite3 squid-common squid-langpack transmission-common ubuntu-drivers-common uuid-dev
Use 'apt autoremove' to remove them.
The following packages will be REMOVED:
  apache2* apache2-bin* apache2-dev* apt-file* apt-transport-https* curl* dirmngr* emacs24* gconf-service* gconf-service-backend* gconf2* git* libaprutil1-dev* libaprutil1-ldap* libcurl3* libcurl3-gnutls* libcurl4-gnutls-dev*
  libldap-2.4-2* libldap2-dev* libsasl2-2* libsasl2-dev* libsasl2-modules* lighttpd* php-elisp* php7.0-curl* postfix* python-apt* python-pycurl* python-software-properties* python-urlgrabber* python3-pycurl*
  python3-software-properties* sasl2-bin* software-properties-common* software-properties-gtk* squid* squid3* transmission-cli* vagrant* yum*
0 upgraded, 0 newly installed, 40 to remove and 0 not upgraded.
After this operation, 85.4 MB disk space will be freed.
Do you want to continue? [Y/n]

我正在运行 Ubuntu 16.10。

我怎样才能解决这个问题?

linux ubuntu postfix saslauthd
  • 1 个回答
  • 716 Views
Martin Hope
maddo7
Asked: 2016-06-02 08:03:54 +0800 CST

Postfix + SASL 使用错误的查询进行身份验证

  • 2

我最近按照本指南在 aws ec2 实例上设置了 postfix + dovecot:http: //flurdy.com/docs/postfix/#config-secure-auth

目前我坚持使用 SASL。

SQL 查询似乎不是已配置的内容。以下是配置:

/etc/postfix/sasl/smtpd.conf

节目

pwcheck_method: saslauthd
mech_list: plain login
log_level: 7
allow_plaintext: true
auxprop_plugin: sql
sql_engine: mysql
sql_hostnames: 127.0.0.1
sql_user: mail
sql_passwd: passwd
sql_database: maildb
sql_select: select crypt from users where id='%u@%r' and enabled = 1

和

/etc/sasl2/smtpd.conf

节目

pwcheck_method: saslauthd
mech_list: plain login
log_level: 7
allow_plaintext: true
auxprop_plugin: sql
sql_engine: mysql
sql_hostnames: 127.0.0.1
sql_user: mail
sql_passwd: password
sql_database: maildb
sql_select: select crypt from users where id='%u@%r' and enabled = 1

和

/etc/pam.d/smtp

#%PAM-1.0
auth required pam_mysql.so user=mail passwd=password host=127.0.0.1 db=maildb table=users usercolumn=id passwdcolumn=crypt crypt=1 debug
account sufficient pam_mysql.so user=mail passwd=password host=127.0.0.1 db=maildb table=users usercolumn=id passwdcolumn=crypt crypt=1 debug

现在配置文件定义select crypt from users where id='%u@%r' and enabled = 1为密码的选择查询。

当身份验证失败并检查/var/log/secure时,我发现使用了错误的选择查询:

Jun  1 15:50:13 ip-172-31-23-97 saslauthd[19892]: pam_mysql - SELECT crypt FROM users WHERE id = 'admin'
Jun  1 15:50:13 ip-172-31-23-97 saslauthd[19892]: pam_mysql - SELECT returned no result.
Jun  1 15:50:13 ip-172-31-23-97 saslauthd[19892]: pam_mysql - pam_mysql_check_passwd() returning 1.
Jun  1 15:50:13 ip-172-31-23-97 saslauthd[19892]: pam_mysql - pam_mysql_sql_log() called.
Jun  1 15:50:13 ip-172-31-23-97 saslauthd[19892]: pam_mysql - pam_mysql_sql_log() returning 0.
Jun  1 15:50:13 ip-172-31-23-97 saslauthd[19892]: pam_mysql - pam_sm_authenticate() returning 10.
Jun  1 15:50:13 ip-172-31-23-97 saslauthd[19892]: pam_mysql - pam_mysql_release_ctx() called.
Jun  1 15:50:13 ip-172-31-23-97 saslauthd[19892]: pam_mysql - pam_mysql_destroy_ctx() called.
Jun  1 15:50:13 ip-172-31-23-97 saslauthd[19892]: pam_mysql - pam_mysql_close_db() called.

这可能是什么原因?

mysql postfix saslauthd sasl
  • 1 个回答
  • 1718 Views
Martin Hope
Greg K
Asked: 2012-07-09 02:46:01 +0800 CST

Postfix SMTP 身份验证不适用于虚拟邮箱 + SASL + Courier userdb

  • 2

因此,我阅读了各种教程和操作方法,并且正在努力了解如何让 SMTP 身份验证在 Postfix 中使用虚拟邮箱。我使用此Ubuntu 教程进行设置。我正在使用 Courier-IMAP 和 POP3 阅读邮件,这似乎没有问题。

但是,用于读取邮箱的凭据不适用于 SMTP。/var/log/auth.log从正在使用的 PAM可以看出,这是否需要 UNIX 用户帐户才能工作?因为我使用虚拟邮箱来避免创建用户帐户。

li305-246 saslauthd[22856]: DEBUG: auth_pam: pam_authenticate failed: Authentication failure
li305-246 saslauthd[22856]: do_auth         : auth failure: [user=fred] [service=smtp] [realm=] [mech=pam] [reason=PAM auth error]

/var/log/mail.log

li305-246 postfix/smtpd[27091]: setting up TLS connection from mail-pb0-f43.google.com[209.85.160.43]
li305-246 postfix/smtpd[27091]: Anonymous TLS connection established from mail-pb0-f43.google.com[209.85.160.43]: TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)
li305-246 postfix/smtpd[27091]: warning: SASL authentication failure: Password verification failed
li305-246 postfix/smtpd[27091]: warning: mail-pb0-f43.google.com[209.85.160.43]: SASL PLAIN authentication failed: authentication failure

我已经按照本教程在 userdb 中创建了帐户。Postfix 是否也使用 authuserdb?

需要哪些调试信息来帮助诊断我的问题?

main.cf:

# TLS parameters
smtpd_tls_cert_file = /etc/ssl/certs/smtpd.crt
smtpd_tls_key_file = /etc/ssl/private/smtpd.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

# SMTP parameters

smtpd_sasl_local_domain =
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
smtp_tls_security_level = may
smtpd_tls_security_level = may
smtpd_tls_auth_only = no
smtp_tls_note_starttls_offer = yes
smtpd_tls_CAfile = /etc/ssl/certs/cacert.pem
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom

/etc/postfix/sasl/smtpd.conf

pwcheck_method: saslauthd
mech_list: plain login

/etc/default/saslauthd

START=yes

PWDIR="/var/spool/postfix/var/run/saslauthd"
PARAMS="-m ${PWDIR}"
PIDFILE="${PWDIR}/saslauthd.pid"
DESC="SASL Authentication Daemon"
NAME="saslauthd"
MECHANISMS="pam"
MECH_OPTIONS=""
THREADS=5
OPTIONS="-c -m /var/spool/postfix/var/run/saslauthd"

/etc/courier/authdaemonrc

authmodulelist="authuserdb"

我只修改了一行authdaemonrc并按照本教程重新启动了服务。我已经按照教程将帐户添加到/etc/courier/userdbviauserdb并userdbpw运行。makeuserdb

解决了

感谢 Jenny D 建议rimap对本地主机 IMAP 服务器(读取 userdb 凭证)使用 to auth。

我更新/etc/default/saslauthd以正确启动 saslauthd(此页面很有用)

MECHANISMS="rimap"
MECH_OPTIONS="localhost"
THREADS=0
OPTIONS="-c -m /var/spool/postfix/var/run/saslauthd -r"

执行此操作后,我收到以下错误/var/log/auth.log:

li305-246 saslauthd[28093]: auth_rimap: unexpected response to auth request: * BYE [ALERT] Fatal error: Account's mailbox directory is not owned by the correct uid or gid: 
li305-246 saslauthd[28093]: do_auth         : auth failure: [user=fred] [service=smtp] [realm=] [mech=rimap] [reason=[ALERT] Unexpected response from remote authentication server]

这篇博文通过IMAP_MAILBOX_SANITY_CHECK=0在/etc/courier/imapd.

然后重启你的 courier 和 saslauthd 守护进程以使配置更改生效。

sudo /etc/init.d/courier-imap restart
sudo /etc/init.d/courier-authdaemon restart
sudo /etc/init.d/saslauthd restart

/var/log/auth.log尝试发送电子邮件时观看。希望你一切都好!

postfix saslauthd smtp-auth
  • 1 个回答
  • 7256 Views
Martin Hope
Nick
Asked: 2010-04-16 15:40:03 +0800 CST

Cyrus:如何配置 saslauthd 进行身份验证?

  • 1

我正在尝试让 Cyrus IMAP(Ubuntu 9.04 上的 v 2.2)设置和工作,但我在让登录正常工作时遇到了一些麻烦。



我为我的测试用户“nrahl”创建了一个邮箱:

cm user/nrahl

然后创建了一个密码:

$ saslpasswd2 nrahl



我正在尝试使用 Thunderbird 连接到邮箱。我使用机器的 LAN IP 地址作为主机,并使用“nrahl”作为用户名。它连接到服务器并提示我输入密码。当我输入它时,我得到“登录服务器失败”。在 Thunderbird 中,/var/log/mail.log 显示:

4 月 15 日 19:20:01 IMAP cyrus/imap[1930]:接受连接
Apr 15 19:20:09 IMAP cyrus/imap[1930]: badlogin: [192.168.5.21] plaintext nrahl SASL(-13): authentication failure: checkpass failed



/etc/imapd.conf 的一部分已删除注释:

sieveusehomedir: 假
sievedir: /var/spool/sieve
#mailnotifier:和风
#sievenotifier:和风
#dracinterval:0
#drahost:本地主机
hashmapspool: 真
允许明文:是
sasl_mech_list:平原
#allowapop:没有
#sasl_maximum_layer:256
#loginrealms:example.com
#virtdomains:用户标识
#默认域:
sasl_pwcheck_method:saslauthd
#sasl_auxprop_plugin: sasldb
sasl_auto_transition:没有

更新:

设置时:

sasl_pwcheck_method: alwaystrue

在 /etc/imapd.conf 中,登录正常工作。所以我假设这个问题与 saslauthd 有关。

ubuntu imap saslauthd cyrus
  • 2 个回答
  • 7053 Views
Martin Hope
Richard
Asked: 2009-06-17 19:11:22 +0800 CST

在 Windows 上使用 Active Directory 身份验证的 SvnServe

  • 5

现在我的公司正在使用网络共享与 SVN 存储库进行通信。它真的很慢,所以我想切换到 SVNSERVE。

我的公司选择采用文件系统路线的主要原因是,使用我们现有的活动目录身份验证系统可以轻松确保安全。

根据我的阅读,只要您使用Sasl 库,就可以将 SvnServe 与活动目录一起使用。我只是想知道是否还有其他人正在这样做并且可以提供一些有关配置的指示,因为它似乎没有在任何地方记录。

谢谢

编辑

我们在快速服务器上安装了 svn,但不幸的是它被用于其他公司文件共享和服务。

我被告知 HTTP 协议不会比使用 SMB 的 file:// 更快。有没有人有这方面的任何文件。我认为真正的客户端服务器模型会表现得更好。我们有大约 13 名开发人员和一个构建服务器全天提交和更新。

svn vcs saslauthd
  • 5 个回答
  • 8046 Views

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