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
    • 最新
    • 标签
主页 / computer / 问题

问题[smtp](computer)

Martin Hope
Digital Joe George
Asked: 2023-09-27 02:33:58 +0800 CST

如果我在端口 587 上发送电子邮件,为什么我需要在防火墙中允许 Postfix 端口 25

  • 5

我使用我的 postfix smtp 仅发送外发电子邮件。它不会接收传入的消息。我在 Namecheap 上有我的邮箱。

我使用名为 Mailwizz 的客户端来连接我的 Postfix SASL 用户凭据。这发生在端口 587 上。

我进行了测试,电子邮件发送没有问题。

问题:如果我使用port 587Mailwizz 发送电子邮件,为什么需要port 25在防火墙中允许? 如果我禁用会发生什么port 25?

另外,我很困惑是否应该允许端口 587 和/或通过 TCP 监听。

我是否运行这两个命令:

sudo ufw allow 587

sudo ufw allow 587/tcp

还是只要一个就够了?如果有,是哪一个?

smtp
  • 1 个回答
  • 69 Views
Martin Hope
CabbageGremlin
Asked: 2023-05-04 18:09:59 +0800 CST

如何在 Postfix 中拥有多个用于 SASL 身份验证的数据库?

  • 5

我目前已将 Postfix 设置为使用 SASL 验证提交。数据库连接信息存储在 /etc/postfix/sasl/smtpd.conf

但是,我终其一生都无法弄清楚如何拥有两个数据库来检查有效用户。我目前正在尝试为不同的域托管电子邮件,出于安全原因,它们必须位于不同的数据库中。

如何配置 Postfix SASL 检查多个数据库?

我知道 smtp_sender_dependent_authentication 有一个选项,但我不知道如何使用它。

smtp
  • 1 个回答
  • 24 Views
Martin Hope
Life is complex
Asked: 2022-10-11 11:11:40 +0800 CST

使用 PowerShell 根据时间范围在应用程序日志中搜索字符串

  • 7

2022 年 11 月 10 日更新

我添加了时间框架参数,但我收到了空正文的错误消息。我该如何防止这种情况?

这是我当前的脚本:

$Subject = "EventLogAlert {0:yyyy-MM-dd HH:mm:ss} on $env:COMPUTERNAME" -f (Get-Date)

$Server = "smtp.server" 
$From = "[email protected]" 


$To = "[email protected]"
$Pwd = ConvertTo-SecureString "******" -AsPlainText –Force

#(Warning! Use a very restricted account for the sender, because the password stored in the script will be not encrypted)
$Cred = New-Object System.Management.Automation.PSCredential("[email protected]" , $Pwd)

$encoding = [System.Text.Encoding]::UTF8


$EndTime = Get-Date
$StartTime = (Get-Date).AddMinutes(-15)


$events    = Get-WinEvent -FilterHashtable @{LogName="Application";ID=400;ProviderName="ProviderNameGoesHere";StartTime=$StartTime;EndTime=$EndTime} |
             Where-Object {$_.Message -like '*StingToLookFor*'} |
             Select-Object -Property TaskDisplayName,ID,TimeCreated,Message -First 1


$Body = $events

Send-MailMessage -From $From -To $To -SmtpServer $Server -Body "$Body"  -Subject $Subject -Credential $Cred -Encoding $encoding

错误信息:

At C:\ps\script_name:1 char:1

+ script name: script_name.ps1

+ ~~~~~~

    + CategoryInfo          : ObjectNotFound: (script:String) [], CommandNotFoundException

    + FullyQualifiedErrorId : CommandNotFoundException

Get-WinEvent : No events were found that match the specified selection criteria.

At C:\ps\script_name.ps1:22 char:14

