ImapCopy: Unterschied zwischen den Versionen

Aus Hostsharing Wiki
Zur Navigation springen Zur Suche springen
KKeine Bearbeitungszusammenfassung
 
(Eine dazwischenliegende Version desselben Benutzers wird nicht angezeigt)
Zeile 7: Zeile 7:
Anmelden per ssh als ein Benutzer in einem HS-Paket.
Anmelden per ssh als ein Benutzer in einem HS-Paket.


xyz00-imapcopy@h01:~$
<syntaxhighlight lang="bash">
xyz00-imapcopy@h01:~$
</syntaxhighlight>


Dort wird ein Arbeitsverzeichnis erstellt
Dort wird ein Arbeitsverzeichnis erstellt


xyz00-imapcopy@h01:~$mkdir imapcopy
<syntaxhighlight lang="bash">
 
xyz00-imapcopy@h01:~$ mkdir imapcopy
xyz00-imapcopy@h01:~$cd imapcopy
xyz00-imapcopy@h01:~$ cd imapcopy
</syntaxhighlight>


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


xyz00-imapcopy@h01:~/imapcopy$vi ImapCopy.cfg
<syntaxhighlight lang="bash">
xyz00-imapcopy@h01:~/imapcopy$ vi ImapCopy.cfg
</syntaxhighlight>


=== Config Web.de -> HS Benutzer ===
=== Config Web.de -> HS Benutzer ===
Zeile 23: Zeile 28:
Muster Inhalt der Datei ImapCopy.cfg
Muster Inhalt der Datei ImapCopy.cfg


#############################################################
<syntaxhighlight lang="bash" line>
# imapcopy config
#############################################################
# all lines beginning with # are comments and will be ignored
# imapcopy config
#############################################################
# all lines beginning with # are comments and will be ignored
#############################################################
##############
 
# Sourceserver
##############
##############
# Sourceserver
SourceServer imap.web.de
##############
SourcePort 143
SourceServer imap.web.de
SourcePort 143
###################
 
# Destinationserver
###################
###################
# Destinationserver
DestServer xyz00.hostsharing.net
###################
DestPort 143
DestServer xyz00.hostsharing.net
DestPort 143
#########
 
# Options
#########
#########
# Options
#
#########
# DebugSrc and DebugDest will show all traffic between IMAPCopy and Server
#
#
# DebugSrc and DebugDest will show all traffic between IMAPCopy and Server
#DebugSrc
#
#DebugDst
#DebugSrc
 
#DebugDst
#################
 
# Folders to skip
#################
#################
# Folders to skip
#skipfolder INBOX.Trash
#################
#skipfolder INBOX.Sent
#skipfolder INBOX.Trash
#skipfolder "INBOX.Sent Objects"
#skipfolder INBOX.Sent
#skipfolder "INBOX.Sent Objects"
#################
 
# Folders to copy
#################
#################
# Folders to copy
#copyfolder INBOX
#################
#copyfolder "INBOX.My personal files"
#copyfolder INBOX
#copyfolder INBOX.Net-Connection.dy
#copyfolder "INBOX.My personal files"
#copyfolder INBOX.test
#copyfolder INBOX.Net-Connection.dy
#copyfolder INBOX.test
#######################################################  
 
# Rootfolder
#######################################################  
# Can be specified to copy the Folder-Structure under
# Rootfolder
# a separate folder instead of inbox
# Can be specified to copy the Folder-Structure under
#######################################################
# a separate folder instead of inbox
#DstRootFolder "Your old Mails"
#######################################################
#DstRootFolder "Your old Mails"
###############################################################
 
# Specify Flags that are supported on the destination server
###############################################################
# (AllowFlags) or flags that should be filtered out (DenyFlags)
# Specify Flags that are supported on the destination server
# If not specified, all Flags are copyied 1:1
# (AllowFlags) or flags that should be filtered out (DenyFlags)
# If AllowFlags is specified, all not specified Flags will be
# If not specified, all Flags are copyied 1:1
# removed and  not copied to the destination
# If AllowFlags is specified, all not specified Flags will be
# If DenyFlags is specified, those flags will be removed and
# removed and  not copied to the destination
# the remaining ones will be copied
# If DenyFlags is specified, those flags will be removed and
# Both (AllowFlags and DenyFlags) could be specified but
# the remaining ones will be copied
# would (in most cases) make no sense
# 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"
#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
# Timezone conversion
# can be used. +XXXX -XXXX will be supported on all servers
# The imap rfc is not clear on what kind of time offsets
# You can add as many entries as needed in the form
# can be used. +XXXX -XXXX will be supported on all servers
# converttimezone SRC DST
# You can add as many entries as needed in the form
# to convert zones that your target server rejects
# converttimezone SRC DST
##############################################################
# to convert zones that your target server rejects
converttimezone "UTC" "+0000"
##############################################################
converttimezone "UT"  "+0000"
converttimezone "UTC" "+0000"
converttimezone "UT"  "+0000"
#############################
 
