

Then we’ll edit the Postfix configuration file /etc/postfix/main.cf and alter the mailbox_command, thus: We’ll make a file called/etc/procmailrc, and add this to it: The next thing to do is integrate it into Postfix, and the easiest way to do that is with procmail. Text or plain is less dangerous because some mail clients execute message/rfc822, which is not good if they contain any kind of malware. A 0 tells you that email marked as spam is sent without modification, and only the headers will label it as spam.Ī 1 or a 2 means that a new report message will be created by SpamAssassin and delivered to the recipient.Ī value of 1 indicates that the spam message is coded as content message/rfc822, and if it’s a 2, that means the message has been coded as text or plain content. The report_safe command will have values of 0, 1, or 2. In the configuration file, if the parameter required_hits is 6, this tells you that SpamAssassin will consider an email to be spam if it scores 6 or more. The higher the score that the scripts deliver, the more chances there are that it’s spam. SpamAssassin runs a number of scripts to test how spammy an email is. Once you’ve done that, you can see how it’s configured in the /etc/mail/spamassassin/local.cf file. Then you just start the service and activate it at start-up: Installing it is as simple as doing this: Nobody likes spam, and SpamAssassin is probably the best free, open source spam fighting ninja that you could hope to have in your corner. Of course, we all get distracted and typing things in can often result in mistakes, but you can track down any misspellings that might compromise your Linux mail server using this command: When you change any of files used to configure Linux mail server for Postfix, you must reload the service, with this directive: This option designates which IP protocol version is used for server connections. This one determines what message is sent after the client connects successfully.Ĭonsider changing the banner so it doesn’t give away any potentially compromising information about your server. That means your lovely shiny server will be doing the heavy lifting for some bad guys and it will also end up getting banned. If this isn’t the case, then spammers can piggyback on your Linux mail server. It should only take local addresses like local mail scripts on your server. This will let you arrange which servers can relay through your Postfix server. Mail_spool_directory = /var/spool/mail mynetworks

Use any value that you want for this option but put a dollar sign in front of it like this: $. = myoriginĪll emails sent from this mail server will look as though they came from the one that you specify in this option.

This option is the mail domain that you will be servicing, like The hostnames will look something like,. Use this one to specify the hostname of the mail server, which is where postfix will obtain its emails. This file contains numerous options like: myhostname You can find the main configuration for Postfix Linux mail server in the /etc/postfix/main.cf file. After installing the Postfix mail server, you will need to set it up, and most of the files you’ll need for this can be found inside the /etc/postfix/ directory.
