The Visitor Pattern in PHP

https://doeken.org/assets/img/visitor-pattern.jpg

The Visitor Pattern isn’t used often. This is because there are few situations in which it is applicable or even makes sense. However, it’s a nice pattern to know and to have in your tool belt when the time comes. Let’s look at how this pattern can be applied in a PHP environment.

🛑 The problem

Like a few other patterns, the Visitor Pattern tries to solve the problem of adding functionality to an entity without changing it (much…). In addition to this very generic problem, it provides a way of adding the functionality to multiple similar entities, which can’t be completely handled in the same way.

So let’s make the problem a bit more practical. Imagine you have two entities: Book and Document. And for both of these entities we want to know how many pages there are. Our Document has a public function getPageCount(): int which returns the number of pages, while the Book consists of an array of Chapter entities, which also have this function.

class Document

{

public function __construct(private int $page_count) {}

 

public function getPageCount(): int

{

return $this->page_count;

}

}

 

class Chapter extends Document

{

// Chapter specific code

}

 

class Book

{

public function getChapters(): array

{

return [

new Chapter(5),

new Chapter(7),

new Chapter(2),

];

}

}

To streamline the process of returning the page count for either of these entity types, we create a PageCountDumper. A (somewhat naive) implementation of this could look like this:

class PageCountDumper

{

public function handle($entity)

{

if ($entity instanceof Document) {

var_dump($entity->getPageCount());

} elseif ($entity instanceof Book) {

$count = 0;

 

foreach ($entity->getChapters() as $chapter) {

$count += $chapter->getPageCount();

}

 

var_dump($count);

} else {

throw new \InvalidArgumentException('PaperCalculator can not handle the provided type.');

}

}

}

And we can call it like this:

$document = new Document(20);

$book = new Book();

 

$dumper = new PageCountDumper();

 

$dumper->handle($document); // int(20)

$dumper->handle($book); // int(14)

This PageCountDumper has a handle() function that can handle both the Book and the Document entity, and will var_dump the proper page count for both. There are however a few things that stand out:

  • Because there is no shared interface or abstraction between Document and Book, the handle() function receives a mixed $entity and contains the logic for either situation. When adding on more entities, this type checking will pile on and can become quite cumbersome and unreadable.
  • We throw an exception when the entity type is unknown to avoid improper use.

We can do better!

👋 The Visitor Pattern Solution

So the Visitor Pattern provides a solution for this particular problem. It will remove the need for the instanceOf type checks, while keeping the reference to the entity type intact. And it will remove the need to explicitly throw an exception. Let’s see how the Visitor pattern tackles these issues.

Entity specific functions

First off, to remove the instanceOf checks, it requires a method for every possible entity type. For convention’s sake, we’ll call these methods: visitBook(Book $book) and visitDocument(Document $document). And because we are creating a Visitor let’s rename the calculator to: PageCountVisitor.

class PageCountVisitor

{

public function visitBook(Book $book)

{

$count = 0;

 

foreach ($book->getChapters() as $chapter) {

$count += $chapter->getPageCount();

}

 

var_dump($count);

}

 

public function visitDocument(Document $document)

{

var_dump($document->getPageCount());

}

}

By implementing separate methods, with type-hinted arguments, we’ve removed the need for the instanceOf checks. And because we can only call these methods with the appropriate type, there is no need to throw an exception. PHP would already do so when we provide an invalid argument.

If there is another entity in the future that needs its pages to be counted, let’s say a Report, we can add a pubilc function visitReport(Report $report) and implement that logic separately.

But, you might be thinking: This isn’t better. I still need to know what type my entity is in order to call the correct method!. And you would be correct. But hold on, this refactoring is only half of the visitor pattern.

Accepting a visitor

Remember when I said the entities the visitor works on should not be changed much? Yeah, well; there is one change that is needed on every entity to make the Visitor Pattern work. But only one, and this will make it accept any visitor, and therefore add any (future) functionality.

