ImapCopy: Unterschied zwischen den Versionen

Aus Hostsharing Wiki
Zur Navigation springen Zur Suche springen
Keine Bearbeitungszusammenfassung
 
(8 dazwischenliegende Versionen von 2 Benutzern werden nicht angezeigt)
Zeile 3: Zeile 3:
ImapCopy ist auf den HS Hive schon installiert
ImapCopy ist auf den HS Hive schon installiert


=== Einrichtung allgemein ===
== Einrichtung allgemein ==


Anmelden per ssh als ein Benutzer in einem HS-Paket.
Anmelden per ssh als ein Benutzer in einem HS-Paket.
Zeile 12: Zeile 12:


  xyz00-imapcopy@h01:~$mkdir imapcopy
  xyz00-imapcopy@h01:~$mkdir imapcopy
xyz00-imapcopy@h01:~$cd imapcopy


Die Konfiguration wird in einer Datei ImapCopy.cfg gespeichert
Die Konfiguration wird in einer Datei ImapCopy.cfg gespeichert


  xyz00-imapcopy@h01:~$vi ImapCopy.cfg
  xyz00-imapcopy@h01:~/imapcopy$vi ImapCopy.cfg


Inhalt der Datei
=== Config Web.de -> HS Benutzer ===
 
Muster Inhalt der Datei ImapCopy.cfg


  #############################################################
  #############################################################
Zeile 23: Zeile 27:
  # all lines beginning with # are comments and will be ignored
  # all lines beginning with # are comments and will be ignored
  #############################################################
  #############################################################
 
  ##############
  ##############
  # Sourceserver
  # Sourceserver
Zeile 33: Zeile 37:
  # Destinationserver
  # Destinationserver
  ###################
  ###################
  DestServer chg02.hostsharing.net
  DestServer xyz00.hostsharing.net
#DestServer imap.web.de
  DestPort 143
  DestPort 143
   
   
  #########
  #########
  # Options
  # Options
Zeile 46: Zeile 48:
  #DebugSrc
  #DebugSrc
  #DebugDst
  #DebugDst
 
  #################
  #################
  # Folders to skip
  # Folders to skip
Zeile 55: Zeile 56:
  #skipfolder "INBOX.Sent Objects"
  #skipfolder "INBOX.Sent Objects"
   
   
  #################
  #################
  # Folders to copy
  # Folders to copy
Zeile 63: Zeile 63:
  #copyfolder INBOX.Net-Connection.dy
  #copyfolder INBOX.Net-Connection.dy
  #copyfolder INBOX.test
  #copyfolder INBOX.test
   
   
  #######################################################  
  #######################################################  
Zeile 71: Zeile 70:
  #######################################################
  #######################################################
  #DstRootFolder "Your old Mails"
  #DstRootFolder "Your old Mails"
   
   
  ###############################################################
  ###############################################################
Zeile 86: Zeile 84:
  #AllowFlags "\Seen\Answered\Flagged\Deleted\Draft Junk NonJunk $MDNSent $Forwared"
  #AllowFlags "\Seen\Answered\Flagged\Deleted\Draft Junk NonJunk $MDNSent $Forwared"
  DenyFlags "\Recent"
  DenyFlags "\Recent"
   
   
  ##############################################################
  ##############################################################
Zeile 98: Zeile 95:
  converttimezone "UTC" "+0000"
  converttimezone "UTC" "+0000"
  converttimezone "UT"  "+0000"
  converttimezone "UT"  "+0000"
 
  #############################
  #############################
  # List of users and passwords
  # List of users and passwords
Zeile 105: Zeile 102:
  Copy    "xyz@web.de"        "Euer-Passwort"      "xyz00-imap"          "Benuzter-Passwort"
  Copy    "xyz@web.de"        "Euer-Passwort"      "xyz00-imap"          "Benuzter-Passwort"


=== Config gmail.com -> HS Benutzer ===


