* can I set user-mail-address differently for each group?
@ 2025-03-06 16:14 Uwe Brauer
2025-03-07 15:57 ` Eric S Fraga
0 siblings, 1 reply; 6+ messages in thread
From: Uwe Brauer @ 2025-03-06 16:14 UTC (permalink / raw)
To: ding
Hi
I know I can set
(setq gnus-posting-styles
'(("nnimap\\+UCMgmail.*"
(address "user1@gmail.com"))
("nnimap\\+WorkMail.*"
(address "user2@company.com"))))
But this seems to be independent of the user-mail-address as I just checked.
Any idea?
Uwe Brauer
--
I strongly condemn Hamas heinous despicable pogroms/atrocities on Israel
I strongly condemn Putin's war of aggression against Ukraine.
I support to deliver weapons to Ukraine's military.
I support the EU and NATO membership of Ukraine.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: can I set user-mail-address differently for each group?
2025-03-06 16:14 can I set user-mail-address differently for each group? Uwe Brauer
@ 2025-03-07 15:57 ` Eric S Fraga
2025-03-08 7:21 ` Uwe Brauer
0 siblings, 1 reply; 6+ messages in thread
From: Eric S Fraga @ 2025-03-07 15:57 UTC (permalink / raw)
To: ding
Response below/inline for email Uwe Brauer wrote:
> (original email sent 6 Mar 2025 at 17:14)
>
> But this seems to be independent of the user-mail-address as I just checked.
I'm not sure what this means. In any case, I set both "address" and
"from".
--
Eric S Fraga via gnus (Emacs 31.0.50 2025-03-03) on Debian 12.9
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: can I set user-mail-address differently for each group?
2025-03-07 15:57 ` Eric S Fraga
@ 2025-03-08 7:21 ` Uwe Brauer
2025-03-10 3:30 ` Husain Alshehhi
2025-03-11 7:47 ` [SOLVED] (was: can I set user-mail-address differently for each group?) Uwe Brauer
0 siblings, 2 replies; 6+ messages in thread
From: Uwe Brauer @ 2025-03-08 7:21 UTC (permalink / raw)
To: ding
[-- Attachment #1: Type: text/plain, Size: 3609 bytes --]
>>> "ESF" == Eric S Fraga <e.fraga@ucl.ac.uk> writes:
> Response below/inline for email Uwe Brauer wrote:
>> (original email sent 6 Mar 2025 at 17:14)
>>
>> But this seems to be independent of the user-mail-address as I just checked.
> I'm not sure what this means. In any case, I set both "address" and
> "from".
What I tried to say is this:
I have
(setq gnus-posting-styles
'(("nnimap\\+UCMgmail.*"
(address "user1@gmail.com"))
("nnimap\\+WorkMail.*"
(address "user2@company.com"))))
I enter on of the WorkMail groups and run describe-variable
user-mail-address and see
user1@gmail.com
but *not* user2@company.com
Why is this important?
Well as I wrote in the other gnus mailing list and on email dev, I now
use a function that checks if your address (as controlled by
user-mail-address, is in the To or CC field in order to check that you
have not be on the BCC and can run in potentially embarrassing
situation.
(defun check-bcc-gnus-article-followup-with-original ()
"This function warns you if your email address is not in the To or
Cc field, unless it's a newsgroup post or the email is from a
mailing list (List-Id or List-Post fields). If any of these conditions
apply, it directly calls `gnus-article-followup-with-original`."
(interactive)
(gnus-summary-select-article-buffer)
(gnus-summary-toggle-header 1)
(let* ((to-field (message-fetch-field "To"))
(cc-field (message-fetch-field "Cc"))
(newsgroup-field (message-fetch-field "Newsgroups"))
(list-id-field (message-fetch-field "List-Id"))
(list-post-field (message-fetch-field "List-Post")))
(message "To: %s, Cc: %s, Newsgroups: %s, List-Id: %s, List-Post: %s"
to-field cc-field newsgroup-field list-id-field list-post-field)
(if (or (and to-field (string-match-p (regexp-quote user-mail-address) to-field))
(and cc-field (string-match-p (regexp-quote user-mail-address) cc-field))
(and list-id-field (not (string= list-id-field ""))) ;; Ensure non-empty value
(and list-post-field (not (string= list-post-field "")))
newsgroup-field)
;; Case 1-4: If To, Cc, List-Id, List-Post, or Newsgroups field applies, directly follow up
(gnus-article-followup-with-original)
;; Case 5: If none of the conditions are met, warn the user using `read-multiple-choice`
(let* ((choices
`((?1 "followup" "Use gnus-article-followup-with-original")
(?2 "reply" "Use gnus-article-reply-with-original")
(?3 "abort" "Abort operation")))
(choice (read-multiple-choice
"Warning: Followup? But you are not on the TO or CC field, and this is not a mailing list email.\n A reply may reveal that you were Bcc'ed. \n Which choice?"
choices)))
(pcase (car choice)
(?1 (gnus-article-followup-with-original))
(?2 (gnus-article-reply-with-original))
(?3 (quit-window))
(_ (error "Unexpected choice"))))))
(gnus-summary-toggle-header))
But this does not work if I enter a group that is connected to a
different mail server via the nnimap server
Did I explain my problem now better?
Regards
Uwe
--
I strongly condemn Hamas heinous despicable pogroms/atrocities on Israel
I strongly condemn Putin's war of aggression against Ukraine.
I support to deliver weapons to Ukraine's military.
I support the EU and NATO membership of Ukraine.
[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5684 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: can I set user-mail-address differently for each group?
2025-03-08 7:21 ` Uwe Brauer
@ 2025-03-10 3:30 ` Husain Alshehhi
2025-03-11 7:47 ` [SOLVED] (was: can I set user-mail-address differently for each group?) Uwe Brauer
1 sibling, 0 replies; 6+ messages in thread
From: Husain Alshehhi @ 2025-03-10 3:30 UTC (permalink / raw)
To: ding
Uwe Brauer <oub@mat.ucm.es> writes:
> I enter on of the WorkMail groups and run describe-variable
> user-mail-address and see
> user1@gmail.com
> but *not* user2@company.com
Won't gnus-posting-style only work when you compose a reply, not when
you view messages?
> Why is this important?
>
> Well as I wrote in the other gnus mailing list and on email dev, I now
> use a function that checks if your address (as controlled by
> user-mail-address, is in the To or CC field in order to check that you
> have not be on the BCC and can run in potentially embarrassing
> situation.
My guess: the check-bcc-gnus-article-followup-with-original runs before
the gnus-posting-style sets the attributes. First, verify that that
gnus-posting-style actually sets the values correctly, and then see if
you can run check-bcc-gnus-article-followup-with-original after the
attribute is set.
Alternatively, as a workaround, check whether any of the
user-mail-address you own are in the bcc or not, and alert based on
that.
--
Husain
^ permalink raw reply [flat|nested] 6+ messages in thread
* [SOLVED] (was: can I set user-mail-address differently for each group?)
2025-03-08 7:21 ` Uwe Brauer
2025-03-10 3:30 ` Husain Alshehhi
@ 2025-03-11 7:47 ` Uwe Brauer
2025-03-12 11:55 ` [SOLVED] Alberto Luaces
1 sibling, 1 reply; 6+ messages in thread
From: Uwe Brauer @ 2025-03-11 7:47 UTC (permalink / raw)
To: ding
[-- Attachment #1: Type: text/plain, Size: 1015 bytes --]
> What I tried to say is this:
> I have
> (setq gnus-posting-styles
> '(("nnimap\\+UCMgmail.*"
> (address "user1@gmail.com"))
> ("nnimap\\+WorkMail.*"
> (address "user2@company.com"))))
> I enter on of the WorkMail groups and run describe-variable
> user-mail-address and see
> user1@gmail.com
> but *not* user2@company.com
I did the following, I organized the mail of different mail servers in
Topics. Then in the «parent» topic of a specific mailserver I run «G-c»
and at the end of this setting I simply set user-mail-address to
"user1@gmail.com"
So whenever I enter a group of that topic th user-mail-address is set
locally to that variable.
And this is all I need.
Uwe Brauer
--
I strongly condemn Hamas heinous despicable pogroms/atrocities on Israel
I strongly condemn Putin's war of aggression against Ukraine.
I support to deliver weapons to Ukraine's military.
I support the EU and NATO membership of Ukraine.
[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 5684 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [SOLVED]
2025-03-11 7:47 ` [SOLVED] (was: can I set user-mail-address differently for each group?) Uwe Brauer
@ 2025-03-12 11:55 ` Alberto Luaces
0 siblings, 0 replies; 6+ messages in thread
From: Alberto Luaces @ 2025-03-12 11:55 UTC (permalink / raw)
To: ding
Uwe Brauer writes:
> I did the following, I organized the mail of different mail servers in
> Topics. Then in the «parent» topic of a specific mailserver I run «G-c»
> and at the end of this setting I simply set user-mail-address to
> "user1@gmail.com"
This is really interesting, I didn't know that topics could be
customized.
Thanks,
--
Alberto
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2025-03-12 11:55 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-03-06 16:14 can I set user-mail-address differently for each group? Uwe Brauer
2025-03-07 15:57 ` Eric S Fraga
2025-03-08 7:21 ` Uwe Brauer
2025-03-10 3:30 ` Husain Alshehhi
2025-03-11 7:47 ` [SOLVED] (was: can I set user-mail-address differently for each group?) Uwe Brauer
2025-03-12 11:55 ` [SOLVED] Alberto Luaces
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).