To avoid the instanceOf check, there is only one context in which we can be sure the entity is of a certain type: within the entity itself. Only when we are inside a (non-static) method of a class, we know for certain that $this is an instance of that type. That is why the Visitor Pattern uses a technique called Double Dispatch, in which the entity calls the correct function on the visitor, while providing itself as the argument.

To implement this double dispatch we need a generic method that receives the visitor, and relays the call to the correct method on the visitor. By convention this method is called: accept(). This method will receive the visitor as its argument. In order to accept other visitors in the future, we first extract a VisitorInterface.

interface VisitorInterface

{

public function visitBook(Book $book);

 

public function visitDocument(Document $document);

}

 

class PageCountVisitor implements VisitorInterface

{

// Make sure the visitor implements the interface

}

Then we create a VisitableInterface and apply it on Book and Document.

interface VisitableInterface

{

public function accept(VisitorInterface $visitor);

}

 

class Book implements VisitableInterface

{

// ...

public function accept(VisitorInterface $visitor)

{

$visitor->visitBook($this);

}

}

 

class Document implements VisitableInterface

{

// ...

public function accept(VisitorInterface $visitor)

{

$visitor->visitDocument($this);

}

}

Here you can see the double dispatch in action. The Book class calls the visitBook() method on the visitor and Document calls visitDocument(). Both are providing themselves as the parameter. Because of this minor change to the entity we can now apply all kinds of different visitors that provide a certain functionality for every entity.

To use the visitor on the entities we need to adjust our calling code like this:

$document = new Document(20);

$book = new Book();

 

$visitor = new PageCountVisitor();

 

$document->accept($visitor); // int(20)

$book->accept($visitor); // int(14)

With all the pieces now in place, we are free to create more visitors that implement the VisitorInterface and can perform a certain feature for both Book and Document. A WordCountVisitor for example.

Pros & cons

Like many other patterns, the Visitor Pattern isn’t the one pattern to rule them all. There are multiple solutions to different problems. The Visitor Pattern is just that; a possible solution to a specific problem. Let’s look at some reasons you might use it, and some reasons you might not.

✔️ Pros

  • You can add functionality to any entity by implementing the VisitableInterface once. This makes the entity more extendable.
  • By adding visitors the functionality you enforce separation of concern.
  • The entity is in control whether the visitor is accepted. You can omit the relay and cut the double dispatch.
  • The individual visitors are easier to test.

❌ Cons

  • The double dispatch can be confusing and make the code harder to understand.
  • The accept() and visit...() methods usually don’t return anything, so you need to keep records on the visitor itself.
  • All Visitors need every method on the VisitorInterface while it might not have an implementation for it.

Real world examples

Realistically, you aren’t likely to find this pattern much in the wild. However, it is a common practice in combination with Trees and Tree Traversal.

If you are unfamiliar with Trees & Tree Traversal, you can check out my previous blog on that.

When traversing a Tree, you are iterating over a continuous stream of Nodes. We can perform an action for every node in that Tree. This is called visiting… coincidence? These nodes are usually just an entity holding a value. Instead of adding a bunch of methods to these nodes; it’s actually a nice way of adding different features to these otherwise dumb entities.

Some tree implementations I’ve seen actually have A PreOderVisitor and a PostOrderVisistor. These will then return an array of nodes in that order. While that is a perfectly acceptable visitor, I believe a Visitor should not dictate the order in which it is applied to the tree. For some features it might not even matter what the traversal order is, while in some cases it might.

In my Trees & Tree Traversal post I gave the example of a document inside a tree structure. When traversing that tree in PreOrder you get a logical flow of the document; starting at the cover page. Some visitors we might want to build for that tree are:

  • RenderPdfVisitor which could render every node as a PDF file.
  • TableOfContentsVisitor which could create a table of contents with the correct page numbering.
  • CombinePdfVisitor which could combine every previously rendered PDF into a single PDF document.