# List of users and passwords
#############################
#############################
# List of users and passwords
#      SourceUser          SourcePassword        DestinationUser        DestinationPassword
#############################
Copy    "xyz@web.de"        "Euer-Passwort"      "xyz00-imap"          "Benuzter-Passwort"
#      SourceUser          SourcePassword        DestinationUser        DestinationPassword
Copy    "xyz@web.de"        "Euer-Passwort"      "xyz00-imap"          "Benuzter-Passwort"
</syntaxhighlight>


=== Config gmail.com -> HS Benutzer ===
=== Config gmail.com -> HS Benutzer ===
Zeile 110: Zeile 117:
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$imapcopy -t
<syntaxhighlight lang="bash">
xyz00-imapcopy@h01:~/imapcopy$ imapcopy -t
</syntaxhighlight>


eingeben.
eingeben.
Zeile 116: Zeile 125:
== Daten austauschen ==
== Daten austauschen ==


  xyz00-imapcopy@h01:~/imapcopy$imapcopy
<syntaxhighlight lang="bash">
 
xyz00-imapcopy@h01:~/imapcopy$ imapcopy
</syntaxhighlight>


== Hilfe ==
== Hilfe ==


xyz00-imapcopy@h01:~/imapcopy$imapcopy -h
<syntaxhighlight lang="bash">
xyz00-imapcopy@h01:~/imapcopy$man imapcopy
xyz00-imapcopy@h01:~/imapcopy$ imapcopy -h
 
xyz00-imapcopy@h01:~/imapcopy$ man imapcopy
</syntaxhighlight>


== ssl via stunnel ==
== ssl via stunnel ==
Zeile 129: Zeile 140:
Es wird eine Konfuguration Datei , hier stunnel-to-gmail.conf, benötigt.
Es wird eine Konfuguration Datei , hier stunnel-to-gmail.conf, benötigt.


xyz00-imapcopy@h01:~/imapcopy$vi stunnel-to-gmail.conf
<syntaxhighlight lang="bash">
xyz00-imapcopy@h01:~/imapcopy$ vi stunnel-to-gmail.conf
</syntaxhighlight>


Inhalt der Datei stunnel-to-gmail.conf:
Inhalt der Datei stunnel-to-gmail.conf:


foreground=yes
<syntaxhighlight lang="ini" line>
foreground=yes
; Some performance tunings
 
socket = l:TCP_NODELAY=1
; Some performance tunings
socket = r:TCP_NODELAY=1
socket = l:TCP_NODELAY=1
socket = r:TCP_NODELAY=1
; Some debugging stuff useful for troubleshooting
 
debug = 7
; Some debugging stuff useful for troubleshooting
debug = 7
; Pfad for pid file
 
pid = /tmp/stunnel4-xyz00.pid
; Pfad for pid file
pid = /tmp/stunnel4-xyz00.pid
; Use it for client mode
 
client = yes
; Use it for client mode
client = yes
; Service-level configuration
 
; Service-level configuration
[imap]
 
accept = 127.0.0.1:10143
[imap]
connect = imap.gmail.com:993
accept = 127.0.0.1:10143
retry = yes
connect = imap.gmail.com:993
retry = yes


[imap]
[imap]
accept = 127.0.0.1:20143
accept = 127.0.0.1:20143
connect = xyz00.hostsharing.net:993
connect = xyz00.hostsharing.net:993
retry = yes
retry = yes
</syntaxhighlight>


=== Änderung in der ImapCopy.cfg ===
=== Änderung in der ImapCopy.cfg ===


##############
<syntaxhighlight lang="ini" line>
# Sourceserver
##############
##############
# Sourceserver
SourceServer 127.0.0.1
##############
SourcePort 10143
SourceServer 127.0.0.1
SourcePort 10143


###################
###################
# Destinationserver
# Destinationserver
###################
###################
DestServer 127.0.0.1
DestServer 127.0.0.1
DestPort 20143
DestPort 20143


#############################
#############################
# List of users and passwords
# List of users and passwords
#############################
#############################
#    SourceUser      SourcePassword  DestinationUser  DestinationPassword
#    SourceUser      SourcePassword  DestinationUser  DestinationPassword
Copy  "xyz@gmail.com"  "passwort"      "xyz00-imap"    "passwort"
Copy  "xyz@gmail.com"  "passwort"      "xyz00-imap"    "passwort"
</syntaxhighlight>


=== stunnel aufbauen ===
=== stunnel aufbauen ===
Zeile 184: Zeile 201:
Wir öffnen eine zweite shell.
Wir öffnen eine zweite shell.


xyz00-imapcopy@h01:~/imapcopy$stunnel4 stunnel-to-gmail.conf
<syntaxhighlight lang="bash" line>
xyz00-imapcopy@h01:~/imapcopy$ stunnel4 stunnel-to-gmail.conf
</syntaxhighlight>


=== Verbindung prüfen und herstellen ===
=== Verbindung prüfen und herstellen ===

Aktuelle Version vom 13. Juni 2024, 12:44 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