Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
* mail-default-headers and gnus
@ 2010-03-29 12:32 Francis Moreau
  2010-03-30 13:27 ` Ted Zlatanov
  0 siblings, 1 reply; 10+ messages in thread
From: Francis Moreau @ 2010-03-29 12:32 UTC (permalink / raw)
  To: info-gnus-english

Hello,

I like to get a copy of emails I send and I usually write email with
a) gnus or b) "M-x compose-mail". I use the latter if I'm in an emacs
session without gnus started. Actually I usually start one emacs
session for gnus itself.

To get a copy of email, I do 2 things a) tell gnus about it through
group property "gcc-self". b) tell it to emacs by using "(setq mail-
default-headers (concat "Bcc: " user-mail-address))".

The problem here is that when I compose an email in gnus, I get the
email copy twice.

Does anybody have a solution to get one and only one copy in both
world ?

thanks

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

* Re: mail-default-headers and gnus
  2010-03-29 12:32 mail-default-headers and gnus Francis Moreau
@ 2010-03-30 13:27 ` Ted Zlatanov
  2010-03-30 13:33   ` Francis Moreau
  0 siblings, 1 reply; 10+ messages in thread
From: Ted Zlatanov @ 2010-03-30 13:27 UTC (permalink / raw)
  To: info-gnus-english

On Mon, 29 Mar 2010 05:32:38 -0700 (PDT) Francis Moreau <francis.moro@gmail.com> wrote: 

FM> I like to get a copy of emails I send and I usually write email with
FM> a) gnus or b) "M-x compose-mail". I use the latter if I'm in an emacs
FM> session without gnus started. Actually I usually start one emacs
FM> session for gnus itself.

FM> To get a copy of email, I do 2 things a) tell gnus about it through
FM> group property "gcc-self". b) tell it to emacs by using "(setq mail-
FM> default-headers (concat "Bcc: " user-mail-address))".

FM> The problem here is that when I compose an email in gnus, I get the
FM> email copy twice.

FM> Does anybody have a solution to get one and only one copy in both
FM> world ?

If you never need both, just remove the Bcc header if the Gcc is set,
effectively making it an XOR.

I think you can also mark Gcc mails as read.

Ted

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

* Re: mail-default-headers and gnus
  2010-03-30 13:27 ` Ted Zlatanov
@ 2010-03-30 13:33   ` Francis Moreau
  2010-03-30 21:03     ` Ted Zlatanov
  0 siblings, 1 reply; 10+ messages in thread
From: Francis Moreau @ 2010-03-30 13:33 UTC (permalink / raw)
  To: info-gnus-english

On Mar 30, 3:27 pm, Ted Zlatanov <t...@lifelogs.com> wrote:
> On Mon, 29 Mar 2010 05:32:38 -0700 (PDT) Francis Moreau <francis.m...@gmail.com> wrote:
>
> FM> I like to get a copy of emails I send and I usually write email with
> FM> a) gnus or b) "M-x compose-mail". I use the latter if I'm in an emacs
> FM> session without gnus started. Actually I usually start one emacs
> FM> session for gnus itself.
>
> FM> To get a copy of email, I do 2 things a) tell gnus about it through
> FM> group property "gcc-self". b) tell it to emacs by using "(setq mail-
> FM> default-headers (concat "Bcc: " user-mail-address))".
>
> FM> The problem here is that when I compose an email in gnus, I get the
> FM> email copy twice.
>
> FM> Does anybody have a solution to get one and only one copy in both
> FM> world ?
>
> If you never need both, just remove the Bcc header if the Gcc is set,
> effectively making it an XOR.

yes but how should I do this ?

>
> I think you can also mark Gcc mails as read.

true, I do it with "(setq gnus-gcc-mark-as-read t)"

Thanks

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

* Re: mail-default-headers and gnus
  2010-03-30 13:33   ` Francis Moreau
@ 2010-03-30 21:03     ` Ted Zlatanov
  2010-03-31  9:21       ` Francis Moreau
  0 siblings, 1 reply; 10+ messages in thread
From: Ted Zlatanov @ 2010-03-30 21:03 UTC (permalink / raw)
  To: info-gnus-english

On Tue, 30 Mar 2010 06:33:13 -0700 (PDT) Francis Moreau <francis.moro@gmail.com> wrote: 

FM> On Mar 30, 3:27 pm, Ted Zlatanov <t...@lifelogs.com> wrote:
>> If you never need both, just remove the Bcc header if the Gcc is set,
>> effectively making it an XOR.

FM> yes but how should I do this ?

You could add this to your message-send-hook:

(save-restriction
  (message-narrow-to-headers)
  (when (and (message-fetch-field "Gcc") 
             (message-fetch-field "Bcc"))
    (message-remove-header "Gcc")))

You can test it in your message buffer, just paste and evaluate (`C-x
C-e' after the final parenthesis).

