I don't have a working example because I do my dsync backups on the local 
machine with output to shared NFS storage that is accessible to both my primary 
and backup systems.  No ssh required or remote connection required. That is 
provided by NFS.  

This excerpt of my backup script runs dsync in a loop where 'USERS' is 
populated with email account names to be backed up. The backup target location 
is on separate storage. If you can't figure out the doveadm sync to another 
server you could NFS share a file system from your secondary system to your 
primary and do something similar. 

for user in ${USERS}; do
   dsync -u ${user} backup maildir:/home/${user}/backup/mailboxes
done


> -----Original Message-----
> From: Kent Borg <[email protected]>
> Sent: Thursday, January 23, 2025 5:22 PM
> To: [email protected]; [email protected]
> Subject: Re: newbie dsync problems
> 
> On 1/23/25 1:41 PM, [email protected] wrote:
> > In your working example you are connecting as root but in your dsync
> example your user is remoteprefix:root.  Try removing the "remoteprefix:"
> which is being treated as part of the user name.
> 
> 
> If I take off the "remoteprefix" it logs in, but it doesn't send the
> user to the other end, the wrapper script on mail.borg.org gets "VERSION
> dsync 3 5" as the parameter.
> 
> > root@la:/etc/dovecot# doveadm sync  -u kentborg -1 ssh -i
> > /root/.ssh/id_rsa_rc.borg.org.dsync [email protected]
> > Error: Extraneous arguments found: 3 5
> > doveadm(kentborg)<1052944><mEMeJ8i9kmcQERAAA8+vgQ>: Error:
> > read(remote) failed: EOF (version not received)
> > doveadm(kentborg)<1052944><mEMeJ8i9kmcQERAAA8+vgQ>: Error:
> Remote
> > command returned error 64: ssh -i /root/.ssh/id_rsa_rc.borg.org.dsync
> > [email protected] dsync-server
> > root@la:/etc/dovecot# doveadm sync  -u kentborg -1 ssh -i
> > /root/.ssh/id_rsa_rc.borg.org.dsync remoteprefix:[email protected]
> > remoteprefix:[email protected]'s password:
> 
> According to the man page, that should be the destination:
> 
> > ARGUMENTS
> >        destination
> >               This argument specifies the synchronized destination.
> > It can be
> >               one of:
> >
> >               location
> >                      Same as mail_location setting, e.g. maildir:~/Maildir
> >
> >               remote:login@host
> >                      Uses dsync_remote_cmd setting to connect to  the
> > remote
> >                      host (usually via ssh)
> >
> >               remoteprefix:login@host
> >                      This  is  the  same  as remote, except
> > "user@domain\n" is
> >                      sent before dsync protocol starts.   This allows
> > imple‐
> >                      menting  a  trusted  wrapper  script  that runs
> > doveadm
> >                      dsync-server by reading the username from the
> > first line.
> >
> >               tcp:host[:port]
> >                      Connects to remote doveadm server via TCP.   The
> > default
> >                      port is specified by doveadm_port setting.
> >
> >               tcps:host[:port]
> >                      This is the same as tcp, but with SSL.
> >
> >               command [arg1 [, arg2, ...]]
> >                      Runs  a  local command that connects its standard
> > input &
> >                      output to a dsync server.
> 
> 
> One of the examples on the man page is:
> 
> > doveadm sync -u [email protected] ssh -i id_dsa.dovecot \
> >               [email protected] doveadm dsync-server -u
> > [email protected]
> 
> Which I don't understand. What is "[email protected]"? What are the
> two parameters and the option after that?
> 
> 
> Their simpler example:
> 
> > doveadm sync -u [email protected] remote:server-
> replica.example.com
> Makes much more sense, but I can't find anything based on that example
> works.
> 
> Does "doveadm sync" maybe not work in version 2.3.19.1?
> 
> > root@la:/etc/dovecot# dovecot --version
> > 2.3.19.1 (9b53102964)
> 
> Thanks,
> 
> -kb, the Kent who would love to see some working "doveadm sync" examples.
> 


_______________________________________________
dovecot mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to