And basically every example from that blog post can be build as a visitor.

Thanks for reading

Like I said, the Visitor Pattern isn’t very common, but it’s nice to have up your sleeve. Do you have any experience with this pattern? Please let me know in the comments. I’m curious to hear what you think of it.

I hope you enjoyed reading this article! If so, please leave a 👍 reaction or a 💬 comment and consider subscribing to my newsletter! I write posts on PHP almost every week. You can also follow me on 🐦 twitter for more content and the occasional tip.

Laravel News Links

The New Rock Island Armory TM22 Rimfire Comes Loaded with Features, AR Styling

https://cdn.athlonoutdoors.com/wp-content/uploads/sites/8/2021/06/Rock-Island-STK100.jpg

While AR-type rifle remains white hot in popularity, the venerable .22 LR remains America’s most useful, economical round. From small game to target practice, to competition and even defense, the timeless .22 LR does it all. Now the Rock Island Armory TM22 offers a brand new take on the rimfire sporter.

The Rock Island STK100 features an aluminum grip for better shooting.

RELATED STORY

Rock Island STK100: Striker-Fired, 9mm Pistol has an Aluminum Grip

Rock Island Armory TM22 Rifle Series

Rock Island bills the TM22 as a “new age rifle.” The company claims it comprises a new standard, bringing classical attributes demanded in a semi-auto rimfire.

The entire rifle utilizes 7075 aircraft-grade aluminum from end to end. Leaning on the AR aftermarket industry, the grip utilizes common AR-15 style. The TM22 comes with a commercial buffer tube adapter, top rail and forend that accepts a host of standard aftermarket accessories via M-LOK compatibility.

The TM22 also comes with ambidextrous controls. It comes setup for right-hand use, but controls convert to left-hand for greater utility. Available in two different versions–20-inch or 18-inch barrel–the rimfire ships with two, 10-round magazines. For those really wanting to sling lead, they can pick up aftermarket 15- and 25-round mags as well.

Finally, the TM22 incorporates a trigger exhibiting a 2-pound break. Few platforms provide as much utility or fun as a well-crafted .22 LR. Loaded with features and AR styling, the new TM22 deserves a look. For even more info, please visit armscor.com.

Rock Island TM22-A-18 Specs

  • Caliber: .22 LR
  • Capacity: 10 Rounds
  • Action: Semi-Auto, Recoil Operated
  • Overall Length: 34 inches
  • Height: 7.68 inches
  • Overall Width: 3 inches
  • Barrel: Rifled
  • Barrel Length: 18 inches
  • Length of Pull: 13 inches
  • Number of Grooves: 6
  • Stock: Fixed Aluminum
  • Grip: AR Type
  • Finish: Black Anodized

Rock Island TM22-A-20 Specs

  • Caliber: .22 LR
  • Capacity: 10 Rounds
  • Action: Semi-Auto, Recoil Operated
  • Overall Length: 36 inches
  • Height: 7.68 inches
  • Overall Width: 3 inches
  • Barrel: Rifled
  • Barrel Length: 20 inches
  • Length of Pull: 13 inches
  • Number of Grooves: 6
  • Stock: Fixed Aluminun
  • Grip: AR Type
  • Finish: Black Anodized

The post The New Rock Island Armory TM22 Rimfire Comes Loaded with Features, AR Styling appeared first on Tactical Life Gun Magazine: Gun News and Gun Reviews.

Tactical Life Gun Magazine: Gun News and Gun Reviews

The Final Ghostbusters: Afterlife Trailer Ain’t Afraid of No Spoilers

https://i.kinja-img.com/gawker-media/image/upload/c_fill,f_auto,fl_progressive,g_center,h_675,pg_1,q_80,w_1200/b51c94948a959bb1e7201b72f83226f2.jpg

Screenshot: Sony Pictures