Ted

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

* Re: mail-default-headers and gnus
  2010-03-30 21:03     ` Ted Zlatanov
@ 2010-03-31  9:21       ` Francis Moreau
  2010-03-31 13:15         ` Ted Zlatanov
  0 siblings, 1 reply; 10+ messages in thread
From: Francis Moreau @ 2010-03-31  9:21 UTC (permalink / raw)
  To: info-gnus-english

Hello,

On Mar 30, 11:03 pm, Ted Zlatanov <t...@lifelogs.com> wrote:
> On Tue, 30 Mar 2010 06:33:13 -0700 (PDT) Francis Moreau <francis.m...@gmail.com> wrote:
>
> FM> On Mar 30, 3:27 pm, Ted Zlatanov <t...@lifelogs.com> wrote:
>
> >> If you never need both, just remove the Bcc header if the Gcc is set,
> >> effectively making it an XOR.
>
> FM> yes but how should I do this ?
>
> You could add this to your message-send-hook:
>
> (save-restriction
>   (message-narrow-to-headers)
>   (when (and (message-fetch-field "Gcc")
>              (message-fetch-field "Bcc"))
>     (message-remove-header "Gcc")))
>
> You can test it in your message buffer, just paste and evaluate (`C-x
> C-e' after the final parenthesis).

Thank you Ted, for giving me a solution.

I tried to remove "Bcc" header field instead of "Gcc" (as your example
do) but it doesn't work I still receive 2 copies of the email.

Do you know why ?

