* Grabbing single name user names for this elisp don't work in GNUS/Oort
@ 2002-06-08 10:37 Sean Rima
2002-06-08 10:53 ` Simon Josefsson
0 siblings, 1 reply; 3+ messages in thread
From: Sean Rima @ 2002-06-08 10:37 UTC (permalink / raw)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I use Gnus Oort, CVS version along with Ifmail for Fidonet use. I have a
function that reads the from name and makes an X-Comment-To header for
selected NGs which works fine as long as the original poster has two or
more words in his name, but if he/she only has one then it fails. The
script is:
,----[ gnus_xcom.el ]
| (require `sendmail)
| (require `mail-utils)
| (require `mail-extr)
| (require `message)
| (provide `fido-message-header-setup)
|
| (defvar fido-ftn-address-regexp "fido\|ger\.sub\.de"
| "A regexp matching FTN addresses.")
|
| (defvar fido-ftn-newsgroup-regexp "fido\\|ln\\|adv\\|micronet"
| "A regexp matching FTN newsgroups.")
|
| (defun fido-is-fido-mail ()
| "Returns t if the current message is sent to an FTN address."
| (and
| (message-fetch-field "To")
| (string-match fido-ftn-address-regexp (message-fetch-field "To"))))
|
| (defun fido-is-fido-news ()
| "Returns t if the current message is sent to a FTN newsgroup."
| (and
| (message-fetch-field "Newsgroups")
| (string-match
| fido-ftn-newsgroup-regexp (message-fetch-field "Newsgroups"))))
|
| (defun fido-get-name ()
| "Get the name of the author of the original message."
| (car (mail-extract-address-components
| (message-fetch-reply-field "from"))))
|
| (defun fido-message-header-setup ()
| "Inserts the appropriate headers."
| (if (fido-is-fido-mail)
| (progn
| (mail-position-on-field "to")
| (insert "")))
| (and
| (fido-is-fido-news)
| (progn
| (mail-position-on-field "newsgroups")
| (insert "")
| t)
| (fido-get-name)
| (progn
| (insert (concat "\nX-Comment-To: " (fido-get-name) "")))))
|
| (add-hook `message-setup-hook `fido-message-header-setup)
`----
- --
Sean Rima http://www.tcob1.net
Linux User: 231986 Jabber: tcobone@jabber.org
THE VIEWS EXPRESSED HERE ARE NOT NECESSARILY THOSE OF MY WIFE.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)
Comment: Use GPG for Secure Mail
iD8DBQE9Ad59eR/L2ZZp3E8RAiRxAKC/3yDPOdc/CFiN8QgaeLlasUJWcgCfc8gh
x+LML423WpmUlRl/nnloeM8=
=MQLO
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Grabbing single name user names for this elisp don't work in GNUS/Oort
2002-06-08 10:37 Grabbing single name user names for this elisp don't work in GNUS/Oort Sean Rima
@ 2002-06-08 10:53 ` Simon Josefsson
2002-06-08 11:24 ` Sean Rima
0 siblings, 1 reply; 3+ messages in thread
From: Simon Josefsson @ 2002-06-08 10:53 UTC (permalink / raw)
Cc: ding
Sean Rima <sean@tcob1.net> writes:
> I use Gnus Oort, CVS version along with Ifmail for Fidonet use. I have a
> function that reads the from name and makes an X-Comment-To header for
> selected NGs which works fine as long as the original poster has two or
> more words in his name, but if he/she only has one then it fails. The
> script is:
Use `mail-extr-ignore-single-names' like:
> ,----[ gnus_xcom.el ]
> | (require `sendmail)
> | (require `mail-utils)
> | (require `mail-extr)
> | (require `message)
> | (provide `fido-message-header-setup)
> |
> | (defvar fido-ftn-address-regexp "fido\|ger\.sub\.de"
> | "A regexp matching FTN addresses.")
> |
> | (defvar fido-ftn-newsgroup-regexp "fido\\|ln\\|adv\\|micronet"
> | "A regexp matching FTN newsgroups.")
> |
> | (defun fido-is-fido-mail ()
> | "Returns t if the current message is sent to an FTN address."
> | (and
> | (message-fetch-field "To")
> | (string-match fido-ftn-address-regexp (message-fetch-field "To"))))
> |
> | (defun fido-is-fido-news ()
> | "Returns t if the current message is sent to a FTN newsgroup."
> | (and
> | (message-fetch-field "Newsgroups")
> | (string-match
> | fido-ftn-newsgroup-regexp (message-fetch-field "Newsgroups"))))
> |
> | (defun fido-get-name ()
> | "Get the name of the author of the original message."
(let (mail-extr-ignore-single-names)
> | (car (mail-extract-address-components
> | (message-fetch-reply-field "from"))))
)
> |
> | (defun fido-message-header-setup ()
> | "Inserts the appropriate headers."
> | (if (fido-is-fido-mail)
> | (progn
> | (mail-position-on-field "to")
> | (insert "")))
> | (and
> | (fido-is-fido-news)
> | (progn
> | (mail-position-on-field "newsgroups")
> | (insert "")
> | t)
> | (fido-get-name)
> | (progn
> | (insert (concat "\nX-Comment-To: " (fido-get-name) "")))))
> |
> | (add-hook `message-setup-hook `fido-message-header-setup)
> `----
>
> --
> Sean Rima http://www.tcob1.net
> Linux User: 231986 Jabber: tcobone@jabber.org
> THE VIEWS EXPRESSED HERE ARE NOT NECESSARILY THOSE OF MY WIFE.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Grabbing single name user names for this elisp don't work in GNUS/Oort
2002-06-08 10:53 ` Simon Josefsson
@ 2002-06-08 11:24 ` Sean Rima
0 siblings, 0 replies; 3+ messages in thread
From: Sean Rima @ 2002-06-08 11:24 UTC (permalink / raw)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Sat, 08 Jun 2002, Simon Josefsson stated:
> Sean Rima <sean@tcob1.net> writes:
>
>> I use Gnus Oort, CVS version along with Ifmail for Fidonet use. I
>> have a function that reads the from name and makes an X-Comment-To
>> header for selected NGs which works fine as long as the original
>> poster has two or more words in his name, but if he/she only has one
>> then it fails. The script is:
>
> Use `mail-extr-ignore-single-names' like:
>
Tried that but still no joy, have to play around with mail-extract me
thinks.
Sean
- --
Sean Rima http://www.tcob1.net
Linux User: 231986 Jabber: tcobone@jabber.org
THE VIEWS EXPRESSED HERE ARE NOT NECESSARILY THOSE OF MY WIFE.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)
Comment: Use GPG for Secure Mail
iD8DBQE9Ael3eR/L2ZZp3E8RArIgAJ454oQq6TLH6BtuMfv6BCDtQDtn6ACbBv8s
690DvPvRje2R0MZp6foxFyA=
=oPjj
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2002-06-08 11:24 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-06-08 10:37 Grabbing single name user names for this elisp don't work in GNUS/Oort Sean Rima
2002-06-08 10:53 ` Simon Josefsson
2002-06-08 11:24 ` Sean Rima
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).