io9’s seen Ghostbusters: Afterlife, and our own movie maven Germain Lussier called it “great until it’s derailed by gratuitous fan service” in his spoiler-free review. But if you’d like to know exactly what he was talking about, Sony Pictures has very helpfully released a final trailer for the film which makes it abundantly clear what the fan service is.

Seriously, the trailer deserves a spoiler bar merely on principle.

The most obvious reveal (glimpsed in an earlier trailer) is the two Terror Dogs from the first Ghostbusters movie. Fans of the original 1984 film will recognize them as the demons who possessed Dana Barrett (played by Sigourney Weaver) and Louis Tully (Rick Moranis) and transformed them into Zuul the Gatekeeper and Vinz Clortho the Keymaster, respectively, the two heralds of the ancient Sumerian god of destruction Gozer (Slavitza Jovan). You shouldn’t need the arrival of the original three surviving Ghostbusters there at the end (which Sony very annoyingly plays coy by not showing their faces, as if we somehow wouldn’t know who they are) to figure out what the film’s climax is going to be. But if you do, don’t worry because this trailer also spoils this at the 0:43 mark by revealing a rather familiar sleeve and hairdo emerging from the depths.

I’m honestly less upset at the spoilers than I am by discovering the movie is just going to replicate the end of the original Ghostbusters rather than do anything new—yet another film made for nostalgic 40-somethings. To be fair, many people have enjoyed Afterlife’s fixation on nostalgia over creativity, but I hope any kids who end up watching the movie end up being able to understand it, let alone enjoy it.

Speaking of nostalgia, Ghostbusters: Afterlife stars Bill Murray, Dan Aykroyd, Ernie Hudson, Annie Potts, and Sigourney Weaver, all reprising their roles from the first two films, and if Weaver turns into a Terror Dog again and then Rick Moranis shows up as Tully to become the other one I’ll plotz. The new stars include Mckenna Grace, Finn Wolfhard, Carrie Coon, Paul Rudd, and more. Afterlife premieres in theaters on November 19.

G/O Media may get a commission

All colors on sale today
Gizmodo describes these premium headphones as “annoyingly incredible.” This is the lowest we’ve seen the Apple AirPods Max yet.

Also, not as a complaint, but as a side note: Who would read the Book of Revelation with less gravitas than Dan Aykroyd? Please discuss.


Wondering where our RSS feed went? You can pick the new up one here. 

Gizmodo

Essential Gunsmithing Tools: Bare Minimum to Gun Specific

https://www.pewpewtactical.com/wp-content/uploads/2016/07/12.-Start-Roll-Pin-with-Hammer-1024×769.jpg

New to the world of guns?

Find out the most essential gunsmithing tools you’ll need to keep your firearms running in great shape or to make easy modifications.

Oldschool Tools
Oldschool Tools

We’ll go in order from the most basic kit (some of which you’ll probably already have) to some more specialized tools as you progress in your gunsmithing journey.

Table of Contents

Loading…

Bare Essential Gunsmithing Tools

The great thing is that modern firearms are designed to be stripped/cleaned with minimal tools. Some don’t even require anything but your hands and the gun itself.

Brass Hammer & Plastic Mallet

Sometimes you want a little more force but not with something that could mar any of your finishes…

Start Roll Pin with Hammer
Start Roll Pin with Hammer

A brass hammer gives you the heft needed but doesn’t mar the normally much harder steel of a firearm. This hammer has interchangeable heads of brass, plastic, rubber, and even copper.

Brass Hammer
Brass Hammer

And I also keep a standard Rubber Mallet for some more forceful jobs.

Punches

Trigger Hammer Pin with Punch
Trigger Hammer Pin with Punch

Punches let you drive pins that hold together many types of guns. Again, we go with brass punches so they do not mar up the gun. We use and love the Starrett Brass Punch Set since they have longer punches than normal gunsmithing sets.

Wheeler Hammer & Punch Set
Wheeler Hammer & Punch Set

Or you can go with the combination hammer and punch sets from Wheeler which should be more than enough for introductory gunsmithing.

Hex / Allen Key Wrench Set

Tekton Long Hex Key Wrench Set
Tekton Long Hex Key Wrench Set

A lot of firearm screws utilize hex or Allen key patterns. To make it harder, there are metric and U.S. standards that roughly correlate to the origin of your gun. This long arm wrench set makes it easy for both standards.

I’ve probably bought half a dozen sets to place everywhere since they are never around when I need them!

Screwdrivers

Stanley All-in-One
Stanley All-in-One

And of course screwdrivers, you’ll need a sturdy multi-purpose one as well as a precision kit.

Threadlocker

Blue Threadlocker
Blue Threadlocker

Screws in a gun go through an immense amount of stress due to recoil and some will actually start backing out. That’s where threadlocker or Loctite (brand) comes in.

There are a couple of varieties but the two most used are blue (medium) which is great for vibration issues (such as handguard screws) and can be easily removed.

And red (high strength) ($6) which is when you want to lock something for almost forever (such as scope rings) since it requires heat to remove.

More Specialized Gunsmithing Tools

Torque Wrench

If you’re doing anything with precision involved like putting on optics…you’ll want a torque wrench combined with threadlocker.

Wheeler FAT Wrench
Wheeler FAT Wrench

Torque wrenches make sure you’re in spec with the in-lb force and that all the screws have equal tension.

And the industry standard (and our go-to for years) is the Wheeler FAT Wrench.

50

at Amazon

Prices accurate at time of writing

Prices accurate at time of writing

It comes with useful bits that will do for most jobs…and it’s super easy to dial in the appropriate force.

Fix It Sticks

Looking for the top-of-the-line gunsmithing kit? Check out Fix It Sticks.

FixIt Sticks
Fix It Sticks

The Works is truly the works and even has its own super nice torque wrench. Pricey but the best shooters out there (and most of the Pew Pew Tactical team) has one in their range bag.

280

at Fix It Sticks

Prices accurate at time of writing

Prices accurate at time of writing

Want to learn more about the kit? Check out our complete Fix It Sticks Review and also our coupon PEWPEW10 that will save you 10%.

Also…don’t have a range bag yet…check out our Best Range Bags article.

Trigger Pull Gauge

Doing some trigger mods?

You’ll want to make sure you’re actually doing something instead of going by pure feel.

We have an in-depth guide to the Best Trigger Pull Gauges.

Trigger Pull Gauges

But the simplest one that will work for all but the most OCD is the Wheeler Trigger Pull Scale.

Wheeler Trigger Pull Scale (2)
Wheeler Trigger Pull Scale
20

at Amazon

Prices accurate at time of writing

Prices accurate at time of writing

Gun Specific Gunsmithing Tools

There are tons of gun-specific tools, but here are the main ones that you’ll likely use for your Glock and AR-15.

Glock Tool

Glock Tool
Glock Tool

This tool is actually really useful to get the pins in and out without marring the polymer frame, and also to disassemble magazines.

AR-15 Armorer’s Wrench

There’s a lot of versions of the AR-15 Armorer’s Wrench…so much so that we have our own dedicated article.

However our go-to is the Magpul Version.

Best Armorer’s Wrench
59

at Brownells

Prices accurate at time of writing

Prices accurate at time of writing

There are versions on Amazon but we haven’t had the greatest of luck with them breaking little bits when torquing important AR-15 parts.

AR-15 Upper Receiver Vise

If you’re adding a barrel (or taking one off)…you’ll need a special vise to make sure you don’t warp the upper receiver.

Aero on Receiver Vise
Aero on Receiver Vise

The current one we use is the Obsidian Arms.

40

at Brownells

Prices accurate at time of writing

Prices accurate at time of writing

Real Avid AR-15 Armorer’s Kit

If you want a one-and-done situation for your AR-15…check out the Real Avid Armorer’s Master Kit.

