Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I'm a bit dumbfounded by how to configure the plesk mailserver. I've read it uses qmail, but running qmail in the console gives me a command not found. sendmail on the other hand does seem to react, but trying to use the commandline to send an email doesn't deliver my mail (although I get no exception either).

Anyway, what I'm trying to do is send mails from within PHP (with SMTP to localhost). What I do not want however (and what plesk tries to do apparently) is host the mailing for my domain. Instead, the real mailserver for my domain is on another server, but to still retain mails when that would go down, I'd like a local relaying smtp server.

Any idea how to get this done, or is this impossible with plesk's built in version?

share|improve this question

2 Answers 2

up vote 2 down vote accepted

If qmail script isn't found, then I would assume your Plesk installation is running Postfix.

As you don't want Plesk handle mail for your domains, the best would be to disable Mail service on your domains. On "Mail" tab, go to "Change settings" and disable "Activate Mail service on domain". Just be sure your real mail server has an appropriate MX record in domain's DNS zone (can use DNS template to change all domains together).

Configuring Plesk server as a redundant mail server for your main one is a different story. I didn't try it personally, but I think the proper steps would be to

  1. keep "Activate Mail service on domain" off, add Plesk as lower

  2. priority MX for your real mail server setup Plesk Postfix

  3. setup redirect to your real mail server

The last step I think cannot be done in Plesk, it is custom tuning.

share|improve this answer

I don’t know much about how Plesk sets up its mailserver, but here’s how to do it with a standard qmail installation:

First you need to locate where your qmail control files are. With stock qmail it’s either in /etc/qmail or /var/qmail/control.

Two files determine which domain names are treated as local: locals and virtualdomains. If you remove all the lines from those files, qmail will not attempt to deliver any mail locally.

rcpthosts is a list of domains for which the SMTP server will accept emails from any sender. It is normally equal to all the domains in locals plus all the domains in virtualdomains. You can remove all the entries from it.

Changes to locals and virtualdomains are effective once qmail-send restarts. See if Plesk will allow you to restart its mail server; or you can just kill qmail-send, there should be a mechanism for restarting it. Worst case, you can reboot the whole server.

Next you will need to allow SMTP relaying from localhost. Almost all qmail installations, and I would guess also Plesk’s, are already set up to do this. Try to see if Plesk itself allows you to configure it, or if it already works from within PHP. On a stock qmail this is in /etc/tcp.smtp after which you have to run the tcprules command, but I’m pretty sure Plesk does this part differently.

Changes to rcpthosts are effective immediately (technically, for all SMTP connections opened after you made the change).

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.