=== Testen der Verbindung ===
Da ImapCopy nicht direkt SSL unterstützt benötigt z.b. gmail und ggf einige andere die weiter unten beschrieben Lösung mit einem stunnel.
 
== Testen einer Verbindung ==


Zum testen ob die Daten alle OK sind auf der shell einfach:
Zum testen ob die Daten alle OK sind auf der shell einfach:


  xyz00-imapcopy@h01:~$imapcopy -t
  xyz00-imapcopy@h01:~/imapcopy$imapcopy -t


eingeben.
eingeben.


=== Hilfe ===
== Daten austauschen ==
 
  xyz00-imapcopy@h01:~/imapcopy$imapcopy
 
 
== Hilfe ==
 
xyz00-imapcopy@h01:~/imapcopy$imapcopy -h
xyz00-imapcopy@h01:~/imapcopy$man imapcopy
 
 
== ssl via stunnel ==
 
Es wird eine Konfuguration Datei , hier stunnel-to-gmail.conf, benötigt.
 
xyz00-imapcopy@h01:~/imapcopy$vi stunnel-to-gmail.conf
 
Inhalt der Datei stunnel-to-gmail.conf:
 
foreground=yes
; Some performance tunings
socket = l:TCP_NODELAY=1
socket = r:TCP_NODELAY=1
; Some debugging stuff useful for troubleshooting
debug = 7
; Pfad for pid file
pid = /tmp/stunnel4-xyz00.pid
; Use it for client mode
client = yes
; Service-level configuration
[imap]
accept = 127.0.0.1:10143
connect = imap.gmail.com:993
retry = yes
 
[imap]
accept = 127.0.0.1:20143
connect = xyz00.hostsharing.net:993
retry = yes
 
=== Änderung in der ImapCopy.cfg ===
 
##############
# Sourceserver
##############
SourceServer 127.0.0.1
SourcePort 10143
 
###################
# Destinationserver
###################
DestServer 127.0.0.1
DestPort 20143
 
#############################
# List of users and passwords
#############################
#    SourceUser      SourcePassword  DestinationUser  DestinationPassword
Copy  "xyz@gmail.com"  "passwort"      "xyz00-imap"    "passwort"
 
=== stunnel aufbauen ===
 
Wir öffnen eine zweite shell.
 
xyz00-imapcopy@h01:~/imapcopy$stunnel4 stunnel-to-gmail.conf


xyz00-imapcopy@h01:~$imapcopy -h
=== Verbindung prüfen und herstellen ===
xyz00-imapcopy@h01:~$man imapcopy


Siehe -> Testen einer Verbindung
und  -> Daten austauschen




Zeile 126: Zeile 197:
[[Kategorie:Glossar]]
[[Kategorie:Glossar]]
[[Kategorie:Software]]
[[Kategorie:Software]]
[[Kategorie:E-Mail]]

Aktuelle Version vom 15. November 2019, 14:28 Uhr

Installation ImapCopy

ImapCopy ist auf den HS Hive schon installiert

Einrichtung allgemein

Anmelden per ssh als ein Benutzer in einem HS-Paket.

xyz00-imapcopy@h01:~$

Dort wird ein Arbeitsverzeichnis erstellt

xyz00-imapcopy@h01:~$mkdir imapcopy
xyz00-imapcopy@h01:~$cd imapcopy

Die Konfiguration wird in einer Datei ImapCopy.cfg gespeichert

xyz00-imapcopy@h01:~/imapcopy$vi ImapCopy.cfg

Config Web.de -> HS Benutzer

Muster Inhalt der Datei ImapCopy.cfg

#############################################################
# imapcopy config
# all lines beginning with # are comments and will be ignored
#############################################################

##############
# Sourceserver
##############
SourceServer imap.web.de
SourcePort 143

###################
# Destinationserver
###################
DestServer xyz00.hostsharing.net
DestPort 143

#########
# Options
#########
#
# DebugSrc and DebugDest will show all traffic between IMAPCopy and Server
#
#DebugSrc
#DebugDst
 
