help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: package for Email


From: Jean Louis
Subject: Re: package for Email
Date: Thu, 19 Jan 2023 06:53:50 +0300
User-agent: Mutt/2.2.9+54 (af2080d) (2022-11-21)

Among all synchronization tools, I find program `movemail' which is
also supported by Emacs, more useful, as it supports all kinds of
mailboxes, it is part of GNU Mailutils.

GNU Mailutils:
https://mailutils.org/

Usage instructions:

$ movemail --help
Usage: movemail [OPTION...] inbox-url destfile [POP-password]
GNU movemail -- move messages across mailboxes.

      --[no-]emacs           output information used by Emacs rmail interface
      --[no-]ignore-errors   try to continue after errors
      --max-messages=NUMBER  process at most NUMBER messages
  -m, --[no-]progress-meter  enable progress meter
      --[no-]notify          enable biff notification
      --onerror=KW[,KW...]   what to do on errors
  -P, --owner=MODELIST       control mailbox ownership
  -p, --[no-]preserve, --keep-messages
                             preserve the source mailbox
      --program-id=FMT       set program identifier for diagnostics (default:
                             program name)
  -r, --[no-]reverse         reverse the sorting order
  -u, --[no-]uidl            use UIDLs to avoid downloading the same message
                             twice
  -v, --verbose              increase verbosity level

I use it like this, but in a program that is invoked by crontab,
Common Lisp:

(defun movemail (mailbox)
  (let ((pids (shell-1st-result "pgrep -f movemail")))
    (if pids (error "Other movemail processs exists.")
        (concatenate 'string
               "timeout 10m /usr/local/bin/movemail -m "
               ;; "movemail "
               (when debug "--debug-level='mailbox.prot,!trace6' ")
               "-v 'imaps://" username ":" password "@" server ":" port "/"
               (car (gethash (intern mailbox) mailboxes)) "' \""
               (cadr (gethash (intern mailbox) mailboxes))
               "\""))))

So it would be like:

$ timeout 10m /usr/local/bin/movemail -m 
'imaps://USERNAME:PASSWORD@example.com:993/INBOX' ~/Maildir

or other server folders are transferred to local maildirs:

$ timeout 10m /usr/local/bin/movemail -m 
'imaps://USERNAME:PASSWORD@example.com:993/INBOX.OtherFolder' 
~/Maildir/otherfolder


--
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]