Xmail and PHPXmail

Hi guys,

I'm trying to setup a email server on my router. really lost at the settings. Need your help. Thanks. My settings as below:

Step 1(DDNS),
I have a A record for my domain. for example:
xxx.ddnsking.com to my router ip
MX record as:

Step 2(Xmail):
MailRoot/server.tab as below:

"RootDomain" "xxx.ddnsking.com"
"SmtpServerDomain" "xxx.ddnsking.com"
"POP3Domain" "xxx.ddnsking.com"
"HeloDomain" "xxx.ddnsking.com"
"PostMaster" "administrator@xxx.ddnsking.com"
"ErrorsAdmin" "administrator@xxx.ddnsking.com"

MailRoot/ctrlaccounts.tab as below:
administrator 0401080c0b0c16111704110a17

Step 3(PHPXmail):
I tried below setting on PHPXmail

A1 xx.xx.xx.xx 25 administrator 0401080c0b0c16111704110a17 0
A2 xx.xx.xx.xx 25 administrator 0401080c0b0c16111704110a17 U
A3 25 administrator 0401080c0b0c16111704110a17 0
A4 25 administrator 0401080c0b0c16111704110a17 U
A5 25 administrator 0401080c0b0c16111704110a17 0
A6 25 administrator 0401080c0b0c16111704110a17 U

PHPXmail tells below:
Warning : fsockopen(): unable to connect to xx.xx.xx.xx:25 (Host is unreachable) in /overlay/xxx/phpxmail/class.xmail.php on line 96
Host is unreachable

Note: xx, xxx are some privacy info.

Not a good idea. It's too much work to handle security, reliability and redundancy issues for a proper mail server, let alone running it on a router.

There are some providers that offer free hosting for your domain's email.


yeah, I just want it works, then, will consider about security, reliability....

can you help me make it works....

1 Like

I don't know about those packages, and I think you are unlikely to find support here as xmail is no longer supported by OpenWrt.

If you can confirm that you can access your router via the DDNS URL, then that part is solved. The email side of things is probably asked to the PHPXmail project.

yeah, the first i'm not sure is the MX record setting. how should i set the MX record?


or anything?

I meant that DDNS, in general, is working. As in the URL is translated into the IP of your router.

The answer to that should be in your mail server documentation.

1 Like

These aren't OpenWRT related questions, and should really be asked elsewhere.

set MX til mail.xxx.xxx.xxx

Your PHPXmail should probably be configred to localhost or 192.168.x.x, if they run on the same device.
If it cannot connect on port 25, then the mail server isn't running, not set to listen on those IPs/subnets, or there's a FW issue.

XMail haven't been updated for 7 years, you really should look into another mail server software, like Postfix.

Also storing the emails in the virtual storage of the router will make you lose all mails if you reboot it. Storing it on the flash, will fill the flash space, and kill the flash drive, since it's not made for constant reads and writes.

thanks, the port 25 is on. just don't know how to open the 110 port. do you have any idea?

it wasn't before

110 is POP3, so you need to configure it too.

1 Like

now 25 and 110 are all up. but i can't login into the server with 6017 port and my setted account.

so you didn't set up 6017 .... ?

no, 6017 is the default xmail administrator port.

Then ut should work OoTB.

Does telnet localhost 6017 work?

1 Like

no, telnet 25 and 110 works.

there are several setting sections:
config pop3
config pop3s
config smtp
config smtps
config smail
config psync
config finger
config ctrl
config ctrls
config lmail

I only enabled smtp and pop3. what's the section for enabling 6017?

i login the system.

Thank you so much guys. :kissing_heart: :kissing_heart: :kissing_heart: :kissing_heart:

If your problem is solved, please consider marking this topic as [Solved]. See How to mark a topic as [Solved] for a short how-to.

1 Like

I guess there is only one step to be successful.

When i try to use Gmail to receive/send email on Xmail server.

it says:

Send mail through your SMTP server
Authentication failed. Please check your username/password.
Show error details

Check mail from other accounts
Server returned error: "Invalid auth or access denied"

I guess there must be some setting i missed for the Xmail server.

Can you help me fix it?

Who says what, and what exactly are you trying to do ?

Again, not an OpenWRT issue.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.