• Re: Tool to store on IMAP server

    From Nicolas George@21:1/5 to All on Mon Jul 29 16:10:02 2024
    mick.crane (12024-07-29):
    I am looking for a tool that reads a mail from its input and stores it
    into an IMAP mailbox:
    With a new Dovecot install

    Thanks, but this is not at all what I am asking. Dovecot is the server,
    I am asking for a client.

    --
    Nicolas George

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Nicolas George@21:1/5 to All on Mon Jul 29 15:40:01 2024
    Hi.

    I am looking for a tool that reads a mail from its input and stores it
    into an IMAP mailbox:

    cat mail_file | imapupload imaps://george@server/Mail/incoming

    The goal would be to provide our users an alternative to forwarding
    their mail to another mail provider that we will have to forbid lest the
    other mail providers accuse us of spamming.

    I got curl to work (I did not know that curl could do IMAP):

    curl --user george --url imaps://server/Mail/testcurl --upload-file /tmp/mail

    Unfortunately, curl hardcodes that mail uploaded that way are seen:

    /* Send the APPEND command */
    result = imap_sendf(data,
    "APPEND %s (\\Seen) {%" CURL_FORMAT_CURL_OFF_T "}",
    mailbox, data->state.infilesize);

    … and I need them to be new.

    Alternatively, I have considered using GNU mailutils:

    movemail /tmp/mail imaps://george@server/Mail/testcurl

    This time, the issue is it insists on finding the password in
    ~/.mu-tickets without an option to use another file or preferably a
    pipe.

    Does anybody here have an idea to make all this better?

    Thanks in advance,

    --
    Nicolas George

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Greg Wooledge@21:1/5 to Nicolas George on Mon Jul 29 16:20:01 2024
    On Mon, Jul 29, 2024 at 16:09:16 +0200, Nicolas George wrote:
    mick.crane (12024-07-29):
    I am looking for a tool that reads a mail from its input and stores it into an IMAP mailbox:
    With a new Dovecot install

    Thanks, but this is not at all what I am asking. Dovecot is the server,
    I am asking for a client.

    https://superuser.com/questions/191719/transferring-lots-of-messages-between-imap-accounts

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Nicolas George@21:1/5 to All on Mon Jul 29 16:30:01 2024
    Greg Wooledge (12024-07-29):
    https://superuser.com/questions/191719/transferring-lots-of-messages-between-imap-accounts

    Closer, but no:

    I want: transfer ONE message to an IMAP account.

    This: transfer LOTS OF messages to an IMAP account.

    imapsync (actually mbsync) is really good for what it is good at but
    much too heavy for the task at hand, it sets up an infrastructure to
    check which mail has already been uploaded.

    And mutt's behavior is too unpredictable to be used in a non-interactive
    way.

    Regards,

    --
    Nicolas George

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Nicolas George@21:1/5 to All on Mon Jul 29 16:40:01 2024
    Greg Wooledge (12024-07-29):
    You did not say you wanted to do this NON-INTERACTIVELY.

    Yes, I did, in the very first message:

    “The goal would be to provide our users an alternative to forwarding
    their mail to another mail provider”

    Why do you want to do it non-interactively? It's ONE MESSAGE, ONE TIME!

    It is ONE message, thousands of time per hour.

    Can anyone guess what my next response is going to be? I have a guess.
    It will involve the letters X and Y.

    Oh, I know where you are going, but apparently you did not read the
    first question carefully enough. I expected that from other people on
    the list but not you.

    Regards,

    --
    Nicolas George

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Greg Wooledge@21:1/5 to Nicolas George on Mon Jul 29 16:40:02 2024
    On Mon, Jul 29, 2024 at 16:23:14 +0200, Nicolas George wrote:
    I want: transfer ONE message to an IMAP account.

    Then use the mutt solution.

    And mutt's behavior is too unpredictable to be used in a non-interactive
    way.

    You did not say you wanted to do this NON-INTERACTIVELY.

    Why do you want to do it non-interactively? It's ONE MESSAGE, ONE TIME!

    Just do it interactively, and you're done. Problem solved.

    ...

    Can anyone guess what my next response is going to be? I have a guess.
    It will involve the letters X and Y.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Darac Marjal@21:1/5 to All on Mon Jul 29 19:40:02 2024
    This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------7GXh7pkD501AaOclghzv5z14
    Content-Type: text/plain; charset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B0aGUg bWVzc2FnZSBmcm9tIHN0ZGluIGFuZCB0aGVuIHBhc3NlcyBpdCB0byB0aGUgaW1hcGZpbHRl ciANCmZ1bmN0aW9ucyBmb3Igc3RvcmFnZS4NCg0KQWx0ZXJuYXRpdmVseSwgbW9zdCBwcm9n cmFtbWluZyBsYW5ndWFnZXMgb2ZmZXIgc29tZSBmb3JtIG9mIGhpZ2gtbGV2ZWwgDQppbWFw IGxpYnJhcnkuIERlcGVuZGluZyBvbiB5b3VyIHByZWRpbGVjdGlvbiwgeW91IGNvdWxkIHdy aXRlIGEgDQpQZXJsL1B5dGhvbi93aGF0ZXZlciBzY3JpcHQgdG8gZG8gdGhpcy4NCg0KPg0K PiBUaGFua3MgaW4gYWR2YW5jZSwNCj4NCg==

    --------------7GXh7pkD501AaOclghzv5z14--

    -----BEGIN PGP SIGNATURE-----

    wsF5BAABCAAjFiEE1A0c5XWknk+U2MemZUdBNabqRbUFAman0u0FAwAAAAAACgkQZUdBNabqRbXC 5Q//f+0DvpCvOWX2/sT6Xsv2hStUqN00yBqQZIppcIH4Wyl6GX76izgYw9jheCcesymNQCwp1YB5 HG3EWnODyY8cF8DoYyZxtB+wgdlKbZWeIoGxVq6WSI7ZEDKWQGvKvyiWXRv7ma1RFyqKhVPj2lsX RvebWKi9NiZKYgHsXsERoUqcprBoUlS8zbprMlcARXGPfJJAt/wiYz2hkDu+/5+9h/g1AZoq7wxJ p626gtUrdDzZEe3oZoejberA4Ac6bsPPO7aBLYRevETubqKW760JWMbUMekEMy4DXe6C1VumrsiL /EEhbCLl9kJV7bufaJYjYgBWw4xIGwoPiKTC7txGwRWYaFQRhnZEoYeIpTCYZwdcbVZFmLrzskXc gPygBxL36SoOyMs8+AxotbUnN35e7QaFP3i91jrIxAvicX+u/fXjcab7RPWB5k6/TCJf+cYTWYhC ty1YcITL4oJakjzjMjstbYaMeSg4IJVi5OB0w046hU8IXDkfvFb67urhIgWFthv4H6dP60qGm0tY kkqJZWkLoOc3gf2LbFzfcUedYUXu7dHv+H/YMDRvf9HCXbN1OH2FZdRb6LL8jOFYisknrWowF0F9 CqzXvbi3GK+yhwoHmIUQ4dWy37ftZmF46r4+2VNAAX8oR3+tOF/NUF5jujdXupK6KiPNHNtCZGR3 BqM=
    =kxd2
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From James Cloos@21:1/5 to All on Mon Jul 29 21:00:01 2024
    "NG" == Nicolas George <george@nsup.org> writes:

    I got curl to work (I did not know that curl could do IMAP):

    curl --user george --url imaps://server/Mail/testcurl --upload-file /tmp/mail

    Unfortunately, curl hardcodes that mail uploaded that way are seen:

    /* Send the APPEND command */
    result = imap_sendf(data,
    "APPEND %s (\\Seen) {%" CURL_FORMAT_CURL_OFF_T "}",
    mailbox, data->state.infilesize);

    … and I need them to be new.

    How about keeping a locally patched version of curl on hand (you could
    call it something like /usr/local/bin/imap-upload) which sets the flags
    as you want them to be?

    --
    -JimC
    cloos@jhcloos.com

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Nicolas George@21:1/5 to All on Tue Jul 30 09:20:01 2024
    James Cloos (12024-07-29):
    How about keeping a locally patched version of curl on hand (you could
    call it something like /usr/local/bin/imap-upload) which sets the flags
    as you want them to be?

    I did not need to ask for help for the obvious solution “write it yourself”, be it from scratch or from parts.

    Regards,

    --
    Nicolas George

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Nicolas George@21:1/5 to All on Tue Jul 30 10:30:01 2024
    Tim Woodall (12024-07-30):
    Yes, I use unison to keep some imap servers in sync.

    Be precise: you use unison to keep the directories that serve as mail
    storage for some IMAP servers in sync. Your unison does not know that
    there is IMAP involved.

    --
    Nicolas George

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Tim Woodall@21:1/5 to mick.crane on Tue Jul 30 10:30:01 2024
    On Mon, 29 Jul 2024, mick.crane wrote:

    On 2024-07-29 14:36, Nicolas George wrote:
    Hi.

    I am looking for a tool that reads a mail from its input and stores it
    into an IMAP mailbox:
    With a new Dovecot install I believe I copied all the old mails into eg. ~/Maidir/cur
    and they showed up.
    I was concerned the '1722260402.M755015P70320.xxxxxxxxxx,S=17279,W=17606:2,S' numbers might get mixed up with new ones but didn't seem to matter.
    Probably not how you are supposed to do it.
    mick


    Yes, I use unison to keep some imap servers in sync. Three servers
    receive mail which is then replicated and I've had no problems.

    So just adding files should be fine.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Tim Woodall@21:1/5 to Nicolas George on Tue Jul 30 11:00:01 2024
    On Tue, 30 Jul 2024, Nicolas George wrote:

    Tim Woodall (12024-07-30):
    Yes, I use unison to keep some imap servers in sync.

    Be precise: you use unison to keep the directories that serve as mail
    storage for some IMAP servers in sync. Your unison does not know that
    there is IMAP involved.

    Correct. Unison has no idea that it's synching maildirs.

    cat inbox-imap17.prf

    # Unison preferences file
    #

    # Roots of the synchronization
    root = /home/tim/Maildir/INBOX
    root = ssh://imap17//home/tim/Maildir/INBOX

    #Name matches anything, including a directory name.
    #Path matches anything but is anchored at the root
    ignore = Name .lock
    ignore = Name {dovecot.*}
    ignore = Name {dovecot-*}
    ignore = Name {tmp/*}

    # Log actions to the terminal
    log = true



    I've never 'tried' to break it by, for example, performing imap things
    on the same email on two servers at once but my guess is I'd end up with
    a duplicated email. It's possible I'd get a synch conflict but I've not
    had one yet. And I do occasionally use imap on more than one server at
    once.

    But I'd assume dropping files into the maildir with non-conflicting
    names - there might be restricions on how they should be named - would
    'just work' at least with dovecot.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)