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
    • 最新
    • 标签
主页 / user-797321

Sam's questions

Martin Hope
Sam
Asked: 2024-10-05 00:05:14 +0800 CST

Postfix 无法访问 Opendkim 套接字

  • 5

我有一台 ubuntu 20.04 服务器和一个域,example.com 我通过 apt 安装了 postfix 和 opendkim。

我/etc/opendkim.conf有

Socket local:/run/opendkim/opendkim.sock

该文件存在。

$ ls -l /run/opendkim/opendkim.sock
ls: cannot access '/run/opendkim/opendkim.sock': Permission denied
$ sudo ls -l /run/opendkim/opendkim.sock
srwxrwx--- 1 opendkim opendkim 0 Oct  4 21:19 /run/opendkim/opendkim.sock

我将 postfix 添加到 opendkim 组。

$ groups postfix
postfix : postfix opendkim

我也尝试过通过 重启sudo reboot。

当我这样做的时候

echo "This is the body of the email." | mail -s "Subject of the Email" [email protected]

但我收到了这个错误。

Oct 04 23:58:24 ubuntu postfix/cleanup[52998]: 
warning: connect to Milter service local:/run/opendkim/opendkim.sock: No such file or directory

我仔细看了看

$ ps -p 52998 -o pid,comm,user,%cpu,%mem,stime,tty
    PID COMMAND         USER     %CPU %MEM STIME TT
  52998 cleanup         postfix   0.0  0.2 00:00 ?

用户是 postfix,它应该有权访问套接字文件,但系统日志却说不行。

email
  • 1 个回答
  • 30 Views
Martin Hope
Sam
Asked: 2021-10-03 15:48:37 +0800 CST

Postfix Dovecot 的 SMTP 身份验证问题

  • 0

我买了一个域名example.com和一个 VPS,我用 iRedMail 设置了一个邮件服务器。

不想让 iRedMail 搞乱我的 Nginx,我决定自己安装 Nginx 和 Roundcube。但是,它说 SMTP 服务器不支持身份验证。SMTP 没问题。

[02-Oct-2021 23:40:16 +0000]: <5gl20r7b> PHP Error: SMTP server does not support authentication (POST /?_task=mail&_unlock=loading1633218016462&_framed=1&_action=send)
[02-Oct-2021 23:40:16 +0000]: <5gl20r7b> SMTP Error: Authentication failure:   in /var/www/mail/program/lib/Roundcube/rcube.php on line 1702 (POST /?_task=mail&_unlock=loading1633218016462&_framed=1&_action=send)

和 postconf -n 输出。

