Conditional reply to e-mail [migrated] - email

This question was migrated from Stack Overflow because it can be answered on Emacs Stack Exchange.
Migrated last month.
I use notmuch in emacs for e-mail and I love it, but I need help in customizing how it handles replies.
I use two e-mail addresses, a personal one and a work one. Most of the time, when I get work e-mail my e-mail address is in the header, and the automatic reply functionality works fine. However, often a work e-mail will come in without my address in the header: for instance, through an Outlook mailing list. In this case, the reply function defaults to my personal e-mail address, which I do not want.
I've already created a function that allows me to change the sender address with a keybinding, but in the moment it is easy to forget to do this. A more seamless experience would greatly improve my life. How can I customize the reply functionality, perhaps conditional on tags or on whether the sender's address contains my work domain?

Related

Surefire way to know if an email is in reply to an email my mail client sent

I'm looking for a way to know definitively if an email I receive is in response to a specific email I sent. I manually set the Message-Id of the outgoing message using make_msgid, store this value, and then check the In-Reply-To of an incoming email to determine if it is equal to the original Message-Id I sent.
This approach is basically what is suggested here in this very helpful answer by Mohammad Eghlima.
But I wonder if this approach is "foolproof" and if there is a better way to accomplish this? For example if there are some clients other than outlook, gmail etc. that do not follow this convention of setting In-Reply-To to the Message-Id of the original mail for replies, or if they set their own Message-Id for some reason (ex. Gmail does this if it determines the existing message id doesn't follow RFC standards)?
I've seen some other answers mention other potential methods to accomplish what I'm trying to do - for example, here but most of these questions/answers are from 10 years ago so I'm wondering if there is a better way to accomplish this now.
No, nothing is entirely foolproof. Junior PHP programmers write new email-sending code every day and none of it conforms to any particular set of conventions or RFCs. And then there's Microsoft and Google ... Oh, you are already familiar with them.
There have been no significant developments in email standardization on this particular front in the last decade, so advice from 10 years ago is by and large still relevant.
If anything, the field has been polarized by Microsoft and Google plunging ahead to "innovate" in various aspects of what may charitably be characterized as usability improvements over traditional email, but the motivation has often been to silo in users to prefer or be forced to use their solutions, not standardize anything.
(The efforts to improve e.g. email security through DMARC etc has been better coordinated and standardized.)
The post you link to basically summarizes the information from D. J. Bernstein's excellent email reference resource https://cr.yp.to/mail.html; see in particular the threading conventions at https://cr.yp.to/immhf/thread.html

Processing e-mail in Odoo 11 without previous threads – is this possible?

This Odoo company we're working with basically sends a lot of e-mail. One e-mail thread can turn into 100+ e-mails with different people brought into the conversation (CC'd) at different times. Due to the complexity of their e-mail management, they want to use their Gmail interface (Google Hosted) and CC an e-mail into odoo and they want it to get tracked in a thread. I've basically already done that... they have an e-mail like odoo+res.partner-432#domain.com (although it's hashed to not be easily readable) - they CC this and the full body thread gets included in chatter (mail.message) under respective model / id.
The challenge with this: the chatter messages can get huge very fast, due to their e-mail messages (because each e-mail includes main reply, and all previous history on thread). I've looked into some systems that have a "reply above this line" - and it just takes the latest message. And in those systems, eg. ticketing systems such as Zendesk, help scout, I believe the teams are using the ticketing system (not a gmail) and thus there is much more control over the inbox and incoming email (not to mention, those e-mails are usually 1-to-1, not including groups).
My questions:
Is there any other workaround that you see here to have odoo pull in only the last e-mail reply and not the full e-mail thread? I could probably build something like this: https://github.com/zapier/email-reply-parser - and hook it into odoos e-mail parsing, but that works on text format e-mails only (not HTML)... only. So it's not bulletproof, and I'm not sure it's worth it.
Even if this client DID use odoo 100%, I still don't think it would be possible to get it to work the way they want without major customizations (eg. Odoo's default behavior is to include all past e-mail threads)
I'm curious if anyone here see's any other solutions, otherwise – I doubt there is something here I haven't seen. :) (But very open to be proven incorrect!)

Giving an automatic email reply based on reading the subject line

