Gnus development mailing list
 help / color / mirror / Atom feed
* [CODE] Adding continuation line characters in headers automatically.
@ 2002-04-03 18:18 Matthieu Moy
  2002-04-04  7:44 ` Matthieu Moy
  2003-01-01 20:53 ` Lars Magne Ingebrigtsen
  0 siblings, 2 replies; 3+ messages in thread
From: Matthieu Moy @ 2002-04-03 18:18 UTC (permalink / raw)


Hi ! 

The other day, my friends took me  for an idiot, because I sent a mail
with that kind of headers :

To: First.person@host.com,
second@host2.com,
third@host.com

And only the first one recieved it ... One of my teachers had the same
problem with Rmail, and this  may have been very confusing, because he
thought everybody had recieved the mail ...

For that reason, I wrote the following function :


(defun moy-gnus-check-headers ()
  "Checks wether  there is a mistake with  continuation line characters
in the mail headers"
  (interactive)
  (save-restriction
    (widen)
    (narrow-to-region (point-min)
		      (progn (goto-char (point-min))
			     (search-forward mail-header-separator)
			     (beginning-of-line nil)
			     (point)
			     ))
    (goto-char (point-min))
    (while (re-search-forward "^[^ \\n][^:\\n]*$" nil t)
      (if (y-or-n-p "You have line in your headers without : and not \
beginning by a continuation caracter. Add one ?")
	  (progn
	    (goto-char (match-beginning 0))
	    (insert " "))
	(if (y-or-n-p "Send anyway ?")
	    t
	  (error "not sending message"))))
    )
  )


And I have added this in my .gnus.el :

(add-hook 'message-send-hook 'moy-gnus-check-headers)


I think this kind of material should be the default behaviour of Gnus,
in     a    function     like     message-check-news-body-syntax    in
message.el. (Actually, not only Gnus, but any Emacs mailer.) 

Anyone to include this code ? 

-- 
Matthieu



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [CODE] Adding continuation line characters in headers automatically.
  2002-04-03 18:18 [CODE] Adding continuation line characters in headers automatically Matthieu Moy
@ 2002-04-04  7:44 ` Matthieu Moy
  2003-01-01 20:53 ` Lars Magne Ingebrigtsen
  1 sibling, 0 replies; 3+ messages in thread
From: Matthieu Moy @ 2002-04-04  7:44 UTC (permalink / raw)


Matthieu Moy <Matthieu.Moy@imag.fr> writes:

>     (while (re-search-forward "^[^ \\n][^:\\n]*$" nil t)
                                  [^ 	\\n] (One space and one tab)

This time, I think it works ! 

-- 
Matthieu



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [CODE] Adding continuation line characters in headers automatically.
  2002-04-03 18:18 [CODE] Adding continuation line characters in headers automatically Matthieu Moy
  2002-04-04  7:44 ` Matthieu Moy
@ 2003-01-01 20:53 ` Lars Magne Ingebrigtsen
  1 sibling, 0 replies; 3+ messages in thread
From: Lars Magne Ingebrigtsen @ 2003-01-01 20:53 UTC (permalink / raw)


Matthieu Moy <Matthieu.Moy@imag.fr> writes:

> (defun moy-gnus-check-headers ()
>   "Checks wether  there is a mistake with  continuation line characters
> in the mail headers"
>   (interactive)
>   (save-restriction
>     (widen)
>     (narrow-to-region (point-min)
> 		      (progn (goto-char (point-min))
> 			     (search-forward mail-header-separator)
> 			     (beginning-of-line nil)
> 			     (point)
> 			     ))
>     (goto-char (point-min))
>     (while (re-search-forward "^[^ \\n][^:\\n]*$" nil t)
>       (if (y-or-n-p "You have line in your headers without : and not \
> beginning by a continuation caracter. Add one ?")
> 	  (progn
> 	    (goto-char (match-beginning 0))
> 	    (insert " "))
> 	(if (y-or-n-p "Send anyway ?")
> 	    t
> 	  (error "not sending message"))))
>     )
>   )

I think this is a good idea.  Do you have FSF copyright assignment
papers on file? 

-- 
(domestic pets only, the antidote for overdose, milk.)
   larsi@gnus.org * Lars Magne Ingebrigtsen



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-01-01 20:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-03 18:18 [CODE] Adding continuation line characters in headers automatically Matthieu Moy
2002-04-04  7:44 ` Matthieu Moy
2003-01-01 20:53 ` Lars Magne Ingebrigtsen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).