• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Not able to send emails from Plesk server

webnomad

New Pleskian
Hello I am using qmail on a Linux Managed V-Server running Debian and Plesk ( psa v8.6.0_build86080822.20 os_Debian 4.0).

When I try to send an email from a PHP-page using PHP mail()-function I get an ok from PHP that the mail has been sent but it never arrives. Also mails from the Plesk massmail function do not arrive.

php.ini :

[mail function]
; For Win32 only.
SMTP = localhost
smtp_port = 25

; For Win32 only.
sendmail_from = mail@internet-projects.com

; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
sendmail_path = /var/qmail/bin/sendmail

The qmail queue is empty and in the maillog (/usr/local/psa/var/log/maillog) I find this entry after trying to send a mail:

Oct 21 12:18:17 lv2529 qmail-queue-handlers[30012]: Handlers Filter before-queue for qmail started ...
Oct 21 12:18:17 lv2529 qmail-queue-handlers[30012]: from=anonymous@localhost.localdomain
Oct 21 12:18:17 lv2529 qmail-queue-handlers[30012]: hook_dir = '/var/qmail//handlers/before-queue'
Oct 21 12:18:17 lv2529 qmail-queue-handlers[30012]: starter: submitter[30015] exited normally
Oct 21 12:18:18 lv2529 qmail: 1224584298.006471 new msg 174396850
Oct 21 12:18:18 lv2529 qmail: 1224584298.006636 info msg 174396850: bytes 257 from <anonymous@localhost.localdomain> qp 30015 uid 33
Oct 21 12:18:18 lv2529 qmail: 1224584298.018193 end msg 174396850

I have contacted my webhost but have not received an answer, does anyone have clue what's wrong here

Thanx
 
Looks like your domain is misconfigured in Plesk. Check "Server" > "Server Preferences" for the hostname field.
 
The hosteman entry is localhost.localdomain

The IP of the server is 88.80.222.200, the DNS lv2529.domainxyz.de , is this what should go into the hostname field?

Thanx
 
Did you remove the -t and -i flags from the sendmail command? If so, that may the problem. Normally you don't need to modify the sendmail_path setting in php.ini. The default is 'sendmail_path = /usr/sbin/sendmail -t -i' and that works fine on our Plesk boxes, since /usr/sbin/sendmail is indirectly linked to /var/qmail/bin/sendmail via the alternatives system (/etc/alternatives/mta). We run on CentOS, so things may be different on Debian.

(And yeah, localhost.localdomain is not a really great hostname for an online server.)
 
I have changed the hostname to lv2529.domainxyz.de

PHP is still delivering the mail but in the maillog of qmail it says this:

Oct 22 16:33:03 lv2529 qmail: 1224685983.125693 new msg 193921818
Oct 22 16:33:03 lv2529 qmail: 1224685983.125872 info msg 193921818: bytes 1347 from <#@[]> qp 22327 uid 2522
Oct 22 16:33:03 lv2529 qmail: 1224685983.131673 starting delivery 23: msg 193921818 to remote postmaster@localhost.localdomain
Oct 22 16:33:03 lv2529 qmail: 1224685983.131879 status: local 0/10 remote 1/20
Oct 22 16:33:03 lv2529 qmail-remote-handlers[22328]: Handlers Filter before-remote for qmail started ...
Oct 22 16:33:03 lv2529 qmail-remote-handlers[22328]: from=#@[]
Oct 22 16:33:03 lv2529 qmail-remote-handlers[22328]: to=postmaster@localhost.localdomain
Oct 22 16:33:03 lv2529 qmail: 1224685983.147296 delivery 23: failure: Sorry,_I_couldn't_find_any_host_named_localhost.localdomain._(#5.1.2)/
Oct 22 16:33:03 lv2529 qmail: 1224685983.147557 status: local 0/10 remote 0/20
Oct 22 16:33:03 lv2529 qmail: 1224685983.147740 triple bounce: discarding bounce/193921818
Oct 22 16:33:03 lv2529 qmail: 1224685983.147870 end msg 193921818

Is there another place to change the hostname (i restarted teh qmial service)

BTW: thats the firewall settings:

SMTP (submission port) server Deny incoming from all
SMTP (mail sending) server Allow incoming from all
 
Where did you change the hostname? The easiest way is to change it through Plesk: Server > Server Preferences. This updates your hostname in all neede places (startup scripts, hosts file, qmail, etc.), I believe.
 
it looks like this now:

Operating system Linux 2.6.18-028stab053.17-ent
Plesk Control Panel version psa v8.6.0_build86080822.20 os_Debian 4.0
Hostname lv2529.domainxyz.de
 
The PHP script I am using to send a mail form the server goes like this:

<?php
$headers = "From: treadwell@pandan.com\n";
$to = "mail@internet-projects.com";
$subject = "Hi!";
$body = "Hi,\n\nHow are you?";
if (mail($to, $subject, $body, $headers)) {
echo("<p>Message successfully sent!</p>");
} else {
echo("<p>Message delivery failed...</p>");
}
?>

