Showing posts with label SPF. Show all posts
Showing posts with label SPF. Show all posts

Friday, July 4, 2014

installing Postfix on Ubuntu as an internal mail server

I had a client who wanted to have an internal email server for sending outbound emails.  This email server would be used for sending scans (via scan to email) where the copier didn't support TLS and the email server required TLS and also for email blasts (where users send out mass emails via a local software program like WorldCast).

I successfully implemented Postfix running on Ubuntu.

These directions (relevant on 7/3/14) and derived from here:
https://www.digitalocean.com/community/tutorials/how-to-install-and-setup-postfix-on-ubuntu-12-04

This will allow you to configure any local mail client to send out unauthenticated emails from these subnets:
192.168.0.0
192.168.1.0
192.168.2.0
192.168.3.0

Just set the SMTP server as the with the IP address of the Ubuntu machine (preferably a virtual machine).

Create a new virtual machine with 2 GB of RAM and 30 GB of HD space.

Download and install Ubuntu Linux from here (964 MB):
http://www.ubuntu.com/download/desktop/thank-you/?version=14.04&architecture=amd64

Once installed using all logical defaults, click the search button in the top of the toolbar and type terminal and run the terminal

Run this:
sudo apt-get install postfix

During the installation, you will see a dialogue box appear, asking you which kind of installation you would prefer. Select “Internet Site”.

For domain name, enter:
domainname.com
(where domainname.com is your domain name - though in truth this is irrelevant)

Once Postfix is installed there are a few steps that need to be taken before it is fully functional.

Once Postfix is installed, go ahead and open the main configuration file.
sudo nano /etc/postfix/main.cf

There are a few changes that should be made in this file.
myhostname = domainname.com

Change this value:
alias_maps = hash:/etc/postfix/virtual
to this value:
virtual_alias_maps = hash:/etc/postfix/virtual

For the value, my networks, add a space and then this value:
192.168.0.0/22

So it looks like this:
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 192.168.0.0/22

The rest of the lines are set by default. Save, exit, and reload the configuration file to put your changes into effect:

sudo /etc/init.d/postfix reload


Of note - this is an outbound only email server.  Separately, you need to make sure you can send out on port 25 (via your firewall and ISP) and that you're not violating any SPF records with this server (or you may need to adjust SPF records).  

Wednesday, June 24, 2009

why am I getting spam from myself, do I have a virus?

Sometimes, you may see spam where the sender's address is your own. 99.9% of the time, this email did not come from you - but a spammer forging (also known as spoofing) your address. Forging/spoofing is popular among spammers because it can be difficult for some spam filters to deal with.

Unfortunately, email is insecure and very exploitable. The standard for email was designed in the late 60s and early 70s, long before spam and other types of abuse existed or were even thought of. Today, we live with the repercussions of the insecurity and exploitability of the original designs of the email standard. We can't fix the holes/problems without redesigning the email standard and necessarily upgrading every email server on the internet at the same time. It's a monumental and impossible task to upgrade every server at the same time, so we live with the problems.

So what can we do about emails with forged/spoofed senders? The short answer is to upgrade spam filters with those that are capable discering between spoofed and non-spoofed emails. Typically, these filters rely on SPF - but we'll never resolve this problem until SPF becomes required or the standard is redesigned. I'm not holding my breath for that.