Showing posts with label parallel plesk panel. Show all posts
Showing posts with label parallel plesk panel. Show all posts

Saturday, September 26, 2015

Postfix mail log with Subject line - Parallel Plesk Panel

We need mail subject in our Logs when we manage several domains with lots of mail IDs for better mail troubleshooting,

For postfix, normally don't have setting for mail log with subject line. But we have do it with simple trick on postfix configuration. Just follow bellow steps, It wont affect any off your mail services, but your log storage will increase some amount.

1. Open your postfix config file with your favoret text editor, mine always vim
vim /etc/postfix/main.cf

2. Find bellow line and un comment it, if commented.
header_checks = regexp:/etc/postfix/header_checks

3. Open file /etc/postfix/header_checks with your editor
vim /etc/postfix/header_checks

4. Add bellow line and save,
/^Subject:/     INFO

5. Restart postfix
service postfix restart

Send mail from your webmail and verify log by following comment. 
tail -f /var/log/maillog | grep Subject

For Plesk,

tail -f /usr/local/psa/var/log/maillog | grep Subject

Note " | grep Subject" used to filter only subject line, you can remove it as per your needs

Monday, September 7, 2015

Import Plesk mails to WHM cPanel mails - vice versa

Before start to the solution, I'll explain my situation,

I've 2 servers with Parallels Plesk - 11.5.30 and WHM - 11.50. Plesk have Postfix mail server and WHM have exim mail server.

My task is to migrate a domain example.com from Plesk installed server to WHM installed server.

Now I've moved files to new server, But how can I move mails from Plesk to WHM. It's really hard thing to do, because both have different mail server.

After lot of reference, I can see that horde will help on this.

Okay, Let's see what is Horde, It is a webmail client, slimier to squirrelmail, roundcube mail etc. It is used to check our mails on server with web interface.

So how it help us to import mails that located in server with Plesk control panel to server with WHM control panel.

Trick

1. How to Enable Horde web-mail on plesk.

Login in to your Plesk control panel, click "Tools & Settings" on left menu, click "Updates and Upgrades" under Panel, new window will open, click Add/Remove Components, on list under "Plesk webmails support" select "Horde web-mail support", if not selected and click remove another one. It'll take few min to install.

2. In WHM control panel, we don't have to do much work because by default there is option to choose our web-mail client.

3. Login in to Horde Web-mail client on plesk server, Right click Inbox, click Export. It'll ask to download file, use default option and click ok.

4. MBOX file will be downloaded.

5. Login to web-mail on WHM server, as same Right click and choose Import. It'll ask for mbox file, choose downloaded file.

6. It'll take few some time based on your mails count and size.

That's it.

Advantages:
It's very quick method to import, no need any configuration changes.

Disadvantages:
It's too hard if we have large amount of mail boxes.

Tuesday, October 21, 2014

Create mail account and alias by command line with parallel plesk panel

Following command is used to create mail account by Linux command line for parallel plesk panel

/usr/local/psa/bin/mail --create name@domain.com -mailbox true -passwd Pa55w0rd -antivirus in


Following command is used to create mail account by Linux command line for parallel plesk panel

/usr/local/psa/bin/mail -u name@domain.com -aliases add:alias1,alias2,alias3,alias4,alias5,alias6


Note : Change bold place as your requirement


You can use this line multiple time for create more mail accounts / alias accounts, Need to work some more for get input from text file and create mails and alias. I'll try to update soon with script.

Disabling local mail for a domain on parallel plesk panel

When we migrate mail servers with parallel plesk panel, We can use plesk migration manager.

But some case, we migrate server manualy,

Last time I faced following issue,

Server 1 : Current server
Server 2 : New Server

We had around 50 domain / subscription in our server. We planned to switch Server 1 to Server 2 one by one.

By commands & scripts, we've created all domains and mail accounts to Server 2. But we didn't change all domain MX to server 2. That means first 20 domains run in Server 2 and another 30 domains in Server 1.

In this case we got issue for deliver emails from Server 1 to Server 2 and vise-versa.

In this case problem with resolving domain

Any mail server first try to check whether domain in local server or not. If it in local server, it'll deliver mail to mail box directly. In our case both server have all 50 domains and their mail box. So it trying to deliver mails with in server. So it not reach to real location of mail box.

Solution !!! It's not a good idea to remove domains and mail account which is not usable. I've tried with disabling mail box in plesk panel. No use of it. Because it'll just stop sending mail to mail box. But local domain resolvation  won't be stop.

So I've to stop mail service for that domain, following command helped to do that.

/usr/local/psa/bin/mail --off domain.com

If you want to enable domain again, use following command

/usr/local/psa/bin/mail --on domain.com



Force Qmail to process all mails in the queue

Some times qmail not deliver mails, due to connection issue, in that case we can force qmail to send mails forcefully with following command.

This will send alarm signal to mail send.


 kill -ALRM `ps ax | grep [q]mail-send | awk '{print $1}'`


Source : Plesk support