Gnus development mailing list
 help / color / mirror / Atom feed
From: Sean Rima <sean@tcob1.net>
Subject: Grabbing single name user names for this elisp don't work in GNUS/Oort
Date: Sat, 08 Jun 2002 11:37:49 +0100	[thread overview]
Message-ID: <zds.p90.m3660u3vk2.fsf@tcob1.net> (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-----



             reply	other threads:[~2002-06-08 10:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-08 10:37 Sean Rima [this message]
2002-06-08 10:53 ` Simon Josefsson
2002-06-08 11:24   ` Sean Rima

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=zds.p90.m3660u3vk2.fsf@tcob1.net \
    --to=sean@tcob1.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).