Technology Blog

Plesk

List All Email Accounts for a Domain

by admin on Apr.18, 2009, under Plesk

Yes you can do this via plesk! But sometimes I need to automate it for a script or API. The following will print out all mail names for domains on your plesk server:

mysql -u admin -p`cat /etc/psa/.psa.shadow` psa -e "SELECT mail.mail_name, domains.name from mail LEFT OUTER JOIN domains ON domains.id = mail.dom_id where name='DOMAIN NAME.EXT HERE';

Leave a Comment more...

Recover Email Password on Plesk

by admin on Apr.18, 2009, under Plesk

Once in a while I need to do some email debugging on client accounts. They believe for whatever reason they are not receiving messages or vice versa and I need to do some header checking. Or a client is adding an email account on a second or third computer and they want me to tell them their existing password rather than reset it. Well in plesk it’s rather easy to do so and all it requires is running the following from the command line:

mysql -u admin -p`cat /etc/psa/.psa.shadow` psa -e "SELECT accounts.id, mail.mail_name, accounts.password, domains.name FROM domains LEFT JOIN mail ON domains.id = mail.dom_id LEFT JOIN accounts ON mail.account_id = accounts.id where mail_name='ENTER MAIL NAME HERE' "

Leave a Comment more...

Port 25 Blocking Work Around for Your Customers

by admin on Apr.18, 2009, under Plesk

Ok, so nowadays most ISP’s block port 25, the port for sending email through the internet. This leaves most hosting providers telling their customers to use their ISP’s outgoing mail server. I.E. smtp.comcast.net. Well this sucks! Here’s why:

I carry a laptop around, and I take it everywhere. When I boot it up it connects to any number of wifi signals that are pre-saved. I could be on a Verizon connection, a comcast connection, or even optimum online. So am I suppose to reconfigure my outgoing mailserver several times a day based on the wifi signal of the office I mobilized into? Well many host would have you believe so!

My work around on Redhat based linux servers is to set up the official alternative email port to listen and forward traffic to port 25. I do this via iptables and the command is:

/sbin/iptables -t nat -A PREROUTING -p tcp --dport 587 -i eth0 -j REDIRECT --to-ports 25

This command assumes your main interface is eth0. You may need to adjust it accordingly. Instead of just running this command from the shell prompt I recommend you append it to the /etc/rc.local file. This way when your server is ever rebooted the command is automatically reissued when the server reboots. Otherwise you may be wondering why your email stopped working out of the blue!

Plesk offers an alternative option to this which involves editing the /etc/xinetd.d/smtp_psa but it did not work well for me and was not as simple and clean as this solution.

Leave a Comment more...

External Mail Server on Plesk

by admin on Apr.18, 2009, under Plesk

Ok, so you have a plesk server and your hosting a site for a client who wants to use thier own mail server.  So you go ahead and change the mx record to point to thier mail server and email the client back to let him know everything is completed.  A day later you realize that your client isn’t receiving emails from you.  In fact he’s not receiving emails from his friend Jim (also a client of yours hosted on the same physical server).  But he is receiving email from just about everyone else in the world.  What the heck is going on you ask yourself!

Well, normally when someone sends an email, the mx record is looked up and followed accordingly.  However, plesk uses qmail as it’s MTA (Mail Transit/transport Agent).  Since Jim and you are using the same server that host your clients site, qmail assumes it is handling the email for that domain as well.  It’s an easy fix though:

Just open in vi or pico or whatever your using these days the following two files and comment out the clients domain who is using an external mail server.

vi /var/qmail/control/virtualdomains
vi /var/qmail/control/rcpthosts

Then restart qmail so it reloads the new configuration.

/sbin/service/qmail restart

Leave a Comment more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...