root@mail:~# postconf -n
alias_database = hash:/etc/postfix/aliases
alias_maps = hash:/etc/postfix/aliases
allow_min_user = no
allow_percent_hack = no
biff = no
body_checks = pcre:/etc/postfix/body_checks.pcre
command_directory = /usr/sbin
compatibility_level = 2
content_filter = smtp-amavis:[127.0.0.1]:10024
daemon_directory = /usr/lib/postfix/sbin
data_directory = /var/lib/postfix
debug_peer_level = 2
debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin ddd $daemon_directory/$process_name $process_id & sleep 5
disable_vrfy_command = yes
dovecot_destination_recipient_limit = 1
enable_long_queue_ids = yes
enable_original_recipient = no
header_checks = pcre:/etc/postfix/header_checks
inet_interfaces = all
inet_protocols = all
lmtp_tls_mandatory_protocols = !SSLv2 !SSLv3
lmtp_tls_protocols = !SSLv2 !SSLv3
mail_owner = postfix
mailq_path = /usr/bin/mailq
message_size_limit = 15728640
mlmmj_destination_recipient_limit = 1
mydestination = $myhostname, localhost, localhost.localdomain
mydomain = example.com
myhostname = example.com
mynetworks = 127.0.0.1 [::1]
myorigin = example.com
newaliases_path = /usr/bin/newaliases
postscreen_access_list = permit_mynetworks cidr:/etc/postfix/postscreen_access.cidr
postscreen_blacklist_action = drop
postscreen_dnsbl_action = drop
postscreen_dnsbl_reply_map = texthash:/etc/postfix/postscreen_dnsbl_reply
postscreen_dnsbl_sites = zen.spamhaus.org=127.0.0.[2..11]*3 b.barracudacentral.org=127.0.0.2*2
postscreen_dnsbl_threshold = 2
postscreen_dnsbl_whitelist_threshold = -2
postscreen_greet_action = drop
proxy_read_maps = $canonical_maps $lmtp_generic_maps $local_recipient_maps $mydestination $mynetworks $recipient_bcc_maps $recipient_canonical_maps $relay_domains $relay_recipient_maps $relocated_maps $sender_bcc_maps $sender_canonical_maps $smtp_generic_maps $smtpd_sender_login_maps $transport_maps $virtual_alias_domains $virtual_alias_maps $virtual_mailbox_domains $virtual_mailbox_maps $smtpd_sender_restrictions $sender_dependent_relayhost_maps
queue_directory = /var/spool/postfix
recipient_bcc_maps = proxy:mysql:/etc/postfix/mysql/recipient_bcc_maps_user.cf proxy:mysql:/etc/postfix/mysql/recipient_bcc_maps_domain.cf
recipient_delimiter = +
relay_domains = $mydestination proxy:mysql:/etc/postfix/mysql/relay_domains.cf
sender_bcc_maps = proxy:mysql:/etc/postfix/mysql/sender_bcc_maps_user.cf proxy:mysql:/etc/postfix/mysql/sender_bcc_maps_domain.cf
sender_dependent_relayhost_maps = proxy:mysql:/etc/postfix/mysql/sender_dependent_relayhost_maps.cf
sendmail_path = /usr/sbin/sendmail
setgid_group = postdrop
show_user_unknown_table_name = no
smtp-amavis_destination_recipient_limit = 1
smtp_tls_CAfile = $smtpd_tls_CAfile
smtp_tls_CApath = /etc/ssl/certs
smtp_tls_loglevel = 1
smtp_tls_mandatory_protocols = !SSLv2 !SSLv3
smtp_tls_note_starttls_offer = yes
smtp_tls_protocols = !SSLv2 !SSLv3
smtp_tls_security_level = may
smtpd_command_filter = pcre:/etc/postfix/command_filter.pcre
smtpd_data_restrictions = reject_unauth_pipelining
smtpd_end_of_data_restrictions = check_policy_service inet:127.0.0.1:7777
smtpd_helo_required = yes
smtpd_helo_restrictions = permit_mynetworks permit_sasl_authenticated check_helo_access pcre:/etc/postfix/helo_access.pcre reject_non_fqdn_helo_hostname reject_unknown_helo_hostname
smtpd_recipient_restrictions = reject_non_fqdn_recipient reject_unlisted_recipient check_policy_service inet:127.0.0.1:7777 permit_mynetworks permit_sasl_authenticated reject_unauth_destination check_policy_service inet:127.0.0.1:12340
smtpd_reject_unlisted_recipient = yes
smtpd_reject_unlisted_sender = yes
smtpd_sasl_path = private/dovecot-auth
smtpd_sasl_type = dovecot
smtpd_sender_login_maps = proxy:mysql:/etc/postfix/mysql/sender_login_maps.cf
smtpd_sender_restrictions = reject_non_fqdn_sender reject_unlisted_sender permit_mynetworks permit_sasl_authenticated check_sender_access pcre:/etc/postfix/sender_access.pcre reject_unknown_sender_domain
smtpd_tls_CAfile = /etc/ssl/certs/iRedMail.crt
smtpd_tls_CApath = /etc/ssl/certs
smtpd_tls_cert_file = /etc/ssl/certs/iRedMail.crt
smtpd_tls_dh1024_param_file = /etc/ssl/dh2048_param.pem
smtpd_tls_dh512_param_file = /etc/ssl/dh512_param.pem
smtpd_tls_exclude_ciphers = aNULL, eNULL, EXPORT, DES, RC4, MD5, PSK, aECDH, EDH-DSS-DES-CBC3-SHA, EDH-RSA-DES-CDC3-SHA, KRB5-DE5, CBC3-SHA
smtpd_tls_key_file = /etc/ssl/private/iRedMail.key
smtpd_tls_loglevel = 1
smtpd_tls_mandatory_protocols = !SSLv2 !SSLv3
smtpd_tls_protocols = !SSLv2 !SSLv3
smtpd_tls_security_level = may
swap_bangpath = no
tls_random_source = dev:/dev/urandom
transport_maps = proxy:mysql:/etc/postfix/mysql/transport_maps_user.cf proxy:mysql:/etc/postfix/mysql/transport_maps_maillist.cf proxy:mysql:/etc/postfix/mysql/transport_maps_domain.cf
unknown_local_recipient_reject_code = 550
virtual_alias_domains =
virtual_alias_maps = proxy:mysql:/etc/postfix/mysql/virtual_alias_maps.cf proxy:mysql:/etc/postfix/mysql/domain_alias_maps.cf proxy:mysql:/etc/postfix/mysql/catchall_maps.cf proxy:mysql:/etc/postfix/mysql/domain_alias_catchall_maps.cf
virtual_gid_maps = static:2000
virtual_mailbox_base = /var/vmail
virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql/virtual_mailbox_domains.cf
virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql/virtual_mailbox_maps.cf
virtual_minimum_uid = 2000
virtual_transport = dovecot
virtual_uid_maps = static:2000

编辑:在一些问题之后,我启用了:

