Gnus development mailing list
 help / color / mirror / Atom feed
From: Alexander Kotelnikov <sacha@giotto.sj.ru>
Subject: bbdb-search problem
Date: Tue, 03 Sep 2002 11:37:20 +0400	[thread overview]
Message-ID: <87n0qza5hr.fsf@pale.loc> (raw)

Hello.

I have a function, which checks if incoming mail is from someone who
is in my ~/.bbdb:
(defun my-bbdb-split ()
  "We want people, who are in bbdb not to be splitted to spam"
  (let ((who (cadr
	      (gnus-extract-address-components (message-fetch-field "from"))
	      )))
    (if (bbdb-search (bbdb-records) nil nil who)
	nil
        '(: spam-split)
      )
    )
  )

And I got spam mail with From: that looks like
From: "Bullseye Stock Profiles" <Dreply-[-recipid-_r-5495489-58@1ad7bd.net>

and bbdb-search fails due to '[' presence in the address:
Debugger entered--Lisp error: (invalid-regexp "Unmatched [ or [^")
  string-match("Dreply-[-recipid-_r-5495489-58@1ad7bd.net" "theo@pdmi.ras.ru")
  (setq done (string-match who (car rest-of-nets)) rest-of-nets (cdr rest-of-nets))
  (while (and rest-of-nets (not done)) (setq done (string-match who ...) rest-of-nets (cdr rest-of-nets)))
  (if rest-of-nets (while (and rest-of-nets ...) (setq done ... rest-of-nets ...)) (setq done (string-match who "")))
  (let ((rest-of-nets ...) (done nil)) (if rest-of-nets (while ... ...) (setq done ...)) done)
  (or (let (... ...) (if rest-of-nets ... ...) done))
  (and (not invert) (or (let ... ... done)))
  (or (and invert (not ...)) (and (not invert) (or ...)))
  (if (or (and invert ...) (and ... ...)) (setq matches (cons record matches)))
  (while records (setq record (car records)) (if (or ... ...) (setq matches ...)) (setq records (cdr records)))
  (let ((matches ...) (case-fold-search bbdb-case-fold-search) (records ...) (invert ...) record) (while records (setq record ...) (if ... ...) (setq records ...)) (nreverse matches))
  (bbdb-search (bbdb-records) nil nil who)
  (if (bbdb-search (bbdb-records) nil nil who) nil (quote (: spam-split)))
  (let ((who ...)) (if (bbdb-search ... nil nil who) nil (quote ...)))
  my-bbdb-split()
  eval((my-bbdb-split))
  nnmail-split-it((: my-bbdb-split))
  nnmail-split-it((| (: pre-split) (: my-bbdb-split) (: ml-split) (: sj-split) (: post-split) "IMAP/junk"))
  nnmail-split-fancy()
  nnimap-split-fancy()
  nnimap-split-to-groups(nnimap-split-fancy)
  nnimap-split-articles(nil "giotto")
  nnimap-request-scan(nil "giotto")
  gnus-request-scan(nil (nnimap "giotto" (nnimap-address "giotto.sj.ru") (nnimap-stream shell) (nnimap-list-pattern ("INBOX" "IMAP/*"))))
  gnus-read-active-file-1((nnimap "giotto" (nnimap-address "giotto.sj.ru") (nnimap-stream shell) (nnimap-list-pattern ("INBOX" "IMAP/*"))) nil)
  gnus-read-active-file(nil nil)
  gnus-setup-news(nil nil nil)
  byte-code("\b└\x0e
  gnus-1(nil nil nil)
  gnus(nil)
* call-interactively(gnus)
  execute-extended-command(nil)
  call-interactively(execute-extended-command)

Probably, addresses should be quotted to avoid troubles like this.

-- 
Alexander Kotelnikov
Saint-Petersburg, Russia



             reply	other threads:[~2002-09-03  7:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-03  7:37 Alexander Kotelnikov [this message]
2002-09-03 13:19 ` Nevin Kapur

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=87n0qza5hr.fsf@pale.loc \
    --to=sacha@giotto.sj.ru \
    /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).