Re: [unixbhas...@gmail.com: Notify-send pop up for specific mails]
I am not a Lua expert but imapfilter has its limitations. There are situations where imafilter can not parse headers properly and emails from the mailing lists are not properly sorted. If I was about to re-do my email delivery flow, I would probably avoid imapfilter do to detailed work completely. On the other hand, Lua is pretty straight forward language so if there are any objections (like mine for instance) you can still fix things at home. I guess I am just too lazy to do that :-). On Sun, Feb 14, 2021 at 06:16:48PM +0100, Angel M Alganza wrote: On Sun, Feb 14, 2021 at 04:36:07PM +, Sam Kuper wrote: https://pypi.org/project/cs.app.mailfiler/ which monitors multiple Maildirs for new messages, and files them according to per-folder rules. Nice. I've bookmarked this as a procmail alternative :) Have a look at imapfilter, too. It does the same but through the IMAP protocol in the server. Then you can synchronize to your local folder structure with mbsync, as discussed in another thread. They work very nicely together. Cheers, Ángel -- Daniel Ciprus .:|:.:|:. CONSULTING ENGINEER.CUSTOMER DELIVERY Cisco Systems Inc. dcip...@cisco.com tel: +1-703-484-0205 mob: +1-540-223-7098 signature.asc Description: PGP signature
Re: Resolved!![unixbhas...@gmail.com: Notify-send pop up for specific mails]
On 09:36 Fri 12 Feb 2021, Kevin J. McCarthy wrote: On Fri, Feb 12, 2021 at 09:59:38AM +0530, Bhaskar Chowdhury wrote: The problem it pops up for every new mail arrive. All I need to know about when I am in the TO or CC field or received mail from some specific individuals, then only the notify send pop up. Any clue? I saw some rexexes but couldn't figure out how to apply them. More over is there any "in-built" way of getting that?? No, $new_mail_command doesn't provide anything sophisticated. It operates at the same time as $beep_new - running when Mutt detects new mail in the open mailbox or any of the monitored mailboxes. For more sophisticated notification, you'll need to use another tool. Well, after bit internet searching I have stumbled upon on this page and it solved what I was looking for. http://enricorossi.org/blog/2016/mail_notify_with_procmail/ ...I do have mutt+fetchmail+procmail setup..just take the essence out of those.. Thanks, Bhaskar -- Kevin J. McCarthy GPG Fingerprint: 8975 A9B3 3AA3 7910 385C 5308 ADEF 7684 8031 6BDA signature.asc Description: PGP signature
Re: [unixbhas...@gmail.com: Notify-send pop up for specific mails]
On Sun, Feb 14, 2021 at 04:36:07PM +, Sam Kuper wrote: https://pypi.org/project/cs.app.mailfiler/ which monitors multiple Maildirs for new messages, and files them according to per-folder rules. Nice. I've bookmarked this as a procmail alternative :) Have a look at imapfilter, too. It does the same but through the IMAP protocol in the server. Then you can synchronize to your local folder structure with mbsync, as discussed in another thread. They work very nicely together. Cheers, Ángel
Re: [unixbhas...@gmail.com: Notify-send pop up for specific mails]
On Sun, Feb 14, 2021 at 11:24:59AM +1100, Cameron Simpson wrote: > On 13Feb2021 19:29, Bhaskar Chowdhury wrote: >> How?? Show us...share with the people .. > > I collect my email with getmail, deliver to my local "+spool" mail > folder, a Maildir (~/mail/spool). > > I filter my messages using mailfer: > > https://pypi.org/project/cs.app.mailfiler/ > > which monitors multiple Maildirs for new messages, and files them > according to per-folder rules. Nice. I've bookmarked this as a procmail alternative :) > The desktop popup comes from my "alert"r script: > > https://hg.sr.ht/~cameron-simpson/css/browse/bin/alert?rev=tip > > That will issue alerts to a variety of places depending on envvars and > options particularly my dlog (a timestamped text log I use for > reviewing things, since my invoicing system is a ghastly hack held > together with string) and to the desktop. > > The "desktop alert" part of that script is in the $to_desktop > if-statement at the bottom. Presently I'm on a Mac and use the > "terminal-notifier" command to issue a normal Mac Notification popup. > I'd be using whatever Linux desktop notification command line were > suitable were I on Linux. > > I presume there _is_ a standard way to issue a popup alert on Linux > systems these days? I used to just always run a permanent very short > full-width terminal across the top of the screen tailing a log file > myself, crude but effective. The same terminal also accepted commands > if you typed them. This is an interesting bunch of workarounds. Again, thank you for sharing :) -- A: When it messes up the order in which people normally read text. Q: When is top-posting a bad thing? () ASCII ribbon campaign. Please avoid HTML emails & proprietary /\ file formats. (Why? See e.g. https://v.gd/jrmGbS ). Thank you.
Re: [unixbhas...@gmail.com: Notify-send pop up for specific mails]
On 14Feb2021 06:48, Bhaskar Chowdhury wrote: >.but depending too much of other software makes it fragile and >prone to >error and least to say it is complex. Aye. But you asked. You can see from the opening comment of the alert script: # Write a possibly-colourised string to the alert log. that it has evolved a bit over time. >Ordinary mortals(i.e me) who has less technical bend of mind, will run >away from this. The core point here is the flow: - getmail => folder - mailfiler to file messages from the folder - some messages run the alert script, which contains whatever platform-specific popup incantation is required All the rest has to do with my environment. If you're using fetchmail+procmail, for example, you just need an "alert" rule at the right points in your rules. >I do understand simplicity can not achieved without by digging and >getting into the rabbit >hole...again but...how many are willing(including me, I am an truest sense lazy >person) ... You can use all my code of course. I'm well aware that even taking what's needed (==> implied, the box of tissues effect) and putting it into your own setup is not necessarily trivial. >Not to deny, I do fall on fetchmail , procmail et al along with >mutt(the love for something do wonder) , but more to it ...nope... > >>The "desktop alert" part of that script is in the $to_desktop >>if-statement at the bottom. Presently I'm on a Mac and use the >>"terminal-notifier" command to issue a normal Mac Notification popup. >>I'd be using whatever Linux desktop notification command line were >>suitable were I on Linux. >> >notify-send is the "lightest" and "efficient" way of doing it on Linux. Thanks. I'll look it up and stick it in. The whole point of the script is to remove platform "how do I alert" from everything else. >Finally, I don't have the ability to create something native(think of >it as >excuse not to put effort,if you like :) ) OR we don't want mutt to be >convoluted >with some "airy-fairy" stuff. > >I am happy with it's limitation(partly because of my lack of understanding and >as mentioned ability to extends it,being using it for long time >though). Incremental change. Start with something basic. Modify it to better fit what you actually desire as its shortcomings become apparent. That's what I do. I've just been doing it a bit longer. For example, your own "alert" script might just directly invoke notify-send and do nothing else. Mine started by writing coloured alerts to a text file, nothing else. Then stick your own "alert" in your rules, and modify alert separately without needing to hack outside the script. Cheers, Cameron Simpson
Re: [unixbhas...@gmail.com: Notify-send pop up for specific mails]
On 11:24 Sun 14 Feb 2021, Cameron Simpson wrote: On 13Feb2021 19:29, Bhaskar Chowdhury wrote: On 07:40 Sat 13 Feb 2021, Cameron Simpson wrote: On 12Feb2021 09:36, Kevin J. McCarthy wrote: On Fri, Feb 12, 2021 at 09:59:38AM +0530, Bhaskar Chowdhury wrote: The problem it pops up for every new mail arrive. [...] For more sophisticated notification, you'll need to use another tool. For xample, my own new mail desktop notifications happen from my mail filer, not from mutt. This has the advantage that they still happen when mutt is closed (if you can call that an advantage). How?? Show us...share with the people .. Ok I collect my email with getmail, deliver to my local "+spool" mail folder, a Maildir (~/mail/spool). I filter my messages using mailfer: https://pypi.org/project/cs.app.mailfiler/ which monitors multiple Maildirs for new messages, and files them according to per-folder rules. So it watches spool, spool-in, spool-out, spool-to-phone etc. "spool" winnows some spam and lets the rest through to spool-in. spool-in files to my inbox, various mailing list folders etc. Anything not matched lands in +UNKNOWN. It is mostly spam. spool-out is what mutt's $record is set to - mutt saves sent mail there and mailfiler refiles it. spool-to-phone just has a rule to forward to my phone's email account. So, alerts. Mailfiler rules are usually quite simple, like this: !me Work from:(ALERT) which says to match messages from addresses in the group "alert" and do 2 things: - "me" save a copy in my +me folder, my "priority inbox" - "!" run the $ALERT command with the message and save a copy to the targets named in $ALERT_TARGETS They're set like this: ALERT=alert ALERT_TARGETS="F,spool-to-phone" So $ALERT runs my "alert" command, a script. Details below. $ALERT_TARGETS says: - "F" (F)lag the message (same as mutt's (F)lag command) so that it is highlighted in mutt's index - "spool-to-phone" save a copy in my +spool-to-phone folder, which mailfiler also monitors (its rules say forward a copy to my phone's email account) The desktop popup comes from my "alert"r script: https://hg.sr.ht/~cameron-simpson/css/browse/bin/alert?rev=tip That will issue alerts to a variety of places depending on envvars and options particularly my dlog (a timestamped text log I use for reviewing things, since my invoicing system is a ghastly hack held together with string) and to the desktop. Thanks! .but depending too much of other software makes it fragile and prone to error and least to say it is complex. Ordinary mortals(i.e me) who has less technical bend of mind, will run away from this. I do understand simplicity can not achieved without by digging and getting into the rabbit hole...again but...how many are willing(including me, I am an truest sense lazy person) ... Anyway, your manipulation to get the simple task done very commanding ,alas! If I could follow. Not to deny, I do fall on fetchmail , procmail et al along with mutt(the love for something do wonder) , but more to it ...nope... The "desktop alert" part of that script is in the $to_desktop if-statement at the bottom. Presently I'm on a Mac and use the "terminal-notifier" command to issue a normal Mac Notification popup. I'd be using whatever Linux desktop notification command line were suitable were I on Linux. notify-send is the "lightest" and "efficient" way of doing it on Linux. I presume there _is_ a standard way to issue a popup alert on Linux systems these days? I used to just always run a permanent very short full-width terminal across the top of the screen tailing a log file myself, crude but effective. The same terminal also accepted commands if you typed them. Anyway, that is how this is hooked into my email. Suggestions for current Linux or other UNIX desktop popup command line tools welcomed. As mentioned use notify-send. Finally, I don't have the ability to create something native(think of it as excuse not to put effort,if you like :) ) OR we don't want mutt to be convoluted with some "airy-fairy" stuff. I am happy with it's limitation(partly because of my lack of understanding and as mentioned ability to extends it,being using it for long time though). Cheers, Cameron Simpson signature.asc Description: PGP signature
Re: [unixbhas...@gmail.com: Notify-send pop up for specific mails]
On 13Feb2021 19:29, Bhaskar Chowdhury wrote: >On 07:40 Sat 13 Feb 2021, Cameron Simpson wrote: >>On 12Feb2021 09:36, Kevin J. McCarthy wrote: >>>On Fri, Feb 12, 2021 at 09:59:38AM +0530, Bhaskar Chowdhury wrote: The problem it pops up for every new mail arrive. [...] >>>For more sophisticated notification, you'll need to use another tool. >> >>For xample, my own new mail desktop notifications happen from my mail >>filer, not from mutt. This has the advantage that they still happen when >>mutt is closed (if you can call that an advantage). >> >How?? Show us...share with the people .. Ok I collect my email with getmail, deliver to my local "+spool" mail folder, a Maildir (~/mail/spool). I filter my messages using mailfer: https://pypi.org/project/cs.app.mailfiler/ which monitors multiple Maildirs for new messages, and files them according to per-folder rules. So it watches spool, spool-in, spool-out, spool-to-phone etc. "spool" winnows some spam and lets the rest through to spool-in. spool-in files to my inbox, various mailing list folders etc. Anything not matched lands in +UNKNOWN. It is mostly spam. spool-out is what mutt's $record is set to - mutt saves sent mail there and mailfiler refiles it. spool-to-phone just has a rule to forward to my phone's email account. So, alerts. Mailfiler rules are usually quite simple, like this: !me Work from:(ALERT) which says to match messages from addresses in the group "alert" and do 2 things: - "me" save a copy in my +me folder, my "priority inbox" - "!" run the $ALERT command with the message and save a copy to the targets named in $ALERT_TARGETS They're set like this: ALERT=alert ALERT_TARGETS="F,spool-to-phone" So $ALERT runs my "alert" command, a script. Details below. $ALERT_TARGETS says: - "F" (F)lag the message (same as mutt's (F)lag command) so that it is highlighted in mutt's index - "spool-to-phone" save a copy in my +spool-to-phone folder, which mailfiler also monitors (its rules say forward a copy to my phone's email account) The desktop popup comes from my "alert"r script: https://hg.sr.ht/~cameron-simpson/css/browse/bin/alert?rev=tip That will issue alerts to a variety of places depending on envvars and options particularly my dlog (a timestamped text log I use for reviewing things, since my invoicing system is a ghastly hack held together with string) and to the desktop. The "desktop alert" part of that script is in the $to_desktop if-statement at the bottom. Presently I'm on a Mac and use the "terminal-notifier" command to issue a normal Mac Notification popup. I'd be using whatever Linux desktop notification command line were suitable were I on Linux. I presume there _is_ a standard way to issue a popup alert on Linux systems these days? I used to just always run a permanent very short full-width terminal across the top of the screen tailing a log file myself, crude but effective. The same terminal also accepted commands if you typed them. Anyway, that is how this is hooked into my email. Suggestions for current Linux or other UNIX desktop popup command line tools welcomed. Cheers, Cameron Simpson
Re: [unixbhas...@gmail.com: Notify-send pop up for specific mails]
On 07:40 Sat 13 Feb 2021, Cameron Simpson wrote: On 12Feb2021 09:36, Kevin J. McCarthy wrote: On Fri, Feb 12, 2021 at 09:59:38AM +0530, Bhaskar Chowdhury wrote: The problem it pops up for every new mail arrive. [...] For more sophisticated notification, you'll need to use another tool. For xample, my own new mail desktop notifications happen from my mail filer, not from mutt. This has the advantage that they still happen when mutt is closed (if you can call that an advantage). How?? Show us...share with the people .. Cheers, Cameron Simpson signature.asc Description: PGP signature
Re: [unixbhas...@gmail.com: Notify-send pop up for specific mails]
On 12Feb2021 09:36, Kevin J. McCarthy wrote: >On Fri, Feb 12, 2021 at 09:59:38AM +0530, Bhaskar Chowdhury wrote: >>The problem it pops up for every new mail arrive. [...] >For more sophisticated notification, you'll need to use another tool. For xample, my own new mail desktop notifications happen from my mail filer, not from mutt. This has the advantage that they still happen when mutt is closed (if you can call that an advantage). Cheers, Cameron Simpson
Re: [unixbhas...@gmail.com: Notify-send pop up for specific mails]
On Fri, Feb 12, 2021 at 09:59:38AM +0530, Bhaskar Chowdhury wrote: The problem it pops up for every new mail arrive. All I need to know about when I am in the TO or CC field or received mail from some specific individuals, then only the notify send pop up. Any clue? I saw some rexexes but couldn't figure out how to apply them. More over is there any "in-built" way of getting that?? No, $new_mail_command doesn't provide anything sophisticated. It operates at the same time as $beep_new - running when Mutt detects new mail in the open mailbox or any of the monitored mailboxes. For more sophisticated notification, you'll need to use another tool. -- Kevin J. McCarthy GPG Fingerprint: 8975 A9B3 3AA3 7910 385C 5308 ADEF 7684 8031 6BDA signature.asc Description: PGP signature
[unixbhas...@gmail.com: Notify-send pop up for specific mails]
- Forwarded message from Bhaskar Chowdhury - Kindly throw some light. Date: Fri, 12 Feb 2021 09:41:28 +0530 From: Bhaskar Chowdhury To: ke...@8t8.us Subject: Notify-send pop up for specific mails Hey Kevin, I was wondering and hovering through the manual pages ,it failed to come to eyes, so asking you .. I have a line like this in my muttrc : set new_mail_command="notify-send --icon='/home/bhaskar/Pictures/neomutt.png' \ 1 'New Emails' '%n new messages, %u unread.' &" The problem it pops up for every new mail arrive. All I need to know about when I am in the TO or CC field or received mail from some specific individuals, then only the notify send pop up. Any clue? I saw some rexexes but couldn't figure out how to apply them. More over is there any "in-built" way of getting that?? Thanks, Bhaskar - End forwarded message - signature.asc Description: PGP signature