+ ... events    = Get-WinEvent -FilterHashtable @{LogName="Application";ID= ...

+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : ObjectNotFound: (:) [Get-WinEvent], Exception

    + FullyQualifiedErrorId : NoMatchingEventsFound,Microsoft.PowerShell.Commands.GetWinEventComm

   and

Send-MailMessage : Cannot validate argument on parameter 'Body'. The argument is null or empty.

Provide an argument that is not null or empty, and then try the command again.

At C:\ps\script_name.ps1:29 char:64

+ ... Message -From $From -To $To -SmtpServer $Server -Body "$Body"  -Subje ...

+                                                           ~~~~~~~

    + CategoryInfo          : InvalidData: (:) [Send-MailMessage], ParameterBindingValidationExce

   ption

    + FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.PowerShell.Commands.Send

   MailMessage

原帖 2022 年 10 月 10 日

我是 PowerShell 的新手。我正在开发一个脚本来监视特定字符串的应用程序日志。下面的脚本有效,但我需要帮助限制搜索的时间范围。现在它搜索整个日志。我只想搜索最后 15 分钟,并且仅在此时间范围内匹配时才发送电子邮件。该脚本通过任务计划程序每 10 分钟运行一次。

有人可以指导我解决这个问题吗?

#Mail SMTP Setup Section
$Subject = "EventLogAlert {0:yyyy-MM-dd HH:mm:ss} on $env:COMPUTERNAME" -f (Get-Date)
$Server = "smtp.server" 
$From = "[email protected]" 

$To = "[email protected]"
$Pwd = ConvertTo-SecureString "enterpassword" -AsPlainText –Force password
$Cred = New-Object System.Management.Automation.PSCredential("[email protected]" , $Pwd) #Sender account credentials

$encoding = [System.Text.Encoding]::UTF8 


$events    = Get-WinEvent -FilterHashtable @{LogName="Application";ID=400;ProviderName="ProviderNameGoesHere"} | 
             Where-Object {$_.Message -like '*StingToLookFor*'} | 
             Select-Object -Property TaskDisplayName,ID,TimeCreated,Message



$Body=Get-WinEvent -FilterHashtable @{LogName="Application";ID=400;ProviderName='ProviderNameGoesHere'} | Select TimeCreated,Message | select-object -First 1


Send-MailMessage -From $From -To $To -SmtpServer $Server -Body "$Body"  -Subject $Subject -Credential $Cred -Encoding $encoding
powershell smtp
  • 2 个回答
  • 246 Views
Martin Hope
Nagarajan Sree
Asked: 2022-05-26 06:28:03 +0800 CST

谷歌 SMTP 是如何工作的?

  • 5

我正在对一个发送电子邮件的恶意软件进行恶意软件分析。该恶意软件包含一些硬编码的电子邮件地址。它使用 Google SMTP 发送电子邮件,我不确定它是如何工作的

首先,恶意软件发出一个 DNS 请求来解析谷歌的 SMTP 服务器 IP。 DNS查询

然后它启动 3 次握手 TCP 与 google 的服务器 握手 3 次与 google SMTP 服务器握手

然后恶意软件发送一封电子邮件,但我不确定它如何通过谷歌服务器进行身份验证或识别将电子邮件发送到哪里。 服务器和恶意软件之间的 TCP 通信流

这是原始的 pcapng 文件:wetransfer 中的 pcap 文件

我的问题是 Google SMTP 如何解决将电子邮件发送给谁的问题?还有可能有一个类似于 fakedns 的假 google SMTP 服务器,以便我可以接收电子邮件吗?

malware smtp
  • 1 个回答
  • 41 Views
Martin Hope
D4v1dH03
Asked: 2022-03-28 17:14:17 +0800 CST

如何让 Postfix 和 Dovecot 与现有的 Kerberos 领域一起工作?

  • 4

我现在有一个 Kerberos 领域,例如MYDOMAIN.CH,一个管理服务器和一个主体root/admin,以及领域主密码和root/admin主体密码。现在我想使用 Postfix 和 Dovecot 设置 Kerberos 身份验证,以便让客户端使用 Kerberos 进行身份验证,并以经过身份验证的方式发送/接收电子邮件。

在问这个问题之前,我已经对谷歌进行了一些研究,但不幸的是没有找到任何结果(而且 RedHat 的背后是一个不可逾越的硬付费墙)。

我需要调整哪些配置,尤其是配置文件中的身份验证配置才能实现此目标?此外,我需要使用专用的 Unix 套接字,例如private/authKerberos,以便身份验证仅以相对安全的方式进行。

smtp imap
  • 1 个回答
  • 362 Views
Martin Hope
Azertux0
Asked: 2021-12-15 10:53:10 +0800 CST

无法通过 MSTP 使用 Mutt 以 root 身份发送邮件

  • 5

我成功地设置了 Mutt 和 SMPT 以通过电子邮件向自己发送一些日志。

作为用户,它可以完美运行

但是,当我要求sudo crontab -e在root运行一些脚本后发送一些日志时,我收到此错误:


09 15  * * * /home/user/dir/job_reports.bash > /home/user/dir/log_reports.log 2>&1 | mutt -s 'logs reporting' -a /home/user/dir/plot.png -- '[email protected]' [email protected] < /home/user/dir/log_reports.log

sendmail: the server sent an invalid response
sendmail: the email could not be sent (default account in / etc / msmtprc)
Error sending message, son terminated with code 76 (Remote protocol error.).
Unable to send message. 

日志/var/log/smptc给出了这个:

déc. 14 19:24:34 host=smtp-mail.outlook.com tls=on auth=on [email protected] [email protected] [email protected] errormsg='le serveur a envoyé une réponse invalide' exitcode=EX_PROTOCOL

这是/etc/msmtprc :

# Valeurs par défaut pour tous les comptes.
defaults
auth           on
tls            on
tls_starttls   on
tls_trust_file /etc/ssl/certs/ca-certificates.crt
logfile        /var/log/msmtp

# compte Outlook
account        outlook
#auth          login
host           smtp-mail.outlook.com
port           587
from           [email protected]
user           [email protected]
password       password

account default : outlook

我正在使用这些包msmtp,msmtp-mta并且mutt.

我不知道怎么走得更远。

请你帮我一些提示。

smtp root
  • 1 个回答
  • 158 Views
Martin Hope
user1424739
Asked: 2020-12-29 22:15:49 +0800 CST

nc和telnet的区别以smtp服务为例

  • 5

我可以同时使用nc和telnet连接到端口 25。

$ nc 192.168.1.120 25
220 localhost ESMTP Exim 4.68 Tue, 29 Dec 2020 06:07:27 +0000

$ telnet 192.168.1.120 25
Trying 192.168.1.120...
Connected to 192.168.1.120.
Escape character is '^]'.
220 localhost ESMTP Exim 4.68 Tue, 29 Dec 2020 06:07:32 +0000

我试图理解 和 之间的nc区别telnet。这里虽然有一些讨论,但并没有根据上面的例子进行解释。

telnet 和 netcat 有什么区别?

nc任何人都可以解释和telnet使用上面的例子之间的区别吗?

对于这个例子,它们都可以用来获得相同的结果吗?谢谢。

telnet smtp
  • 1 个回答
  • 656 Views
Martin Hope
Sergio Del Franco
Asked: 2020-04-08 04:38:42 +0800 CST

cURL:使用-F(多部分/附件)时如何设置电子邮件主题

  • 7

我正在尝试使用 cURL 发送电子邮件。它必须包含一个附件,所以我使用 -F / --form 选项:

(这是一行,但我在这里写这种方式是为了澄清)

curl smtp://smtp.example.com
     --ssl
     --mail-from [email protected]
     --mail-rcpt [email protected]
     --user login
     -F "=<body.txt;encoder=quoted-printable"
     -F "[email protected];encoder=base64"

它有点工作;邮件到达,但我不知道如何在电子邮件本身上设置标题(事实上,我现在唯一需要的是主题)。

我尝试将其设置为第一部分(文本):

     -F "=<body.txt;encoder=quoted-printable;headers=Subject: The files you requested"

但是 cURL 有效地将标题设置为该部分,从而产生这样的电子邮件(原始文本):

     (email headers not including Subject)

     -----------------part-boundary
     Content-Transfer-Encoding: quoted-printable
     Subject: The files you requested

     (content of body.txt)
     -----------------part-boundary
     Content-Disposition: attachment; filename="files.zip"
     Content-Type: application/octet-stream
     Content-Transfer-Encoding: base64

     (content of files.zip encoded in base64)
     -----------------part-boundary--

那么,如何设置邮件的主题呢?

curl smtp
  • 2 个回答
  • 4141 Views
Martin Hope
vico
Asked: 2020-01-25 01:28:50 +0800 CST

选择 SMTP 服务器

  • 7

我有提供 SMTP 服务器的电子邮件提供商。我的 Internet 提供商也提供 SMTP 服务器。在这种情况下,哪个 SMTP 服务器更适合使用?

互联网提供商是否可以将 SMTP 请求重新路由到其 SMTP 服务器?

email smtp
  • 1 个回答
  • 75 Views
Martin Hope
Rainer Schwarze
Asked: 2019-10-20 00:34:59 +0800 CST

使 postfix 使用 sasl / auth plain 将出站邮件发送到中继服务器

  • 6

我的 postfix 不会将 AUTH PLAIN 发送到传出中继服务器。它必须在几天前工作,但现在我收到“不允许中继”的退回邮件。

邮件系统使用 postfix、fetchmail 和 dovecot 在 Alpine Linux VM 中运行。Postfix 使用 Cyrus SASL 库,而不是 dovecot 库。

main.cf 的相关部分:

relayhost = [RELAY_HOST]
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/mailsrv/etc/postfix/sasl_passwd
smtp_sasl_security_options =

sasl_passwd:

[RELAY_HOST] USER:PASSWORD

我使用 tcpdump 捕获了一个传出会话,并且没有发送 AUTH PLAIN。我使用正确的 AUTH PLAIN 行测试了通过 telnet 手动发送邮件,它工作正常。

所以我的解释是,后缀在某些时候不会决定使用 SASL / AUTH PLAIN。

可能是什么问题呢?

权限应该没问题,postmap 已被调用,postfix 重新启动并重新加载,libsasl 已安装并且 postfix 报告已使用 cyrus 构建。我知道这是陈词滥调,但该系统几天前可以正常工作。某些证书到期是否可能是一个问题,我在日志中没有看到?

postfix smtp
  • 1 个回答
  • 1030 Views

Sidebar

Stats

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

    如何减少“vmmem”进程的消耗?

    • 11 个回答
  • Marko Smith

    从 Microsoft Stream 下载视频

    • 4 个回答
  • Marko Smith

    Google Chrome DevTools 无法解析 SourceMap:chrome-extension

    • 6 个回答
  • Marko Smith

    Windows 照片查看器因为内存不足而无法运行?

    • 5 个回答
  • Marko Smith

    支持结束后如何激活 WindowsXP?

    • 6 个回答
  • Marko Smith

    远程桌面间歇性冻结

    • 7 个回答
  • Marko Smith

    子网掩码 /32 是什么意思?

    • 6 个回答
  • Marko Smith

    鼠标指针在 Windows 中按下的箭头键上移动?

    • 1 个回答
  • Marko Smith

    VirtualBox 无法以 VERR_NEM_VM_CREATE_FAILED 启动

    • 8 个回答
  • Marko Smith

    应用程序不会出现在 MacBook 的摄像头和麦克风隐私设置中

    • 5 个回答
  • Martin Hope
    Vickel Firefox 不再允许粘贴到 WhatsApp 网页中? 2023-08-18 05:04:35 +0800 CST
  • Martin Hope
    Saaru Lindestøkke 为什么使用 Python 的 tar 库时 tar.xz 文件比 macOS tar 小 15 倍? 2021-03-14 09:37:48 +0800 CST
  • Martin Hope
    CiaranWelsh 如何减少“vmmem”进程的消耗? 2020-06-10 02:06:58 +0800 CST
  • Martin Hope
    Jim Windows 10 搜索未加载,显示空白窗口 2020-02-06 03:28:26 +0800 CST
  • Martin Hope
    andre_ss6 远程桌面间歇性冻结 2019-09-11 12:56:40 +0800 CST
  • Martin Hope
    Riley Carney 为什么在 URL 后面加一个点会删除登录信息? 2019-08-06 10:59:24 +0800 CST
  • Martin Hope
    zdimension 鼠标指针在 Windows 中按下的箭头键上移动? 2019-08-04 06:39:57 +0800 CST
  • Martin Hope
    jonsca 我所有的 Firefox 附加组件突然被禁用了,我该如何重新启用它们? 2019-05-04 17:58:52 +0800 CST
  • Martin Hope
    MCK 是否可以使用文本创建二维码? 2019-04-02 06:32:14 +0800 CST
  • Martin Hope
    SoniEx2 更改 git init 默认分支名称 2019-04-01 06:16:56 +0800 CST

热门标签

windows-10 linux windows microsoft-excel networking ubuntu worksheet-function bash command-line hard-drive

Explore

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

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve