Discussion:
Removing Self Address from the CC
Hideki Saito
2014-09-14 04:38:51 UTC
Permalink
Hi,

If I can get some recommendation for this, it'll be very
helpful. Basically, I'm trying to find the good way of removing self-CC
address from the header. Because my SMTP/address switching is fairly
complicated with different address and aliases I have to reply from, I'm using the script like following:


(defun gnus-hideki-a ()
(interactive)
(message-goto-from)
(kill-whole-line)
(insert "X-Message-SMTP-Method: smtp smtp.googlemail.com 587 ***@a.com\nFrom: Myself <***@a.com>\n")
(message-goto-signature)
(kill-whole-line)
(insert "Stuff to add for a.com")
(message-goto-body)
)

(defun gnus-hideki-a ()
(interactive)
(message-goto-from)
(kill-whole-line)
(insert "X-Message-SMTP-Method: smtp smtp.googlemail.com 587
***@b.com\nFrom: Myself
<***@b.com>\nOrganization: B\n")
(message-goto-signature)
(kill-whole-line)
(insert "Stuff to add for b.com")
(message-goto-body)
)

However, the complication is when I wide reply an E-mail message, it'd
often end up in E-mail header, such as:

From: ***@a.com
To: ***@a.com
CC: Myself <***@b.com>

or

From: ***@a.com
To: ***@a.com
CC: ***@b.com

Essentially, what I'm trying to get accomomplished is to remove myself
from CC only when it matches with my From address. The complicated part
is that gnus won't know my "Myself" address until the moment of sending
the message (thus, built-in option to eradicate address with regexp
won't work in my case), so I'm thinking about incorporating the code to
verify and remove the address when the above switching takes place.

If you have any suggestion, that would be very helpful.

Thank you.
--
Hideki Saito
OpenPGP Key: http://hidekisaito.com/aff2e40b.txt
1066 3928 7B0B E7CD A0CB 3686 1FDF D937 AFF2 E40B
http://hidekisaito.com
Adam Sjøgren
2014-09-14 10:17:50 UTC
Permalink
I'm trying to find the good way of removing self-CC address from the
header.
Does it help to set the variable message-dont-reply-to-names to match
your email-adresses?

,----[ C-h v message-dont-reply-to-names RET ]
| message-dont-reply-to-names is a variable defined in `message.el'.
| Its value is
| "\\(asjo\\|adam\\)@\\(koldfront.dk\\|asjo.org\\)"
| Original value was nil
|
| Documentation:
| *Addresses to prune when doing wide replies.
| This can be a regexp or a list of regexps. Also, a value of nil means
| exclude your own user name only.
`----


Best regards,

Adam
--
"This means that tweets about Lady Gaga's lingerie Adam Sjøgren
can help someone debugging Perl code. (Or a tweet ***@koldfront.dk
about Perl code may help Lady Gaga's underwear
stylist.)"
Hideki Saito
2014-09-14 18:52:02 UTC
Permalink
Post by Adam Sjøgren
Does it help to set the variable message-dont-reply-to-names to match
your email-adresses?
,----[ C-h v message-dont-reply-to-names RET ]
| message-dont-reply-to-names is a variable defined in `message.el'.
| Its value is
| Original value was nil
|
| *Addresses to prune when doing wide replies.
| This can be a regexp or a list of regexps. Also, a value of nil means
| exclude your own user name only.
`----
Thank you for the suggestion

Yes, this is the way I have set up for the meantime.

Only limitation I can think of is when replying to E-mail address to
a.com (and CCed to b.com) from a.com, where CC to b.com would be removed...
--
Hideki Saito
OpenPGP Key: http://hidekisaito.com/aff2e40b.txt
1066 3928 7B0B E7CD A0CB 3686 1FDF D937 AFF2 E40B
http://hidekisaito.com
Loading...