The reason for the change is that I prefer the way gnus handles "Gcc"
header, because in that case I don't actually receive new email in my
spool box (it's directly moved to my nnml:Inbox folder) and the mail
is marked as read automatically.

If I send a message by using 'compose-mail', I will have all drawbacks
I mentioned previously but that doesn't matter in this case because I
send emails this way much less often.

Thanks

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

* Re: mail-default-headers and gnus
  2010-03-31  9:21       ` Francis Moreau
@ 2010-03-31 13:15         ` Ted Zlatanov
  2010-03-31 13:53           ` Francis Moreau
  0 siblings, 1 reply; 10+ messages in thread
From: Ted Zlatanov @ 2010-03-31 13:15 UTC (permalink / raw)
  To: info-gnus-english

On Wed, 31 Mar 2010 02:21:00 -0700 (PDT) Francis Moreau <francis.moro@gmail.com> wrote: 

FM> I tried to remove "Bcc" header field instead of "Gcc" (as your example
FM> do) but it doesn't work I still receive 2 copies of the email.

FM> Do you know why ?

Try it out as I explained, with `C-x C-e'.  Do you see the Bcc removed
but the Gcc left in?

Ted

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

* Re: mail-default-headers and gnus
  2010-03-31 13:15         ` Ted Zlatanov
@ 2010-03-31 13:53           ` Francis Moreau
  2010-03-31 16:54             ` Ted Zlatanov
  0 siblings, 1 reply; 10+ messages in thread
From: Francis Moreau @ 2010-03-31 13:53 UTC (permalink / raw)
  To: info-gnus-english

On Mar 31, 3:15 pm, Ted Zlatanov <t...@lifelogs.com> wrote:
> On Wed, 31 Mar 2010 02:21:00 -0700 (PDT) Francis Moreau <francis.m...@gmail.com> wrote:
>
> FM> I tried to remove "Bcc" header field instead of "Gcc" (as your example
> FM> do) but it doesn't work I still receive 2 copies of the email.
>
> FM> Do you know why ?
>
> Try it out as I explained, with `C-x C-e'.  Do you see the Bcc removed
> but the Gcc left in?

Yes Bcc is removed as expected and Gcc is still there. But after
sending the message I still get 2 copies.

Thanks

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

* Re: mail-default-headers and gnus
  2010-03-31 13:53           ` Francis Moreau
@ 2010-03-31 16:54             ` Ted Zlatanov
  2010-03-31 19:18               ` Lowell Gilbert
  0 siblings, 1 reply; 10+ messages in thread
From: Ted Zlatanov @ 2010-03-31 16:54 UTC (permalink / raw)
  To: info-gnus-english

On Wed, 31 Mar 2010 06:53:30 -0700 (PDT) Francis Moreau <francis.moro@gmail.com> wrote: 

FM> On Mar 31, 3:15 pm, Ted Zlatanov <t...@lifelogs.com> wrote:
>> On Wed, 31 Mar 2010 02:21:00 -0700 (PDT) Francis Moreau <francis.m...@gmail.com> wrote:
>> 
FM> I tried to remove "Bcc" header field instead of "Gcc" (as your example
FM> do) but it doesn't work I still receive 2 copies of the email.
>> 
FM> Do you know why ?
>> 
>> Try it out as I explained, with `C-x C-e'.  Do you see the Bcc removed
>> but the Gcc left in?

FM> Yes Bcc is removed as expected and Gcc is still there. But after
FM> sending the message I still get 2 copies.

Could something be inserting the Bcc header back?  If not it could be
the hook I suggested is too early and the Bcc gets inserted again.  You
may also want to look at the actual message in the code you added to the
message-send-mail-hook; use (debug (buffer-string)) after you make the
modification.

Ted

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

* Re: mail-default-headers and gnus
  2010-03-31 16:54             ` Ted Zlatanov
@ 2010-03-31 19:18               ` Lowell Gilbert
  2010-03-31 20:07                 ` Francis Moreau
  0 siblings, 1 reply; 10+ messages in thread
From: Lowell Gilbert @ 2010-03-31 19:18 UTC (permalink / raw)
  To: info-gnus-english

Ted Zlatanov <tzz@lifelogs.com> writes:

> On Wed, 31 Mar 2010 06:53:30 -0700 (PDT) Francis Moreau <francis.moro@gmail.com> wrote: 
>
> FM> On Mar 31, 3:15 pm, Ted Zlatanov <t...@lifelogs.com> wrote:
>>> On Wed, 31 Mar 2010 02:21:00 -0700 (PDT) Francis Moreau <francis.m...@gmail.com> wrote:
>>> 
> FM> I tried to remove "Bcc" header field instead of "Gcc" (as your example
> FM> do) but it doesn't work I still receive 2 copies of the email.
>>> 
> FM> Do you know why ?
>>> 
>>> Try it out as I explained, with `C-x C-e'.  Do you see the Bcc removed
>>> but the Gcc left in?
>
> FM> Yes Bcc is removed as expected and Gcc is still there. But after
> FM> sending the message I still get 2 copies.
>
> Could something be inserting the Bcc header back?  If not it could be
> the hook I suggested is too early and the Bcc gets inserted again.  You
> may also want to look at the actual message in the code you added to the
> message-send-mail-hook; use (debug (buffer-string)) after you make the
> modification.

Is it possible that the Bcc is being added outside of Emacs?  I've
fooled myself on that kind of thing once or twice.  The SMTP trace
showed it (or, rather, its absence) quite clearly.

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

* Re: mail-default-headers and gnus
  2010-03-31 19:18               ` Lowell Gilbert
@ 2010-03-31 20:07                 ` Francis Moreau
  0 siblings, 0 replies; 10+ messages in thread
From: Francis Moreau @ 2010-03-31 20:07 UTC (permalink / raw)
  To: info-gnus-english

On Mar 31, 9:18 pm, Lowell Gilbert <lguse...@be-well.ilk.org> wrote:
> Ted Zlatanov <t...@lifelogs.com> writes:
> > On Wed, 31 Mar 2010 06:53:30 -0700 (PDT) Francis Moreau <francis.m...@gmail.com> wrote:
>
> > FM> On Mar 31, 3:15 pm, Ted Zlatanov <t...@lifelogs.com> wrote:
> >>> On Wed, 31 Mar 2010 02:21:00 -0700 (PDT) Francis Moreau <francis.m...@gmail.com> wrote:
>
> > FM> I tried to remove "Bcc" header field instead of "Gcc" (as your example
> > FM> do) but it doesn't work I still receive 2 copies of the email.
>
> > FM> Do you know why ?
>
> >>> Try it out as I explained, with `C-x C-e'. Do you see the Bcc removed
> >>> but the Gcc left in?
>
> > FM> Yes Bcc is removed as expected and Gcc is still there. But after
> > FM> sending the message I still get 2 copies.
>
> > Could something be inserting the Bcc header back?  If not it could be
> > the hook I suggested is too early and the Bcc gets inserted again.  You
> > may also want to look at the actual message in the code you added to the
> > message-send-mail-hook; use (debug (buffer-string)) after you make the
> > modification.
>
> Is it possible that the Bcc is being added outside of Emacs?  I've
> fooled myself on that kind of thing once or twice.  The SMTP trace
> showed it (or, rather, its absence) quite clearly.

yes you're probably right since I looked at the actual message by
using 'message-send-mail-hook' as Ted suggested and I don't see the
Bcc field.

I'll look at the SMTP thing.

Thanks

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

end of thread, other threads:[~2010-03-31 20:07 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-29 12:32 mail-default-headers and gnus Francis Moreau
2010-03-30 13:27 ` Ted Zlatanov
2010-03-30 13:33   ` Francis Moreau
2010-03-30 21:03     ` Ted Zlatanov
2010-03-31  9:21       ` Francis Moreau
2010-03-31 13:15         ` Ted Zlatanov
2010-03-31 13:53           ` Francis Moreau
2010-03-31 16:54             ` Ted Zlatanov
2010-03-31 19:18               ` Lowell Gilbert
2010-03-31 20:07                 ` Francis Moreau

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