Some documents at work

Source: Internet
Author: User
Tags dovecot


Agent Server Installation Process:



1. Find a virtual machine 10.101.120.147 in the test environment.


Put the binfile of the D-Agent installation instructions on 147 and execute the binfile

Remove the previous service and modify the configuration file.



2. modify the configuration file

Stop Postfix and Dovecot first

Copy/var/Podo/Dovecot on 131 to the same path on 147

/Var/Podo/Postfix is also copied to pay attention to the internal permissions, you can use rsync (permission issues can be ignored)

/Var/Podo/script

Note: The files in the spool in the Postfix must be copied and deleted. The files contain queue information.

The configuration file in/etc/Postfix/should also be copied (something in it is too important)




3. Modify Environment Variables

Copy/etc/profile under 131 to 147 and use postqueue-P for testing


4. Start the service

/Etc/init. d/Postfix restart

/Etc/init. d/Dovecot restart


5. Use the gateway 10.101.120.84 to test the connection.

Whereis amavisd: Change the SMTP process IP address in the script file/usr/local/sbin/amavisd to 147 for testing.


Restart/etc/init. d/amavisd restart


6. test email sending and receiving

A must add route add 10.101.120.0 mask route 255.255.255.0 192.168.15.248 to the local CMD and add the route gateway 192.168.15.248.



B needs to add a route pointing on 147



Set the server in leadtone's mailbox

Receiving server: 10.101.120.147

Sending server: 10.101.120.84


Test sending and receiving



7. If the test is OK, perform the same test on 133, and do not need to direct the gateway to the proxy IP address.







Data Migration:


As the mailbox storage on the 161 server has used 98%, you need to solve this problem immediately. The first step is to clear the related files of the logged-out users. Second, migrate some users to 165 machines.



1. log out (unused Users)

Connect mysql-uroot-p-h 10.101.120.37-P 3307 Podo-e "select distinct domainid from mailbox where routeip = 174422177">/tmp/11.txt

(This is the domain ID of all users in podo161)


Then, CD/var/Podo/mailbox is added to each directory, and LS-L is used to retrieve the domain ID in mailbox by script:

#! /Bin/bash

While read mm

Do

CD $ mm

Ls-L | grep d | awk '{print $9 }'

CD ..

Done <M1

The result is placed in a file, sorted, de-duplicated, and then exported.


Then, match the data domain ID of Podo and the domain ID of mailbox with the matching of mailbox and Podo, and retrieve the domain ID that does not match is the file left by unused users.

(Excel must be used for matching) Use = Vlookup (the number of columns in all columns of the file to be matched in the first row, false)



The matching result must be deleted on 161.

Write a script:


While read mm

Do


While read de

Do

If [-d $ mm/$ de]; then

Echo $ mm/$ de

Fi

Done <del

Done <ml


Finally, test DF-H on 161 to view the mounting information.


Step 2: migrate data and change the IP address


1. suspend an account

Mysql-uroot-p-h 10.101.120.37-P 3307 Podo

Update domain set status = 2 where domainid = 1263; \ lock domain


2. Move the files in mailbox

Set SSH communication without a password first

Ssh-copy-ID (or put the public key in the lock file of the other party)

Nohup rsync-avzr 1018/1263-e SSH [email protected]:/var/Podo/mailbox /&

Rm-RF 1018/1263 Delete source file


3. Change the user's Landing IP address in the domain


Update mailbox set routeip = 174422181 where domainid = 1263;



4. Unlock an account

Update domain set status = 0 where domainid = 1263;


5. test: A. Check the location of the user's host.

B. Test the account's email sending and receiving



Some documents at work

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.