Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Plesk, SMTP and sending e-mail from same domain

Tags:

smtp

plesk

I have a server with Plesk installed. On that I've created a domain, my-domain.com, and added and e-mail account [email protected] with access to SMTP for sending e-mails.

With PHPMailer or Swift Mailer I am able to send via the SMTP account [email protected] whenever the from address is outside the my-domain.com, for example [email protected]. Whenever I'm using an e-mail address that ends on @my-domain.com it fails.

I've tried to look in the /usr/local/psa/var/log/maillog file, but it only stores the mails that doesn't fail.

Can someone help me figure out where the problems is?

like image 491
user809829 Avatar asked Jun 22 '11 07:06

user809829


2 Answers

You can try this:

Delete the related domain in the qmail file /var/qmail/control/virtualdomains Then reload/restart qmail. Now it should work. More technical background at http://forum.parallels.com/pda/index.php/t-93222.html

like image 136
Benjamin Avatar answered Sep 20 '22 19:09

Benjamin


Benjamin answer didn't work on my installation (Plesk 11.5), but I found another solution: just turn off the mail service itself. It might not be the solution for everyone but it was for me (my domain's mx records pointing to another server, with some scripts sending emails here and there).

You can turn off the mail service fairly easily using Plesk GUI.

Mail tab then Change Settings button

Then uncheck

Uncheck 'Activate mail on service on domain'

However, this won't turn it off for subdomains and secondary domains you might have. No problem, just log in with ssh and run this command:

/usr/local/psa/bin/domain -u mydomain.example.com -mail_service false

And if one day you decide you want to turn it back on just replace false by true.

like image 44
Remy Vanherweghem Avatar answered Sep 18 '22 19:09

Remy Vanherweghem