简体   繁体   English

配置Seafile / Seahub以使用mail命令

[英]Configuring Seafile/Seahub to use mail command

Just installed an instance of Seafile on my CentOS server. 刚刚在我的CentOS服务器上安装了Seafile的实例。 It works OK, except for email notifications. 正常工作,除了电子邮件通知。 Some of the documentation on configuring email is missing from the online manual (page is 404'ed as of 2014-08-18 9:30a EDT). 在线手册中缺少一些有关配置电子邮件的文档(截至2014年8月18日美国东部时间9:30a,页面已被编辑404)。 The only other email related documtation I found was for configuring SMTP . 我发现的唯一与电子邮件相关的其他文档都是用于配置SMTP的

Is there a way to set Seafile/Seahub up to use the mail command (postfix/exim/ect) instead of SMTP? 有没有办法将Seafile / Seahub设置为使用邮件命令(postfix / exim / ect)而不是SMTP? I don't want to use my personal email credentials in the config file, and my SMTP service will not allow anonymous message delivery. 我不想在配置文件中使用我的个人电子邮件凭据,并且我的SMTP服务将不允许匿名邮件传递。

In my Googling, it looks like they have removed the ability to pipe to an MTA (like sendmail or postfix or exim). 在我的Google搜索中,似乎他们已删除了传递到MTA的功能(例如sendmail或postfix或exim)。 Instead, they now require you to provide an SMTP server and optional parameters for SMTP Auth. 相反,它们现在要求您提供SMTP服务器和SMTP身份验证的可选参数。

The solution is straightforward. 解决方案很简单。 You are quite likely already running an SMTP Server on your local machine that is listening on 127.0.0.1:25 (localhost port 25). 您很可能已经在侦听127.0.0.1:25(本地主机端口25)的本地计算机上运行了SMTP服务器。 Simply configure the host and port to that, and follow the instructions in Note 2: 只需为此配置主机和端口,然后按照注释2中的说明进行操作:

Note2: If you want to use the Email service without authentication leave EMAIL_HOST_USER and EMAIL_HOST_PASSWORD blank (''). 注意2:如果要使用未经身份验证的电子邮件服务,请将EMAIL_HOST_USER和EMAIL_HOST_PASSWORD留空(“)。 (But notice that the emails then will be sent without a From: address.) (但是请注意,随后将发送的电子邮件中没有发件人:地址。)

The "without a From: address" is fine, your local mail server will add that for you (in what is typically called a fix-up mode when messages are submitted locally). “没有发件人:地址”很好,您的本地邮件服务器会为您添加该地址(在本地提交邮件时,通常称为修正模式)。 It will be whatever user you are running the webserver as @ the hostname of the machine. 它将是您以Web主机名运行Web服务器的任何用户。

An even better option would be to have your local mail server configured to support SMTP Auth. 更好的选择是将本地邮件服务器配置为支持SMTP身份验证。 To do this, you create a user which is really only intended to send email and configure that user in the settings. 为此,您创建一个用户,该用户实际上仅打算发送电子邮件并在设置中配置该用户。 For example, create a user named 'notifier', set the password to something long and complicated, then configure the two settings that were omitted above to the username (likely without the @hostname part) and the password. 例如,创建一个名为“ notifier”的用户,将密码设置为冗长而复杂的名称,然后将上面省略的两个设置分别配置为用户名(可能没有@hostname部分)和密码。

You said you're running Exim, so let's do a little looking under the hood. 您说您正在运行Exim,所以让我们来做个简单的介绍。 Is it nstalled from source? 它是从源头安装的吗? From RPM? 从RPM? Does the exim.conf have an authenticators section that defines PLAIN or LOGIN authentication types? exim.conf是否具有用于定义PLAIN或LOGIN身份验证类型的身份验证器部分? If yes, then it will likely work with a system account and password out of the box. 如果是,那么它很可能会使用系统帐户和密码开箱即用。 If it doesn't have those authenticators, then you'll have to add them, and it should be as simple as the authenticators code segment (using PAM) shown in https://github.com/Exim/exim/wiki/AuthenticatedSmtpUsingPam . 如果没有这些验证者,则必须添加它们,并且它应该与https://github.com/Exim/exim/wiki/AuthenticatedSmtpUsingPam中显示的验证者代码段(使用PAM)一样简单。 。 I don't think you'll need to recompile because linking against PAM is pretty standard for modern Exim builds. 我认为您不需要重新编译,因为与PAM链接是现代Exim构建的相当标准。 The RPMs that I build for myself are based off of the AtRPMS source and IIRC, and they link to PAM by default. 我为自己构建的RPM基于AtRPMS源和IIRC,并且默认情况下它们链接到PAM。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM