PostFix Local Loop in PLESK

April 12, 2012

THIS ARTICLE IS A SOLUTION FOR PLESK 10.4 AND EARLIER.
TO VIEW THE MOST UPDATED ARTICLE, VISIT HERE

The problem

A while back, I was having an issue with my mail not being delivered. I would write a function using

and it would successfully send an email to every address EXCEPT one particular address. I couldn’t tell why. This is something that occurs on Parellels’ PLESK server administration software.

The solution

I’ll get to it awfully quick, then I’ll tell you how I figured it out.

First, you need to ask yourself, is this email address the same domain being hosted on PLESK? Bingo. The problem was that when PostFix (the SMTP sendmail uses by default in most cases) determined the address to be the same as the domain it was hosting, it did a local search to find that address rather than just sending the email.

Naturally, if you didn’t have that particular email address set up, or any email with that extension set up on the server, it found nothing, and wouldn’t send the email. There is a very easy fix to this issue by commenting out 3 lines in your Postfix ‘main.cf’ configuration file. This was originally documented by Luke Tarplin, and I can’t explain how helpful it was.

Find your ‘main.cf’ configuration file for PostFix, which for CentOS 6, is located at

If you can’t find it, do a

SSH command to at least see where Postfix is on your server.

Then, open the file up through a text editor, or in the Linux shell, and make these lines (should be at the end of the file, around line 677) :

commented out like this :

Then, restart the Postfix service, and Apache while your at it (can’t hurt), and voila! Your email address should be receiving those emails now. This also doesn’t affect any of your regular emails or anything else, either.

Now, I figured out how to look for this by checking over my mail logs. Any time you have an error with sending an email, check your mail logs. For CentOS, they are located:

although for most Linux OS, they are located

On mine, I noticed that the output for that particular email kept saying

On line 2, you can see that Postfix begins a

search. That was a dead giveaway that for some reason PostFix was reverting to a local search. I put 2 and 2 together and starting searching for the appropriate solution.

If, for some reason, you happen to have similar circumstances but this isn’t the right solution, just remember : Always check your mail logs. It has everything you could ever need to know in fixing a problem. Good luck and happy coding!

Headers Already Sent Error in WordPress Plugin Activiation

February 14, 2012

Before I could even start writing plugins for WP, I was experiencing errors. This was the biggest message I got upon activation :

The plugin generated # characters of unexpected output during activation. If you notice “headers already sent” messages, problems with syndication feeds or other issues, try deactivating or removing this plugin.

At the top of the page, it was even worse. You could see errors accumulating before the page was even finished loading –

Warning: Cannot modify header information – headers already sent by (output started at /homepages/37/d354510180/htdocs/BLAH/BLAH/BLAHplugin.php:1) in /homepages/37/d354510180/htdocs/BLAH/BLAH/BLAH/wp-includes/functions.php on line 862

After some Googling, people claimed it was the whitespace at the beginning or end of my PHP file. I cleared all that up, still had a problem. I started messing around with encoding instead.

UTF-8 WITH BOM, and UTF-8 WITHOUT BOM both caused errors upon activation. Finally, I switched to ANSI in “Notepad++” and that resolved it. No issues from there on out.

There are also other methods of adjustment, including your uploading process. I used Filezilla and this can be found under Transfer > Transfer Type.

SOMETHING is putting extra white space in your plugin PHP file… you just need to find out what. Hope this helps.

Submit a Site to International Search Engines

January 24, 2012

I’ve decided to create this list because it’s been hard to find clear directions in English on how to submit international sites to international search engines. Google’s international versions usually dominate all search engines, but it’s always nice to know some others. This list should be ever growing, and I’ll try to update it as much as possible. Hopefully this will help some.

Czech Republic

seznam.cz – One of the larger search engines in Czech Republic. Their submission site – http://search.seznam.cz/pridej-stranku

Slovak Republic

zoznam.sk – One of Slovak Republic’s larger search engines. Submit – http://www.zoznam.sk/pridaj/

Poland

Poland.com – A polish homepage. They ONLY accept .pl extensions. Submit – ?
Onet.pl – Another Yahoo-like Polish search engine. Submit – http://katalog.onet.pl/dodajstrone/dodaj_adres_katalog.html

Launch of Anter.com

January 12, 2012

This week debuted the website for Anter Corporation (anter.com). With the help of some graphic designers, this site was put together as a great representation for the company. Anter Corporation was recently acquired by TA Instruments and they needed a new website to represent the change.

Anter manufactures instruments to measure flash diffusivity, thermal conductivity, and dilatometry. The best showcase of their instruments can be found on their flash diffusivity instruments page, which features a JQuery menu that transitions different modules, their configurations, and additional requirements if necessary. I developed this as a nice way to display a lot of information on one page but still give the user options for configuring their own instruments. It features some fadeIn()/fadeOut() JQuery transitions.

The site is hosted on a 1&1 dedicated server with about 8GB of ram and can handle up to 10k people a month.

Check it out! – http://www.anter.com