postconf | grep smtp_sasl_auth_enable
smtp_sasl_auth_enable = yes

但是使用 openssl s_client,我得到了:

503 5.5.1 Error: authentication not enabled

更新:

设置后smtpd_sasl_auth_enable = yes我有机会输入我的密码,但它说密码错误。我正在使用密码管理器,所以密码应该是正确的。此外,我可以使用凭据通过 imap 登录。

535 5.7.8 Error: authentication failed: UGFzc3dvcmQ6

编辑:在 /var/log/maillog 上,我看到了这个致命的:通过 `smtp_sasl_password_maps' 配置参数指定密码表所以我使用了 postconf | grep smtp_sasl_password_maps smtp_sasl_password_maps = 也许这就是问题所在。但它不应该是空的,因为我使用了 iredmail,所以它应该是什么?

smtp postfix dovecot smtp-auth
  • 1 个回答
  • 1228 Views
Martin Hope
Sam
Asked: 2021-08-26 03:54:18 +0800 CST

phpinfo中的哪些信息是敏感信息?

  • 0

我被告知 phpinfo 包含敏感数据,因此您应该在生产环境中将其删除。但是今天下午我仔细看了看,并没有发现任何有趣的东西。所以这是我的问题。到底什么是敏感的?攻击者将如何使用这些信息?或者她/他会从配置页面知道什么?

php security php-fpm
  • 3 个回答
  • 452 Views
Martin Hope
Sam
Asked: 2021-08-14 01:04:27 +0800 CST

Mysqli访问被拒绝,使用UNIX套接字[重复]

  • 0
这个问题在这里已经有了答案:
启用对 MySQL 的无密码访问 6 个答案
去年关闭。

我正在尝试学习 PHP,并且正在设置数据库连接。
在 Mysql Workbench 上,我创建了一个名为 php 的数据库,并创建了一个表。然后我使用 auth_socket 创建了帐户“sam”@“localhost”,(我使用的是 Ubuntu 桌面,并且sam是 的输出whoami),Granted ALL on 。,当我按ctrl+alt+T输入mysql并按时enter,我可以成功登录。
现在我跟着https://www.php.net/manual/en/mysqli.quickstart.connections.php,并尝试使用套接字,我失败了。

2021/08/13 16:54:35 [error] 1363#1363: *11 FastCGI sent in stderr: "PHP message: PHP Warning:  mysqli::__construct(): (HY000/1698): Access denied for user 'sam'@'localhost' in /var/www/php/my2.php on line 3PHP message: PHP Warning:  main(): Couldn't fetch mysqli in /var/www/php/my2.php on line 5" while reading response header from upstream, client: 127.0.0.1, server: _, request: "GET /my2.php HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.4-fpm.sock:", host: "localhost:803"

这是我的代码。<?php

$mysqli = new mysqli("localhost", "sam", Null, "php");

echo $mysqli->host_info . "\n";

输出在浏览器中什么都没有。

然后我尝试了这个。

<html>
   <head>
      <title>Connecting MySQL Server</title>
   </head>
   <body>
      <?php
         $dbhost = 'localhost';
         $dbuser = 'sam';
         //$dbpass = 'root@123';
         $mysqli = new mysqli($dbhost, $dbuser,NULL,NULL,NULL,"/run/mysqld/mysqld.sock");
         
         if($mysqli->connect_errno ) {
            printf("Connect failed: %s<br />", $mysqli->connect_error);
            exit();
         }
         printf('Connected successfully.<br />');
         $mysqli->close();
      ?>
   </body>
</html>

输出是 Connect failed: Access denied for user 'sam'@'localhost'
带日志

2021/08/13 16:59:17 [error] 1363#1363: *13 FastCGI sent in stderr: "PHP message: PHP Warning:  mysqli::__construct(): (HY000/1698): Access denied for user 'sam'@'localhost' in /var/www/php/mysqli.php on line 10" while reading response header from upstream, client: 127.0.0.1, server: _, request: "GET /mysqli.php HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.4-fpm.sock:", host: "localhost:803"

我没有sammysql用户的密码。

MariaDB [mysql]> select user,password from user;
+-----------+-------------------------------------------+
| user      | password                                  |
+-----------+-------------------------------------------+
| root      |                                           |
| someone   | *2470C0C06DEE42FD1618BB99005ADCA2EC9D1E19 |
| someone   | *9B8A3238012965AC630589D859535EA0B7C231A7 |
| someone   | *AF411B6C73B3AC3A2316A309A71758175CC14FEE |
| someone   | *D76A454D84260E84578F09915624F275F3D0E08B |
| sam       |                                           |
+-----------+-------------------------------------------+
6 rows in set (0.001 sec)

我将实际用户名更改为某人以保护隐私。你可以看到sam没有密码。

mysql php socket
  • 1 个回答
  • 301 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