You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Auto-BCC means automatically adding an email-address to the BCC field when you send a mail from a certain address.
At the moment, I don't see a way of configuring alot to do this. Whether alot needs to add an address to fulfill the Auto-BCC condition should be evaluated in envelope mode, since it's agnostic of whether the mail composed is a reply, forwarded or even completely new and therefore you don't need to cover all of the possibilities of writing an email. Unfortunately, it seems to me that it not possible to access the contents of the header fields. The only part of the alot API that is exposed is the database which doesn't contain the mail yet and the UI which also doesn't help, since the the EnvelopeBuffer does not make the addresses in the header field accessible.
Do you have any ideas of how a hook could be implemented? Or is the Auto-BCC-"ability" worth a feature?
The text was updated successfully, but these errors were encountered:
We could add a 'post-open-envelope-buffer' hook..
You can access the headers of the currently composed mail via the alot.db.envelope.Envelope object at ui.current_buffer.envelope.
Envelopes should behave just like dicts.
check out branch https://github.com/pazz/alot/tree/0.3.3-feature-hooks-563, this introduces mentioned hooks.
you can fumble around with post_buffer_open hook, checking if parameter buf is instanceof EnvelopeBuffer,
and read/set its headers accordingly..
Thanks for your quick reply. I wrote a function to implement the Auto-BCC-feature:
def pre_envelope_send(ui, dbm):
ADDR = "some@mail.com"
BCC_ADDR = "mail@example.org"
from_fulladdr = ui.current_buffer.envelope.get_all("From")[0]
if ADDR in from_fulladdr:
ui.current_buffer.envelope.add("Bcc:", BCC_ADDR)
I'll have a look on the new hook once I figured out how to use github. The post_buffer_open hook is obviously a much better way of doing this, so thanks for that.
Auto-BCC means automatically adding an email-address to the BCC field when you send a mail from a certain address.
At the moment, I don't see a way of configuring alot to do this. Whether alot needs to add an address to fulfill the Auto-BCC condition should be evaluated in envelope mode, since it's agnostic of whether the mail composed is a reply, forwarded or even completely new and therefore you don't need to cover all of the possibilities of writing an email. Unfortunately, it seems to me that it not possible to access the contents of the header fields. The only part of the alot API that is exposed is the database which doesn't contain the mail yet and the UI which also doesn't help, since the the EnvelopeBuffer does not make the addresses in the header field accessible.
Do you have any ideas of how a hook could be implemented? Or is the Auto-BCC-"ability" worth a feature?
The text was updated successfully, but these errors were encountered: