Gnus development mailing list
 help / color / mirror / Atom feed
* per-message automatic splitting (with Sieve)
@ 2001-11-02 16:32 Kai Großjohann
  2001-11-02 18:43 ` Amos Gouaux
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Kai Großjohann @ 2001-11-02 16:32 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 585 bytes --]

I wonder if anybody is interested in the following which I've cooked
up for better use of nnimap with Sieve splitting on the Cyrus server.

You know, I used to be a great fan of nnmail-split-fancy-with-parent
which split a followup into the same group as the original.  I wanted
to have this for Sieve splitting, too, but there it is not so simple.

So I came up with the following method: I create custom Message-ID
headers which contain the right group name, and I do some Sieve rules
which grok this special Message-ID format.

Here's the code which creates my Message-ID headers:


[-- Attachment #2: Type: application/emacs-lisp, Size: 654 bytes --]

[-- Attachment #3: Type: text/plain, Size: 201 bytes --]

So this means that a Gcc field triggers the `right' token in the
message id, and if there is no Gcc field, Gnus looks at the current
group name.  It might be useful to look at the To/Cc headers, too.


[-- Attachment #4: Type: application/emacs-lisp, Size: 866 bytes --]

[-- Attachment #5: Type: text/plain, Size: 356 bytes --]

This piece of code takes a Sieve script and inserts rules which split
incoming messages based on the tokens in the Message-ID.

Hm.  I wonder, I should probably have used plus addressing, instead,
but our mail server does not grok plus addressing.  Argh :-(

Is anybody else doing something similar?  What do you do?

kai
-- 
Lisp is kinda like tpircstsoP

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

* Re: per-message automatic splitting (with Sieve)
  2001-11-02 16:32 per-message automatic splitting (with Sieve) Kai Großjohann
@ 2001-11-02 18:43 ` Amos Gouaux
  2001-11-02 19:38   ` Simon Josefsson
  2001-11-02 19:31 ` ShengHuo ZHU
  2001-11-02 22:58 ` Paul Jarc
  2 siblings, 1 reply; 7+ messages in thread
From: Amos Gouaux @ 2001-11-02 18:43 UTC (permalink / raw)


>>>>> On Fri, 02 Nov 2001 17:32:16 +0100,
>>>>> Kai Großjohann <Kai.Grossjohann@CS.Uni-Dortmund.DE> (kg) writes:

kg> I wonder if anybody is interested in the following which I've cooked
kg> up for better use of nnimap with Sieve splitting on the Cyrus server.

This looks really slick.  Something fun to play with this weekend.

kg> Hm.  I wonder, I should probably have used plus addressing, instead,
kg> but our mail server does not grok plus addressing.  Argh :-(

As you can see, I rely on + addressing pretty heavily.  ;-)

kg> Is anybody else doing something similar?  What do you do?

Well, I'm doing something heinous for my lists and "roles".  I like
to subscribe to a list with a "+" address so that all discussions
pertaining to that list are located in that folder.  This includes
off-line discussions that relate to a topic originating on a list.
I find it easier to keep track of things that way.

Then there are cases in which I need to assume a particular "role",
like answering support questions or something.  Posting styles is a
start, but there is a gap (or so I was finding) between these
posting styles and message delivery.  Sooo..., this is the evil I
conjured up.  Forgive me.


*** /usr/local/lib/xemacs/xemacs-packages/lisp/mail-lib/smtpmail.el     Sun May 27 14:13:36 2001
--- smtpmail.el Fri Jul 20 10:01:19 2001
***************
*** 194,200 ****
--- 194,202 ----
  
  ;;;###autoload
  (defun smtpmail-send-it ()
+   (message "Using my smtpmail-send-it")
    (require 'mail-utils)
+   (require 'message) ; XXX
    (let ((errbuf (if mail-interactive
                    (generate-new-buffer " smtpmail errors")
                  0))
***************
*** 219,224 ****
--- 221,227 ----
          (backward-char 1)
          (setq delimline (point-marker))
  ;;      (sendmail-synch-aliases)
+           (run-hooks 'message-send-mail-hook) ; XXX
          (if (and mail-aliases (fboundp 'expand-mail-aliases)) ; XEmacs
              (expand-mail-aliases (point-min) delimline))
          (goto-char (point-min))


Then in my Gnus setup I've got:


(require 'sendmail)
(defun user-mail-address ()
  (message "user-mail-address---> %s" user-mail-address)
  user-mail-address)

(add-hook
 'message-send-mail-hook
 (function
  (lambda ()
    (message "Running message-send-mail-hook...")
    (let* ((from (message-fetch-field "from"))
           (mail-extr-ignore-single-names nil)
           (parsed-from (mail-extract-address-components from)))
      (setq user-full-name (car parsed-from))
      (setq user-mail-address (cadr parsed-from)))
    (message "user-full-name: %s" user-full-name)
    (message "user-mail-address: %s" user-mail-address))))


Yeah, I probably shouldn't be doing this, but I was running into
more problems with Gnus than with PINE without it.  I'm sure there's
a better way to deal with it, but my elisp tinkering is so sporadic.

-Amos






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

* Re: per-message automatic splitting (with Sieve)
  2001-11-02 16:32 per-message automatic splitting (with Sieve) Kai Großjohann
  2001-11-02 18:43 ` Amos Gouaux
@ 2001-11-02 19:31 ` ShengHuo ZHU
  2001-11-02 22:34   ` Kai Großjohann
  2001-11-02 22:58 ` Paul Jarc
  2 siblings, 1 reply; 7+ messages in thread
From: ShengHuo ZHU @ 2001-11-02 19:31 UTC (permalink / raw)


Kai.Grossjohann@CS.Uni-Dortmund.DE (Kai Großjohann) writes:

> I wonder if anybody is interested in the following which I've cooked
> up for better use of nnimap with Sieve splitting on the Cyrus server.
>
> You know, I used to be a great fan of nnmail-split-fancy-with-parent
> which split a followup into the same group as the original.  I wanted
> to have this for Sieve splitting, too, but there it is not so simple.
>
> So I came up with the following method: I create custom Message-ID
> headers which contain the right group name, and I do some Sieve rules
> which grok this special Message-ID format.
>
> Here's the code which creates my Message-ID headers:

[...]

> This piece of code takes a Sieve script and inserts rules which split
> incoming messages based on the tokens in the Message-ID.

Sounds cool. What if I use your trick too, but I use folder
INBOX.sung.otua for Gnus mailing-list (I read some group name from
right to left and use folder INBOX.auto.gnus for automobile news :-).
Then my MID is blahblah.fsf@INBOX.sung.otua.tok.zsh.cs.rochester.edu.
Your trick breaks :-(.

ShengHuo



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

* Re: per-message automatic splitting (with Sieve)
  2001-11-02 18:43 ` Amos Gouaux
@ 2001-11-02 19:38   ` Simon Josefsson
  0 siblings, 0 replies; 7+ messages in thread
From: Simon Josefsson @ 2001-11-02 19:38 UTC (permalink / raw)
  Cc: ding

Amos Gouaux <amos+lists.ding@utdallas.edu> writes:

> Then there are cases in which I need to assume a particular "role",
> like answering support questions or something.  Posting styles is a
> start, but there is a gap (or so I was finding) between these
> posting styles and message delivery.  Sooo..., this is the evil I
> conjured up.  Forgive me.

My slightly hacked versions of sendmail.el and smtpmail.el [1] would
support that by binding `mail-specify-envelope-from' non-nil and then
binding `mail-envelope-from' via e.g. a posting style. (Unless, of
course, I missunderstood what your code does.)

[1]: http://josefsson.org/{send,smtp}mail.el, part of the next XEmacs
mail-lib package once that is released, and maybe future Emacs
releases.




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

* Re: per-message automatic splitting (with Sieve)
  2001-11-02 19:31 ` ShengHuo ZHU
@ 2001-11-02 22:34   ` Kai Großjohann
  0 siblings, 0 replies; 7+ messages in thread
From: Kai Großjohann @ 2001-11-02 22:34 UTC (permalink / raw)


ShengHuo ZHU <zsh@cs.rochester.edu> writes:

> Sounds cool. What if I use your trick too, but I use folder
> INBOX.sung.otua for Gnus mailing-list (I read some group name from
> right to left and use folder INBOX.auto.gnus for automobile news :-).
> Then my MID is blahblah.fsf@INBOX.sung.otua.tok.zsh.cs.rochester.edu.
> Your trick breaks :-(.

You mean it breaks because my code will match your token?  Hm.  I
should make the rules more specific to match only the _correct_ rhs.

Thanks for bringing this up.

kai
-- 
Lisp is kinda like tpircstsoP



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

* Re: per-message automatic splitting (with Sieve)
  2001-11-02 16:32 per-message automatic splitting (with Sieve) Kai Großjohann
  2001-11-02 18:43 ` Amos Gouaux
  2001-11-02 19:31 ` ShengHuo ZHU
@ 2001-11-02 22:58 ` Paul Jarc
  2001-11-03 16:15   ` Kai Großjohann
  2 siblings, 1 reply; 7+ messages in thread
From: Paul Jarc @ 2001-11-02 22:58 UTC (permalink / raw)


Kai.Grossjohann@CS.Uni-Dortmund.DE (Kai Großjohann) wrote:
> ;; Insert token into message id
> (defadvice message-make-fqdn (around group-token activate)
>   "Insert a token for the current group into the message id."

Wouldn't it be better to put the token on the left of the "@"?
message-make-fqdn is used for more than just Message-IDs, I think, and
it's possible you might generate an actual, different hostname,
risking a Message-ID collision.


paul



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

* Re: per-message automatic splitting (with Sieve)
  2001-11-02 22:58 ` Paul Jarc
@ 2001-11-03 16:15   ` Kai Großjohann
  0 siblings, 0 replies; 7+ messages in thread
From: Kai Großjohann @ 2001-11-03 16:15 UTC (permalink / raw)


prj@po.cwru.edu (Paul Jarc) writes:

> Wouldn't it be better to put the token on the left of the "@"?

Yes.  Thanks.

Ah, there's nothing like showing kluges to knowledgeable people to
help them get sorted out :-)

kai
-- 
Lisp is kinda like tpircstsoP



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

end of thread, other threads:[~2001-11-03 16:15 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-11-02 16:32 per-message automatic splitting (with Sieve) Kai Großjohann
2001-11-02 18:43 ` Amos Gouaux
2001-11-02 19:38   ` Simon Josefsson
2001-11-02 19:31 ` ShengHuo ZHU
2001-11-02 22:34   ` Kai Großjohann
2001-11-02 22:58 ` Paul Jarc
2001-11-03 16:15   ` Kai Großjohann

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).