Solved

Postfix Admin 2.3.6 says "Invalid domain name xxx.marketing, fails regexp check"

Posted on 2014-09-23
3
1,065 Views
Last Modified: 2014-09-23
When you try to add new domains to Postfix Admin with new domain name extensions such as .marketing,.expert, etc. different than well-known std extensions., it complains about these extensions and does not alow to add the domain. It says "Invalid domain name xxx.marketing, fails regexp check". Does anyone know how to disable or improve this regexp check?
0
Comment
Question by:sbayrak
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 110

Accepted Solution

by:
Ray Paseur earned 500 total points
ID: 40339106
Version 2.3 was released October 26th 2009 which makes it so old that it's probably obsolete today.  The latest release appears to be 2.91 and it can be downloaded here:
http://sourceforge.net/projects/postfixadmin/files/

My first step would be to upgrade to the latest release, then see if the problem persists. If it is still stuck, then you can use a code scanner to look for the message text and thereby find the origin point of the regexp check.  Once you find that you will be able to change the code to include the new top-level domains.  The current IANA TLD list is curated here:
http://data.iana.org/TLD/tlds-alpha-by-domain.txt

This article shows a general conceptual design of test-driven development, including near the end a script where I have used the IANA TLD list in a regular expression to validate URLs.
http://www.experts-exchange.com/Programming/Languages/Scripting/PHP/A_7830-A-Quick-Tour-of-Test-Driven-Development.html
0
 
LVL 1

Author Comment

by:sbayrak
ID: 40339279
Found the relevant code line inside functions.inc.php and changed the char length 6 to 12 to make it work.

if (!preg_match ('/^([-0-9A-Z]+\.)+' . '([0-9A-Z]){2,6}$/i', ($domain)))

Thanks
0
 
LVL 110

Expert Comment

by:Ray Paseur
ID: 40339361
Great, thanks for the points and thanks for using E-E, ~Ray
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
The new Gmail Phishing Scam going around is surprising even the savviest of users with its sophisticated techniques.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question