Using and Administering Linux: Volume 3: Zero to SysAdmin: Network Services by David Both

Using and Administering Linux: Volume 3: Zero to SysAdmin: Network Services by David Both

Author:David Both [David Both]
Language: eng
Format: epub, pdf
Publisher: Apress
Published: 2019-12-13T16:00:00+00:00


This revised code adds the X-Spam-Status header, prepends the “####SPAM####” string and the number of hits to the subject line, and attaches the SpamAssassin report to the end of the email message. It also does this for non-spam emails except that the message prepended to the subject is a bit different and says “####NOT SPAM####.” We do it this way in this experiment so that we can see that our spam detector is working even if the emails are not spam.

In a real-world environment, I do add the X-Spam-Status line to the headers on non-spam messages (ham), but I do not normally add anything to the subject line or append the SpamAssassin report to the message.

Note that this revision of the code does not delete existing headers.

Many users tend to freak out when they see that SpamAssassin report and the subject line with “####SPAM####” in it. As a result, I only add the report when I am trying to determine the source of a problem, such as a rule that is not working. The report allows me to easily see what is in the headers, but includes more information such as the exact score added by each rule. Also, if a user forwards an email to me, the report stays attached to the email but the original headers are deleted so they would be useless at that point.

Now we can start and enable MIMEDefang and restart SendMail. Note that SendMail must always be restarted after starting or restarting MIMEDefang. I wrote a little shell script to stop both services and then restart them in the correct sequence because I automate everything. It does not matter in which order they are stopped but they must be started MIMEDefang first and then SendMail. This is because MIMEDefang opens a socket that SendMail must find and also connect to. The socket is their communication channel.[root@studentvm2 ~]# systemctl start mimedefang ; systemctl enable mimedefang

Created symlink /etc/systemd/system/multi-user.target.wants/mimedefang.service → /usr/lib/systemd/system/mimedefang.service.

Created symlink /etc/systemd/system/multi-user.target.wants/mimedefang-multiplexor.service → /usr/lib/systemd/system/mimedefang-multiplexor.service.

[root@studentvm2 ~]#



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.