简体   繁体   English

Ubuntu exim4-配置设置和垃圾邮件过滤器

[英]Ubuntu exim4 - Config setup and spam filters

I've recently setup my Ubuntu web server with exim4 so my PHP website applications can send email such as "thank you" and "confirmation" notices. 我最近使用exim4设置了Ubuntu Web服务器,以便我的PHP网站应用程序可以发送电子邮件,例如“谢谢”和“确认”通知。

I've got it setup and working such that I can send email to gmail, Yahoo! 我已经设置好并且可以正常工作,以便可以将电子邮件发送到gmail,Yahoo! and my work address. 还有我的工作地址 However, my work email gets caught up in our spam filter. 但是,我的工作电子邮件陷入了我们的垃圾邮件过滤器中。 I'm new to setting up mail servers so I'm not sure what I might need to look for in making this mail server more trusted, while keeping is secure. 我是设置邮件服务器的新手,因此不确定在保持安全的同时使该邮件服务器更受信任时可能需要寻找什么。

Here are some details: 以下是一些详细信息:

  • Server is NATed behind a firewall. 服务器在防火墙后被NAT。
  • Firewall has port 25 open for outgoing SMTP traffic (from server to anywhere). 防火墙已打开端口25,用于传出SMTP流量(从服务器到任何地方)。
  • Server is virtual hosting a couple different of our websites 服务器虚拟托管了我们两个不同的网站
  • The server is running the following exim4 config: 服务器正在运行以下exim4配置:

dc_eximconfig_configtype='internet' dc_eximconfig_configtype ='互联网'
dc_other_hostnames='web-serv.example1.com;example2.com' dc_other_hostnames ='web-serv.example1.com; example2.com'
dc_local_interfacees='127.0.0.1' dc_local_interfacees ='127.0.0.1'
dc_readhost='' dc_readhost =''
dc_relay_domains='' dc_relay_domains =''
dc_minimaldns='false' dc_minimaldns ='假'
dc_relay_nets='' dc_smarthost='' dc_relay_nets =''dc_smarthost =''
CFILEMODE='644' CFILEMODE ='644'
dc_use_split_config='false' dc_use_split_config ='假'

Questions: 问题:

Do I need to open port 25 to incoming SMTP mail (anywhere to server)? 我是否需要打开端口25来接收SMTP邮件(在服务器的任何位置)? I wonder if other mail servers need to talk to my mail server to verify itself, in a sort of handshake attempt. 我不知道其他邮件服务器是否需要通过某种握手尝试与我的邮件服务器进行通信以验证自身。

I have not created any MX records primarily because the server has different websites on it the mail server should send mail for all the websites. 我尚未创建任何MX记录,主要是因为服务器上具有不同的网站,邮件服务器应该为所有网站发送邮件。 Do I need to pick/create a domain address and create MX records for it? 我是否需要选择/创建域地址并为其创建MX记录?

One thing of note is that the mail headers look like this: 需要注意的一件事是邮件头看起来像这样:

Return-Path: <www-data@example2.com>  
Received: from web-serv.example1.com ([Firewall public IP Address])  
Received-SPF: neutral (google.com: [Firewall public IP Address] is neither permitted nor denied by best guess record for domain of www-data@example2.com)

"web-serv" is the host name of the server, such that you get this if you type it into the command line: “ web-serv”是服务器的主机名,因此,如果在命令行中将其键入,则会得到此名称:

$ hostname  
web-serv

and "www-data" is the account name for the Apache2 server that Ubuntu gave it as default. “ www-data”是Ubuntu2默认提供的Apache2服务器的帐户名。

Any other general advice would be appreciated. 任何其他一般性建议将不胜感激。 It's all new to me. 这对我来说都是新的。

Cheers! 干杯!

One item of note, since I posted this question time time ago (almost 10 months) is that I found out the biggest issue I had was with setting up the DNS for reverse DNS on our hosting providers side of things. 需要注意的一项是,自从我在一段时间(近10个月前)发布此问题以来,我发现我遇到的最大问题是在我们的托管服务提供商方面为反向DNS设置DNS。

In other words, our hosting provider (the people who give us our IP address and manage our hardware) had to enter a record to match my server(s) hostname to whatever IP address it used. 换句话说,我们的托管服务提供商(向我们提供IP地址并管理我们的硬件的人员)必须输入一条记录,以使我的服务器的主机名与其​​使用的任何IP地址相匹配。

There's a specific name for this. 有一个特定的名称。 I believe it's a "PTR" record but the name escapes me at the moment, but you basically tell them "my server hostname is ..." and they do a quick update to the DNS for reverse DNS purposes. 我相信它是“ PTR”记录,但是此名称此刻使我不知所措,但是您基本上告诉他们“我的服务器主机名是...”,并且它们为反向DNS目的对DNS进行了快速更新。

When I asked this question, we had a different hosting provider who didn't really help explain this to me, and after switching providers, I got to talk to someone who was happy to help me understand that side of the equation. 当我问这个问题时,我们有另一位托管服务提供商,并没有真正向我解释这一点,在更换提供商后,我不得不和很高兴帮助我了解方程式那边的人交谈。

And as I understand it, this is setup by the people who assign you the IP addresses. 据我了解,这是由为您分配IP地址的人员设置的。 But there's probably more to it than that. 但是,可能还有更多。

Once I got that setup properly, email had no problem getting through the spam filters and Gmail/Yahoo showed SPF as "passed". 一旦设置正确,电子邮件就可以毫无问题地通过垃圾邮件过滤器,而Gmail / Yahoo将SPF显示为“通过”。 It was showing neutral before. 以前显示中立。

Our company email was set to drop any email that would not resolve reverse DNS, which is why I could not even receive the email or find it in the spam filter. 我们公司的电子邮件被设置为删除所有无法解析反向DNS的电子邮件,这就是为什么我什至无法收到电子邮件或无法在垃圾邮件过滤器中找到它的原因。 Of course, that situation would be dependent on the company and what email policy and software they're using to manage spam. 当然,这种情况取决于公司以及他们用于管理垃圾邮件的电子邮件策略和软件。 Some might just drop all email that does not reverse DNS and some might dump it in to spam filters instead. 有些可能只是丢弃所有不反向DNS的电子邮件,而有些可能将其转储到垃圾邮件过滤器中。

Hope that might help some people with similar issues. 希望对某些有类似问题的人有所帮助。

Cheers! 干杯!

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

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