Real Avid AR-15 Armorer’s Master Kit
Real Avid AR-15 Armorer’s Master Kit

It’s ginormous and has everything you need. And we have a full review.

235

at Gun Mag Warehouse

Prices accurate at time of writing

Prices accurate at time of writing

Application Specific Gunsmithing Tools

There are too many to list here but they all depend on your specific application. If you want to fit 1911 parts, you’ll need some files and a polishing compound. But if you’re just looking to drift your AK sight, you’ll need a special tool.

Check out our DIY Gunsmithing Tutorials where we cover all the steps and necessary tools.

Looking for more gear we’ve tested to get you started? Start with these:

Tested Shooting Ear Protection Muffs
Tested Shooting Ear Protection Muffs

Conclusion

There you have! The tools we recommend when starting your firearm journey.

All of these should get you where you’re going, but know that certain tasks might require more specific tools. So, it’s always recommended to do a little research before you jump into a project.

(Lest you be like us and make 25 trips to Home Depot or Lowes…)

What tools do you use the most? Let us know in the comments below. Are you building an AR-15? Make sure to read up on the parts and tools you need to do the job at our AR-15 Parts & Tools List.

The post Essential Gunsmithing Tools: Bare Minimum to Gun Specific appeared first on Pew Pew Tactical.

Pew Pew Tactical

How to Set Up Your Own Secure Email Server

https://static1.makeuseofimages.com/wordpress/wp-content/uploads/2021/10/set-up-secure-email-server-featured.jpg

Major email service providers such as Google and Microsoft occasionally scan your emails to provide targeted ads and other services. You may be concerned by this as it does violate your privacy. One of the easiest ways to prevent this breach of your privacy is to set up your own secure email server.

Setting up your private email server is fairly easy and once the initial set up is complete, you can further customize it according to your preferences.

What Is a Private Email Secure Server?

Whenever you receive an email, it is first stored on an email server before being downloaded to your email client or browser. These email servers are usually managed by the same companies that provide you with email addresses, such as Google, Yahoo, and Microsoft.

While these services do provide you with a lot of convenience, they can easily scan confidential and regular emails to provide targeted ads and improve services such as Google Assistant. Additionally, government entities and law enforcement agencies can ask your email provider to reveal your inbox.

On the other hand, you have complete control over your emails when you use a private email server. This is because the server is located at your own house, on a computer you own.

The glaring advantage of having your own secure email server is privacy. Your emails are completely your own. You can also use one to send completely anonymous emails.

Your ISP and your employers are completely devoid of any access to your emails. This provides a peace of mind that no third-party email providers can match. A private email server allows you to set up filters that are simply not possible when using a regular email service.

However, all this does come at a cost. You are completely responsible for the security of your email server. While your emails can no longer be snooped upon by companies, the server can still be compromised by a determined hacker.

Email providers have dedicated teams that look for security flaws in their servers. However, in the case of a private email server, you are completely responsible for making sure that the server is secure.

How to Set Up Your Own Secure Email Server

Setting up your private email server shouldn’t be a problem at all, provided you follow the steps listed below accurately.

However, before getting started, ensure that you have all the things needed to set up the server. These include:

  • A separate computer with decent hard drive capacity. This will act as the email server and store all your emails.
  • A domain name for your private email server.
  • A good and stable internet connection.
  • An email server service to route your emails. Ideally, it should also have features such as a spam filter, and antivirus protection.

Download and Install an Email Server

The first thing you need to get started is an email server software. There are plenty of programs available. However, most of them are paid.

For this tutorial, let’s make use of an open-source and free email server called hMailServer. To download the application, simply go to hMailServer’s download page and click on the file under “Latest Release”.

Related: IMAP vs. POP3: What’s the Difference? Which One Should You Use?

