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-563231

Mathéo Tichy's questions

Martin Hope
Mathéo Tichy
Asked: 2022-01-05 01:40:44 +0800 CST

ssmtp 不工作,不想登录

  • 0

我已将 SSMTP 配置为发送邮件,但问题是我无法从我的网络服务器发送邮件并且没有登录/var/log。有时,我有Sender mismatchapache 日志。

我的配置:Debian 11 和网络服务器到 Docker 容器中。

这是我的 SSMTP 配置:

hostname=domain.fr
[email protected]
mailhub=mail.infomaniak.com:587
[email protected]
AuthPass=PASS
UseTLS=YES
UseSTARTTLS=YES
Debug=YES

进入我已经得到的修饰:

www-data:[email protected]:mail.infomaniak.com:587
root:[email protected]:mail.infomaniak.com:587

编辑:这是我安装和配置 SSMTP 的 Dockerfile 中的一部分:

&& apt -y install ssmtp mailutils \
&& echo "hostname=domain.fr" > /etc/ssmtp/ssmtp.conf \
&& echo "[email protected]" >> /etc/ssmtp/ssmtp.conf \
&& echo "mailhub=mail.infomaniak.com:587" >> /etc/ssmtp/ssmtp.conf \
&& echo "[email protected]" >> /etc/ssmtp/ssmtp.conf \
&& echo "AuthPass=" >> /etc/ssmtp/ssmtp.conf \
&& echo "UseTLS=YES" >> /etc/ssmtp/ssmtp.conf \
&& echo "UseSTARTTLS=YES" >> /etc/ssmtp/ssmtp.conf \
&& echo "Debug=YES" >> /etc/ssmtp/ssmtp.conf \
&& echo "www-data:[email protected]:mail.infomaniak.com:587" >> /etc/ssmtp/revaliases

有关信息,在 CLI 中,我可以在使用 root 帐户时发送电子邮件。

我的问题可能是什么?

谢谢你的帮助 !

debian sendmail ssmtp
  • 2 个回答
  • 382 Views
Martin Hope
Mathéo Tichy
Asked: 2020-07-30 12:09:54 +0800 CST

Postfix 邮件服务器 & dovecot 可以发送但不能接收

  • 0

今天我用这个教程创建了一个邮件服务器:https ://www.milbako.com/e-mail-avec-postfix-dovecot-et-mysql/ 我可以发送邮件(被检测为垃圾邮件,但它有效),但如果我用我的gmail地址给我发了一封电子邮件,它不会工作......

这是我的 main.cf 文件:

# See /usr/share/postfix/main.cf.dist for a commented, more complete version

# Debian specific:  Specifying a file name will cause the first
# line of that file to be used as the name.  The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname

smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

readme_directory = no

# See http://www.postfix.org/COMPATIBILITY_README.html -- default to 2 on
# fresh installs.
compatibility_level = 2


# TLS parameters
smtpd_tls_cert_file=/etc/letsencrypt/live/cpmtech.fr-0001/fullchain.pem
smtpd_tls_key_file=/etc/letsencrypt/live/cpmtech.fr-0001/privkey.pem
smtpd_use_tls=yes
smtpd_tls_auth_only = yes
smtp_tls_security_level = may
smtpd_tls_security_level = may
smtpd_sasl_security_options = noanonymous, noplaintext
smtpd_sasl_tls_security_options = noanonymous

# Authentication
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_auth_enable = yes

# Voir /usr/share/doc/postfix/TLS_README.gz dans le paquet postfix-doc pour plus de détails.
# informations sur l’activation de SSL dans le client smtp.

# Restrictions
smtpd_helo_restrictions =
 permit_mynetworks,
 permit_sasl_authenticated,
 reject_invalid_helo_hostname,
 reject_non_fqdn_helo_hostname
smtpd_recipient_restrictions =
 permit_mynetworks,
 permit_sasl_authenticated,
 reject_non_fqdn_recipient,
 reject_unknown_recipient_domain,
 reject_unlisted_recipient,
 reject_unauth_destination
