Wilane' Weblog

jaZZ ... just another Zine Zblog

Billets dans la catégorie « Imap »

Oublié de joindre le fichier ? Wanderlust !

écrit par Ousmane Wilane, le 28/09/09 12:50.

Nous oublions tout le temps d’attacher des fichiers aux courriels après les avoir annoncé dans le corps du courriel, avec Wanderlust, vous pouvez vous le faire rappeler avant d’envoyer le courriel. Ce billet est entièrement programmé par djcb, j’ai juste ajouté la chaîne joint à l’expression régulière. Merci djcb. Vous trouverez sur le blog de djcb le hook utilisé pour vous rappelez que vous envoyez un courriel sans objet.

(defun my-wl-draft-attachment-check ()
  "if attachment is mention but none included, 
   warn the the user"
  (save-excursion
    (goto-char 0)
    (unless ;; don't we have an attachment?
	(re-search-forward "^Content-Disposition: 
                                attachment" nil t) 
      (when ;; no attachment; did we mention 
                                    an attachment?
	  ;; English or French
	  (re-search-forward "attach\|joint" nil t)
	(unless (y-or-n-p "Vous n'avez peut 
        être pas joint la pièce. Voulez-vous 
        quand même envoyer le brouillon ?")
          (error "Abort."))))))

(add-hook 'wl-mail-send-pre-hook 
                          'my-wl-draft-attachment-check)