Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
 Post subject: How to secure email
PostPosted: Fri Mar 13, 2015 8:21 am 
Offline

Joined: Fri Mar 13, 2015 6:25 am
Posts: 1
Hi,
I recently faced a problem. My linode was sending emails because of some script or external access, which made sure my IP got blocked.

Now i am wondering how to have a secured mail server.
I am using WHM for now.
Please let me know what should be taken care of.
Thanks
Preetam


Top
   
 Post subject: Re: How to secure email
PostPosted: Fri Mar 13, 2015 12:20 pm 
Online
Senior Newbie

Joined: Tue Feb 07, 2012 10:03 pm
Posts: 6
Location: Salt Lake City
The first question to ask is: Do you really want to run a mail server on your Linode? A mail server on a server accessible from the internet is a desirable target for spammers. A lot of reputable mail servers won't trust virtual servers (a Linode) enough to accept mail from them. Do you have the knowledge, inclination, and time to keep the mail server running?

That said, the basic components of a mail server on a VPS like Linode would include:

* Mail server software, probably Postfix
* If accepting inbound mail:
* Spam/virus handler, probably including Amavis, Clamav, and Spamassassin
* Using blocklists such as spamhaus.org
* Manage email accounts, including virtual users as appropriate
* Access to mailboxes, probably including Dovecot and Roundcube
* Manage the risk of unauthorized access to private information
* If sending outbound mail:
* Configure your mail server, including DNS and authentication
* Authenticate to a trusted mail server to forward outbound mail for you
* Secure access to your server, including SMTP ports, Sendmail, and other applications using Sendmail
* Manage the risk of your server abusing access to trusted mail servers


Top
   
 Post subject: Re: How to secure email
PostPosted: Sat Mar 14, 2015 1:06 am 
Offline
Senior Member
User avatar

Joined: Sun Jan 18, 2009 2:41 pm
Posts: 830
Also, if you are running a web application that sends mail (with or without a full-fledged mailserver), take special care to make sure it can't be abused to send spam. How to do this depends on the application you are using.


Top
   
 Post subject: Re: How to secure email
PostPosted: Sat Mar 14, 2015 1:26 am 
Offline
Senior Member
User avatar

Joined: Sun Dec 27, 2009 11:12 pm
Posts: 1038
Location: Colorado, USA
prkumble wrote:
Now i am wondering how to have a secured mail server.

The best way to have a secure email server is let someone else run it. Keeping email secure and spam free is a full time headache, not worth the few bucks to pay someone else to do it correctly.

_________________
Either provide enough details for people to help, or sit back and listen to the crickets chirp.
Security thru obscurity is a myth - and really really annoying.


Top
   
 Post subject: Re: How to secure email
PostPosted: Sat Mar 14, 2015 4:32 am 
Offline
Senior Newbie

Joined: Sat Mar 14, 2015 12:13 am
Posts: 19
I don't allow my web applications to directly send e-mail, not through the php.

This may be more trouble than some want to do, but I set up two databases - one for the web application to use and a second that has the password hash and e-mail address.

The second database - the handler for it is only loaded by the few pages that need it - to avoid the possibility of a leaky web application with holes from leaking the e-mail addresses.

When a web application needs to send mail, it doesn't actually send the mail - it puts it in a database table with user id, subject, and message. It can't send it because the rest of the web application doesn't have access to the e-mail addresses.

Then a perl script on the server reads that mail cue database, and from the user id, looks up the e-mail address in the authentication database to actually send the mail.

Setting that up requires customizing your web applications because most just use a single database for everything, but it protects your users and keeps a buggy web app from being used as a spam relay.

Now as far as the mail system itself, I use postfix for the SMTP and dovecot for IMAP.

Test both to make sure only encrypted login is possible, and test your SMTP to make sure it is not an open relay. There are many sites out there that will test your mail server to make sure it is not an open relay, I use more than one just in case one isn't working properly. Searching google or bing will find them for you.

Make sure you keep up with updates. Especially for postfix but also for dovecot (if you need IMAP / POP3)

-=-

The reason I personally don't let someone else run my mail server, I'm paranoid - I don't want someone else scanning my mail. Google and others have done it in the past, their motives may have been pure but I don't like it.

When I run my own mail server, my mail is private. Also, I like to be able to add aliases on a whim - etc. which is something the services charge for but doesn't cost them anything, which I find offensive.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group