Re: [PATCH] Fix typo in Message.maildir_flags_to_tags
[notmuch-archives.git] / e8 / f34052aaf2bbc939620f23393af94a2c667b0c
1 Return-Path: <notmuchmail_org@campese.de>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id 30C28431FAE\r
6         for <notmuch@notmuchmail.org>; Fri, 10 Feb 2012 15:51:04 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
12         autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id raRghUsTA+sH for <notmuch@notmuchmail.org>;\r
16         Fri, 10 Feb 2012 15:51:03 -0800 (PST)\r
17 Received: from mail01.worldserver.net (mail01.worldserver.net [217.13.200.41])\r
18         by olra.theworths.org (Postfix) with ESMTP id 26FAF431FB6\r
19         for <notmuch@notmuchmail.org>; Fri, 10 Feb 2012 15:51:03 -0800 (PST)\r
20 Received: from localhost (cable-83.217.143.231.coditel.net [83.217.143.231])\r
21         (Authenticated sender: mailer@campese.de)\r
22         by mail01.worldserver.net (Postfix) with ESMTPSA id 205263000D6;\r
23         Sat, 11 Feb 2012 00:52:14 +0100 (CET)\r
24 From: Simon Campese <notmuchmail_org@campese.de>\r
25 To: Jameson Graef Rollins <jrollins@finestructure.net>\r
26 Subject: Re: Set "From" based on "To" when replying\r
27 In-Reply-To: <8739atqfun.fsf@servo.finestructure.net>\r
28 References: <87obtx5as1.fsf@tu-dortmund.de> <87obthxi1u.fsf@nikula.org>\r
29         <8739atqfun.fsf@servo.finestructure.net>\r
30 User-Agent: Notmuch/0.11+128~g6f388fa (http://notmuchmail.org) Emacs/23.4.1\r
31         (x86_64-unknown-linux-gnu)\r
32 Date: Sat, 11 Feb 2012 00:51:00 +0100\r
33 Message-ID: <877gzujli3.fsf@tu-dortmund.de>\r
34 MIME-Version: 1.0\r
35 Content-Type: text/plain; charset=us-ascii\r
36 Cc: notmuch@notmuchmail.org\r
37 X-BeenThere: notmuch@notmuchmail.org\r
38 X-Mailman-Version: 2.1.13\r
39 Precedence: list\r
40 List-Id: "Use and development of the notmuch mail system."\r
41         <notmuch.notmuchmail.org>\r
42 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
43         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
44 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
45 List-Post: <mailto:notmuch@notmuchmail.org>\r
46 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
47 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
48         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
49 X-List-Received-Date: Fri, 10 Feb 2012 23:51:04 -0000\r
50 \r
51 > Yeah, I think this is the point: you want "*@mydomain.org" to be one of\r
52 > the user.other_email.  I don't see why that couldn't be done with a\r
53 > little work in notmuch-reply.c.  I wouldn't mind seeing this\r
54 > functionality as well, actually.\r
55 \r
56 So here's my shabby solution (pasted from my .emacs):\r
57 \r
58 ;;automatically take From: from To: if mail was sent to .*@mydomain.org\r
59 \r
60 (defun notmuch-show-reply-sender-mod ()\r
61   (interactive)\r
62 (if (string-match ".*@campese.de" (notmuch-show-get-header :To))\r
63 (notmuch-mua-reply (notmuch-show-get-message-id) (notmuch-show-get-header :To)\r
64 nil) (notmuch-show-reply-sender)))\r
65 \r
66 (defun notmuch-show-reply-mod ()\r
67   (interactive)\r
68 (if (string-match ".*@campese.de" (notmuch-show-get-header :To))\r
69 (notmuch-mua-reply (notmuch-show-get-message-id) (notmuch-show-get-header :To) t)\r
70 (notmuch-show-reply)))\r
71 \r
72 (define-key notmuch-show-mode-map "r" 'notmuch-show-reply-sender-mod)\r
73 (define-key notmuch-show-mode-map "R" 'notmuch-show-reply-mod)\r
74 \r
75 If it sees "@mydomain.org" in the 'To'-header, it copies the whole\r
76 "To:"-header to the "From:" header when replying. This works as long as\r
77 I'm the only one in the "To:"-header, which usually is the case (I only\r
78 use this "special" email addreses when registering at online-shops,\r
79 forums, etc. to be able to easily track where spammers got my email\r
80 from.\r
81 \r
82 I totally agree that a clean solution would be regular expressions in\r
83 the primary_email and other_email fields in notmuch-config.\r
84 \r
85 Anyone up for implementing this? :-)\r
86 \r
87 Best,\r
88 \r
89 Simon\r