smtpd_sender_restrictions =
 permit_mynetworks,
 permit_sasl_authenticated,
 reject_non_fqdn_sender,
 reject_unknown_sender_domain
smtpd_relay_restrictions =
 permit_mynetworks,
 permit_sasl_authenticated,
 defer_unauth_destination

# Voir /usr/share/doc/postfix/TLS_README.gz dans le paquet postfix-doc pour plus de détails.
# informations sur l’activation de SSL dans le client smtp.

myhostname = cpmtech.fr
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydomain = cpmtech.fr
myorigin = $mydomain
mydestination = localhost
relayhost =
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all

# Remettre la livraison locale au LMTP de Dovecot et lui dire où stocker le courrier
virtual_transport = dovecot

# Domaines virtuels, utilisateurs et alias
virtual_mailbox_domains = mysql:/etc/postfix/mysql-virtual-mailbox-domains.cf
virtual_mailbox_maps = mysql:/etc/postfix/mysql-virtual-mailbox-maps.cf
virtual_alias_maps = mysql:/etc/postfix/mysql-virtual-alias-maps.cf,
 mysql:/etc/postfix/mysql-virtual-email2email.cf

# Encore plus de restrictions et de paramètres MTA
disable_vrfy_command = yes
strict_rfc821_envelopes = yes
#smtpd_etrn_restrictions = reject
#smtpd_reject_unlisted_sender = yes
#smtpd_reject_unlisted_recipient = yes
smtpd_delay_reject = yes
smtpd_helo_required = yes
smtp_always_send_ehlo = yes
#smtpd_hard_error_limit = 1
smtpd_timeout = 30s
smtp_helo_timeout = 15s
smtp_rcpt_timeout = 15s
smtpd_recipient_limit = 40
minimal_backoff_time = 180s
maximal_backoff_time = 3h

# Codes de rejet de réponse
invalid_hostname_reject_code = 550
non_fqdn_reject_code = 550
unknown_address_reject_code = 550
unknown_client_reject_code = 550
unknown_hostname_reject_code = 550
unverified_recipient_reject_code = 550
unverified_sender_reject_code = 550

#smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
#myhostname = cpmtech.fr
#alias_maps = hash:/etc/aliases
#alias_database = hash:/etc/aliases
#mydestination = cpmtech.fr, localhost.cpmtech.fr, localhost
#mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
#mailbox_size_limit = 0
#recipient_delimiter = +
#inet_protocols = all
#myorigin = /etc/mailname
#mynetworks_style = subnet
#recipient_canonical_maps =
#relayhost = 
#inet_interfaces = all
#virtual_alias_maps = hash:/etc/postfix/virtual

如果我想阅读日志,/var/log/ 不包含 Postfix 日志

谢谢你的帮助 !

debian email postfix email-server dovecot
  • 1 个回答
  • 93 Views
Martin Hope
Mathéo Tichy
Asked: 2020-03-09 08:29:46 +0800 CST

使用 SSHD 限制 SFTP 上的 documentroot

  • 0

我在 debian 8 上使用 proFTPD。出于某些原因,我需要只能访问其 documentroot 的用户。我已经配置了它并且它可以工作,但只有当我连接到 FTP 时。

如果用户在 SFTP 上连接,他将能够访问整个 FTP。

我能怎么做 ?

编辑 :

我找到了如何纠正我的问题。

1) 我停止了 proFTD,因为它会引起问题。我在默认的 SSH 服务器和我的 debian 服务器上切换

2) 所有文件夹都归root:root所有,拥有755个权限。在我的情况下,它是/, /var, /var/www, and/var/www/dev

3) SSHD 配置为:

Subsystem sftp internal-sftp Match Group dev ChrootDirectory /var/www/dev ForceCommand internal-sftp AllowTcpForwarding no

ftp sftp proftpd documentroot
  • 2 个回答
  • 260 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