ImapCopy: Unterschied zwischen den Versionen

Aus Hostsharing Wiki
Zur Navigation springen Zur Suche springen
K (dir imapcopy bei Befehlen zugefügt)
 
(Eine dazwischenliegende Version von einem anderen Benutzer wird nicht angezeigt)
Zeile 126: Zeile 126:


== ssl via stunnel ==
== ssl via stunnel ==
=== certificate erstellt ===
Wir erstellen ein Zertificat mit der Datei stunnel.pem
Der Inhalt bei den einzelne folgenden Abfragen ist nicht entscheidet. Es muss die Datei und die Felder geben.
xyz00-imapcopy@h01:~/imapcopy$openssl req -new -x509 -days 3650 -nodes -out stunnel.pem -keyout stunnel.pem
=== Config für stunnel erstellen ===


Es wird eine Konfuguration Datei , hier stunnel-to-gmail.conf, benötigt.
Es wird eine Konfuguration Datei , hier stunnel-to-gmail.conf, benötigt.
Zeile 144: Zeile 133:
Inhalt der Datei stunnel-to-gmail.conf:
Inhalt der Datei stunnel-to-gmail.conf:


cert = stunnel.pem
  foreground=yes
  foreground=yes
   
   
Zeile 163: Zeile 151:
   
   
  [imap]
  [imap]
  accept = 1143
  accept = 127.0.0.1:10143
  connect = imap.gmail.com:993
  connect = imap.gmail.com:993
retry = yes
[imap]
accept = 127.0.0.1:20143
connect = xyz00.hostsharing.net:993
  retry = yes
  retry = yes


Zeile 172: Zeile 165:
  # Sourceserver
  # Sourceserver
  ##############
  ##############
  SourceServer localhost
  SourceServer 127.0.0.1
  SourcePort 1143
  SourcePort 10143
   
 
###################
# Destinationserver
###################
  DestServer 127.0.0.1
DestPort 20143
 
  #############################
  #############################
  # List of users and passwords
  # List of users and passwords
Zeile 198: 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