#################
# Folders to skip
#################
#skipfolder INBOX.Trash
#skipfolder INBOX.Sent
#skipfolder "INBOX.Sent Objects"

#################
# Folders to copy
#################
#copyfolder INBOX
#copyfolder "INBOX.My personal files"
#copyfolder INBOX.Net-Connection.dy
#copyfolder INBOX.test

####################################################### 
# Rootfolder
# Can be specified to copy the Folder-Structure under
# a separate folder instead of inbox
#######################################################
#DstRootFolder "Your old Mails"

###############################################################
# Specify Flags that are supported on the destination server
# (AllowFlags) or flags that should be filtered out (DenyFlags)
# If not specified, all Flags are copyied 1:1
# If AllowFlags is specified, all not specified Flags will be
# removed and  not copied to the destination
# If DenyFlags is specified, those flags will be removed and
# the remaining ones will be copied
# Both (AllowFlags and DenyFlags) could be specified but
# would (in most cases) make no sense
##############################################################
#AllowFlags "\Seen\Answered\Flagged\Deleted\Draft Junk NonJunk $MDNSent $Forwared"
DenyFlags "\Recent"

##############################################################
# Timezone conversion
# The imap rfc is not clear on what kind of time offsets
# can be used. +XXXX -XXXX will be supported on all servers
# You can add as many entries as needed in the form
# converttimezone SRC DST
# to convert zones that your target server rejects
##############################################################
converttimezone "UTC" "+0000"
converttimezone "UT"  "+0000"

#############################
# List of users and passwords
#############################
#       SourceUser           SourcePassword        DestinationUser        DestinationPassword
Copy    "xyz@web.de"         "Euer-Passwort"       "xyz00-imap"           "Benuzter-Passwort"

Config gmail.com -> HS Benutzer

Da ImapCopy nicht direkt SSL unterstützt benötigt z.b. gmail und ggf einige andere die weiter unten beschrieben Lösung mit einem stunnel.

Testen einer Verbindung

Zum testen ob die Daten alle OK sind auf der shell einfach:

xyz00-imapcopy@h01:~/imapcopy$imapcopy -t

eingeben.

Daten austauschen

 xyz00-imapcopy@h01:~/imapcopy$imapcopy


Hilfe

xyz00-imapcopy@h01:~/imapcopy$imapcopy -h
xyz00-imapcopy@h01:~/imapcopy$man imapcopy


ssl via stunnel

Es wird eine Konfuguration Datei , hier stunnel-to-gmail.conf, benötigt.

xyz00-imapcopy@h01:~/imapcopy$vi stunnel-to-gmail.conf

Inhalt der Datei stunnel-to-gmail.conf:

foreground=yes

; Some performance tunings
socket = l:TCP_NODELAY=1
socket = r:TCP_NODELAY=1

; Some debugging stuff useful for troubleshooting
debug = 7

; Pfad for pid file
pid = /tmp/stunnel4-xyz00.pid

; Use it for client mode
client = yes

; Service-level configuration

[imap]
accept = 127.0.0.1:10143
connect = imap.gmail.com:993
retry = yes
[imap]
accept = 127.0.0.1:20143
connect = xyz00.hostsharing.net:993
retry = yes

Änderung in der ImapCopy.cfg

##############
# Sourceserver
##############
SourceServer 127.0.0.1
SourcePort 10143
###################
# Destinationserver
###################
DestServer 127.0.0.1
DestPort 20143
#############################
# List of users and passwords
#############################
#     SourceUser       SourcePassword  DestinationUser  DestinationPassword
Copy  "xyz@gmail.com"  "passwort"      "xyz00-imap"     "passwort"

stunnel aufbauen

Wir öffnen eine zweite shell.

xyz00-imapcopy@h01:~/imapcopy$stunnel4 stunnel-to-gmail.conf

Verbindung prüfen und herstellen

Siehe -> Testen einer Verbindung und -> Daten austauschen