I have been toying with this idea for few days now.
What I want to do is: I have a powershell script which sends mails mentioning status of some links which I am monitoring.
I wanted to add its functionality. I wanted to add a feature like, when a user sends the mail to a particular email ID with a subject line like "Status", it should send the user, the result of the powershell script.
From my perspective, an IMAP configuration needs to be done in the script. But just wanted opinion if this idea is feasible or not. I have IMAP configured in my organization. I just need to learn how to configure the script with IMAP settings so that the script can send automatic replies after reading the subject line.
IF this is possible from any other technology, then I would like to learn that as well.
EDIT:
Its not a duplicate, because here I want to know pretty basic stuff, like if its possible, and if it is, then what are the technology I need to use to make it possible. Let me know your suggestions.
I saw the duplicate question as well; well it hasn't been properly answered and the links given don't work.
Please help me here.
Thanks in advance!

GNU mailman - questions and testing

I feel really stupid asking this question, but I recently signed up to a GNU mailman list for the first time ever and can't quite figure out how to interact with it properly. I can't find any documentation anywhere on how to participate as a list member. In particular, I am trying to figure out how to make my responses nest properly when replying from a Gmail account. Through some sparse info I've gleaned, I found that the "In-Reply-To" header is supposedly the one that determines where your message nests on the list.
So, I posted a new message to the list, and when somebody replied to me, I received a copy in my Gmail in addition to the post on the list archives page. I replied to the Gmail and addressed it back to the main list address. After sending, I examined the Gmail headers, and In-Reply-To was indeed set to the Message-ID of the person who had replied to me, so I thought my response would be nested under his. Unfortunately, it was not. It was nested underneath my own OP, next to his. I can't figure out why, except that there is another header References, which in my response, included two Message-ID's, both the one from my original post, and the one from the first response.
None of this stuff is intuitive at all or explained anywhere that I can find, and Gmail of course gives you no control of email headers... but I don't want to switch to an entirely new mail service just to interact with a Mailman list. Nor do I want to spam a real list with a bunch of stupid test messages of me figuring out what is probably supposed to be a very simple system. Does anybody know of a test instance of mailman somewhere that I can send a few mails to just so get this all sorted out? I found what appeared to be a couple, but none of them were actually accepting mail.

Gmail forwarding loop, gmail

I assure you this is a programming question: someone asked about this same problem before and was told that this is not a programming question, but that is because he did not phrase it as such. Please read my full description.
The Problem: I just graduated from college and want to transfer all my emails in my college account (henceforth "account O" for old) to a regular gmail account (henceforth N). Note that account O is powered by Gmail, and is effectively a gmail account.
Gmail has a suggested means for doing this: POP/IMAP. But, this did not work for me, and it has failed many others (see here); upon trying to sync by IMAP, my account N is bombarded with messages reading "A message in your account was listed with an invalid size. It has been left on the server."
It would seem natural to try to mass-forward all of one's emails. But google does not allow such an action. Other people say to use a filter, because filtered items can be mass-forwarded. But you can't filter by date, and there is no way to get the filter to select everything.
My workaround, and where I need more experience programmer advice: I want to run a program which signs into my account O and finds the first email I ever received. Then, I want to begin a for loop which runs through all of my emails where the body of the loop does the following: a) click the forward button b) type in my account N email address c) hit "next", so that the 2nd email I ever received shows up, and so on.
This would accomplish my task.
Unfortunately, all I have under my belt is a semester of C++, some knowledge of statistical
scripting languages (ie R), and VBA. I don't know how to make code interact with the internet. Could someone tell me a language and how to do this?
Thanks,
Ryan
While you are correct in saying that the approach you want to take to this problem makes it a programming question, Ben makes a valid point that your question probably does not confirm to site guidelines.
To answer your problem, pretty much any language should be able to handle this, as nearly all have libraries for working with SMTP. However, this is most likely overkill and I would not suggest programming your own solution when other alternatives exist.
If you receive that message when trying to import mail (or add an account) in gmail's web interface, you should try to import them using an actual mail client such as Thunderbird, a procedure for which is described here. If you have already tried that but still encounter errors, you can use GMail Loader to read archive emails from a variety of formats and mass forward them to a gmail address.
Yes it is possible to create a filter that selects everything.
Simply put your email in the "to" field.
If you have other accounts forwarding to O, make a filter for them too (or us the "OR" keyword).