After downloading the app, simply follow these steps to install it:

  1. Run the downloaded file.
  2. On the Setup welcome screen, click Next.
  3. On the next screen, click on the “I accept the agreement” radio button. Be sure to read through the license agreement first.
  4. On the next screen, choose where you want to install the hMailServer application. It’s better to install it in the C: drive itself.
  5. On the components selection screen, choose Full Installation from the drop-down menu and click Next.
  6. In the next window, choose the database you would like to use. Ideally, choose the first option, i.e. Use built-in database engine. Click on Next.
  7. Choose whether you want to create a start menu shortcut or not, then click Next.
  8. The following screen will prompt you to create a password for your email server. Type in a strong password and click on Next.
  9. Now, click on Install. Wait for the installation to complete.
  10. After the installation finishes, ensure the Run hMailServer Administrator checkbox is checked and click on Finish.

How to Set Up hMailServer

The actual set up process for your private email server is also fairly easy. The following steps should give you a clear idea on how to set up your email server, and some good practices while doing the same:

  1. Run hMailServer Administrator. The app should already be running if you followed step 10 in the section above.
  2. In the window that opens, click on Connect and when prompted, enter the password you entered during installation in step 8 above.
  3. On the welcome screen, under Getting started, click on Add domain.
  4. Under the General tab, type in a domain name under “Domain”. Ensure that the Enabled checkbox is ticked, and then click on Save.
  5. Now, using the navigation bar on the left, go to Domains and then click on the domain name you’ve just entered. Click on the Accounts directory.
  6. In the Accounts window, click on Add.
  7. In the next window, type a name under the Address text box. This will function as your email address.
  8. Enter a suitable password in the Password section. Click on Save.
  9. Now, using the navigation bar, go to Settings > Protocols.
  10. Check SMTP, then uncheck the POP3, and IMAP checkboxes. Remember to click on Save.
  11. Following this, click on Advanced, under the “Settings” heading itself. Under “Default domain”, type localhost, and then click on Save.
  12. Click on the + button to expand the Advanced settings tree.
  13. Navigate to TCP/IP ports and ensure that ports 25, 110, and 143 are enabled for SMTP, POP3, and IMAP respectively.
  14. Now, test your email server by navigating to Utilities > Diagnostics. Select the domain that you created earlier, and click on Start to begin the test.
  15. This will check whether you can successfully connect to the mail server you just created.

After following the aforementioned steps, your private email server is ready to run.

All you need to receive and send emails is a client such as Thunderbird or Outlook. Use the domain credentials you created earlier to log in.

Related: The 5 Best Free Email Clients for Your Desktop PC

Additionally, you can also enable and customize features such as antivirus and spam protection by running the hMailServer Administrator utility. Look for these features on the navigation bar.

Your Private Email Server Is Ready

As is evident, setting up your own email server is not that difficult. In fact, it should take you less than an hour to get it up and running, if you don’t run into any unexpected issues. However, in case you’re looking for more advanced features, it is advisable to hire an IT professional to set it up for you.

And if it isn’t possible for you to set up your own email server, using alternative, secure email services is the next best option.

The 5 Most Secure and Encrypted Email Providers

Fed up with government and third-party surveillance of your emails? Protect your messages with a secure encrypted email service.

Read Next

About The Author

Manuviraj Godara
(136 Articles Published)

Manuviraj is a Features Writer at MakeUseOf and has been writing about video games and technology for over two years. He is an avid gamer who also spends his free time burning through his favourite music albums and reading.

More
From Manuviraj Godara

Subscribe to our newsletter

Join our newsletter for tech tips, reviews, free ebooks, and exclusive deals!

Click here to subscribe

MUO – Feed

What about my mental health?

It’s a threat to my mental health to make me do this.

I believe that 2 + 2 = 4.

Two plus two always equals four.

I will not deny reality.

I will not be forced to subjugate myself to someone else’s fantastical whims.

To violate that, to force me to acquiesce to someone else’s delusion is a threat to my mental health and I will not do it.

There are four lights.