Yes good question indeed, where does the postmaster@localhost.localdomain come from

Some other people seem to have similar problems due to a wrong configuration of the etc/hosts file but this looks ok here

# Auto-generated hostname. Please do not remove this comment.
88.80.222.200 localhost.localdomain localhost

I still got the impression that the server is sending the mails to itself for some reason
 
Some other people seem to have similar problems due to a wrong configuration of the etc/hosts file but this looks ok here

# Auto-generated hostname. Please do not remove this comment.
88.80.222.200 localhost.localdomain localhost

That doesn't look completely ok to me: localhost should be 127.0.0.1. I'd expect something like this as your /etc/hosts:

----
127.0.0.1 localhost.localdomain localhost
88.80.222.200 lv2529.domainxyz.de lv2529
----
 
another day another try,

I have adjusted the

/etc/hosts to

127.0.0.1 localhost.localdomain localhost
88.80.222.200 lv2529.domainxyz.de lv2529

/var/qmail/control/ to:

lv2529.domainxyz.de


run the /usr/local/psa/admin/bin/mchk --without-spam Command

the maillog changed to this:

Oct 23 09:31:25 lv2529 qmail: 1224747085.700680 status: local 0/10 remote 0/20
Oct 23 09:31:25 lv2529 qmail-queue-handlers[24554]: Handlers Filter before-queue for qmail started ...
Oct 23 09:31:25 lv2529 qmail-queue-handlers[24554]: from=#@[]
Oct 23 09:31:25 lv2529 qmail-queue-handlers[24554]: to=postmaster@lv2529.domainxyz.de
Oct 23 09:31:25 lv2529 qmail-queue-handlers[24554]: hook_dir = '/var/qmail//handlers/before-queue'
Oct 23 09:31:25 lv2529 qmail-queue-handlers[24554]: recipient[3] = 'postmaster@lv2529.domainxyz.de'
Oct 23 09:31:25 lv2529 qmail-queue-handlers[24554]: handlers dir = '/var/qmail//handlers/before-queue/recipient/postmaster@lv2529.domainxyz.de'
Oct 23 09:31:25 lv2529 qmail-queue-handlers[24554]: starter: submitter[24555] exited normally
Oct 23 09:31:25 lv2529 qmail: 1224747085.708553 bounce msg 193794116 qp 24554
Oct 23 09:31:25 lv2529 qmail: 1224747085.708615 end msg 193794116
Oct 23 09:31:25 lv2529 qmail: 1224747085.709227 new msg 193794114
Oct 23 09:31:25 lv2529 qmail: 1224747085.709291 info msg 193794114: bytes 1383 from <#@[]> qp 24555 uid 2522
Oct 23 09:31:25 lv2529 qmail: 1224747085.713289 starting delivery 3: msg 193794114 to remote postmaster@lv2529.domainxyz.de
Oct 23 09:31:25 lv2529 qmail: 1224747085.713334 status: local 0/10 remote 1/20
Oct 23 09:31:25 lv2529 qmail-remote-handlers[24557]: Handlers Filter before-remote for qmail started ...
Oct 23 09:31:25 lv2529 qmail-remote-handlers[24557]: from=#@[]
Oct 23 09:31:25 lv2529 qmail-remote-handlers[24557]: to=postmaster@lv2529.domainxyz.de
Oct 23 09:31:25 lv2529 qmail: 1224747085.721084 delivery 3: failure: Sorry._Although_I'm_listed_as_a_best-preference_MX_or_A_for_that_host,/it_isn't_in_my_control/locals_file,_so_I_don't_treat_it_as_local._(#5.4.6)/


my mailserver is getting really talkative here..
 
Problem solved

It looks like I found the cause of my problem. After all the configuration changes I was able to send mails to domains that were not on my server, all emails sent to domains on my server did not arrive because they were listed in var/qmail/control/virtualhosts but my receiving mailserver is on a different machine. The entries in the virtualhosts file made qmail believe to deliver the mail of these domains locally. Which obviously did not work.

After emptying the file and restarting the Qmail service it works fine with the exception of some mailaccounts (internal and external) since the emailheader contains Return-Path: <anonymous@lv2529.domainxyz.de> which some spamfilters do not like.

Where does Qmail get the anonymous from? And how do I change it to say webmaster@lv2529.domainxyz.de?
 
WARNING: This may not work for you but...

To change the default "from" address try this:

in php.ini:

For Unix only. You may supply arguments as well (default: "sendmail -t -i").
sendmail_path = /var/qmail/bin/sendmail -t -i -f someaddress@domain.tld

Then restart httpd

At least I think that's the syntax.

Faris.
 
If mail is not hosted on the local machine you have to disable mail for that domain in Plesk or qmail will try (and fail) to deliver mail locally.
 
Back
Top