두 서버 간 메일 전송

두 서버 간 메일 전송

Ubuntu 14.04에서 실행되는 두 개의 서버가 있습니다. Postfix와 Dovcote가 둘 다에 설치되었습니다. 메일 서버가 두 곳 모두에서 제대로 실행되고 있습니다. Server 1에서 Server 2로 메일을 전송하고 싶습니다. 누구든지 절차를 제안 할 수 있습니까?

답변1

내가 Google 메일로 마이그레이션하는 데 사용한 스크립트인 "imapsync"가 포함된 스크립트를 사용하여 전송할 수 있습니다. 준비된 모든 메일 서버 imap과 함께 사용할 수 있습니다.

SERVER1=imap.source.com
SERVER2=imap.dest.com

#Uncomment to hide folder sizes
FAST="--nofoldersizes"

#Uncomment to do a dry run (no actual changes)
#DRY="--dry" 

#Uncomment to just sync folders (no messages)
#JUSTFOLDERS="--justfolders" 

#Uncomment to just connect (no syncs at all)
#JUSTCONNECT="--justconnect" 

#Set the path to your imapsync binary
imapsync=imapsync

#Users file
if [ -z "$1" ]
then
echo "No users text file given." 
exit
fi

if [ ! -f "$1" ]
then
echo "Given users text file \"$1\" does not exist" 
exit
fi

while IFS=';' read  u1 p1 u2 p2; do {

$imapsync --usecache --syncinternaldates --nosyncacls --tmpdir /var/tmp --host1 ${SERVER1} --user1 "$u1" --password1 "$p1" --host2 ${SERVER2} --port2 993 --user2 "$u2" --password2 "$p2" --ssl2 ${FAST} ${DRY} ${JUSTFOLDERS} ${JUSTCONNECT} --exclude "Sent|^Delet|Drafts|Spam|Calendar|Brouillons|^Calend|envoi|^Contacts|Flux|sirable|Flux RSS|^Historiqu|Infected|Journal|Junk|LinkedIn|Notes|Outbox|^Probl|supprim|Courrier ind&AOk-sirable" --regextrans2 "s,^&AMk-l&AOk-ments envoy&AOk-s$,[Gmail]/Messages envoy&AOk-s," --regextrans2 "s,^INBOX/,," --regextrans2 's{Sent Items$}{[Gmail]/Messages envoy&AOk-s}' --regextrans2 's{Sent Messages$}{[Gmail]/Messages envoy&AOk-s}' --regextrans2 's{&AMk-l&AOk-ments envoy&AOk-s$}{[Gmail]/Messages envoy&AOk-s}' --regextrans2 's{Éléments envoyés$}{[Gmail]/Messages envoy&AOk-s}'
}
done < $1

스크립트를 실행하기 위한 명령줄은 다음과 같습니다.

./script.sh sample.txt

여기서 샘플.txt는 두 서버 모두에 대한 각 사용자의 주소와 비밀번호가 포함된 파일입니다.

[email protected];password1;[email protected];password2

관련 정보