Convert a unix user into a yunohost user


I’ve just converted an old manually managed server to Yunohost. I’m now looking for a way to import my existing users. I already have 4 users with emails. I would appreciated a simple solution.

Big thanks in advance.

I do not understand why my post was retitled: I do not want to transfer emails from one server to another, I only have a single server already converted.

Transfering emails from one to another is certainly a good solution in some circumstances, but here I mostly looking for a magical command like yunohost user import johndoe. And if not existing, how can I do it by myself?

Other idea: yunohost user create --uid --gid --existing...

I think this could work:

userdel user1
yunohost create user1
# Next you might apply permissions and owner on files own by the user1

Note: convert an existing debian with a lot of stuff into a yunohost could be less stable than install yunohost from iso or from a fresh debian.

Sorry, completely misunderstood the question !
Title was confusing :woozy_face:

Yes, I did this. And then, I finally understand why the initial answers were focused on mail conversion: it was not trivial to restore my emails.

I followed official documentation without any success using dsync, so I used successfully.

Yes, I have this feeling too.

I’m now fighting with fetchmail: for an unknown reason, fetchmail successfully transfers to postfix which in turn fires procmail. But the later complains about /var/mail/user format and moved the whole directory. I have to understand why mail delivery does not work locally: why procmail is not configured to use MailDir format or why postfix use procmail here instead of using dovecot as LDA?