You are not logged in.
The first script watches for new mails and executes the other one when a new mail is found.
#!/bin/sh
MAILDIR1=$HOME/Mail/Fastmail/INBOX/new
echo "Watching $MAILDIR1"
while MAILNAME1=$(inotifywait -qe MOVED_TO --format '%f' $MAILDIR1)
do
echo $MAILNAME1
mailpop $MAILDIR1/$MAILNAME1
done#!/bin/bash
from=`formail -X From: < $1`
sub=`formail -X Subject: < $1`
# tweaks < > are special
from=${from//</\(}
from=${from//>/\)}
from=${from//&/\.}
sub=${sub//</\(}
sub=${sub//>/\)}
sub=${sub//&/\.}
sub=${sub:0:200}
from=${from:0:75}
#TM=2000
/usr/bin/notify-send -u normal "$from" "$sub" -i "/home/johan/.icons/Dunst/mail.png"The output of the notification is:
From: <Name> (<adress>)
Subject: <Subject>1. I can't figure out of how to remove everything but the "<Name>" and the "<Subject>"?
2. My second issue is that the output gets borked when the subject contains any of the letters å, ä or ö. The word "Bekräftelse" turns into "=?UTF-8?Q?Bekr=C3=A4ftelse?=". What's up with that?
Thank you for your time. ![]()
Offline
fram=$(printf "$from" | awk '{print $2}')
subj=$(printf "$sub" | awk '{print $2}')Offline
fram=$(printf "$from" | awk '{print $2}') subj=$(printf "$sub" | awk '{print $2}')
Thanks! I didn't think of that. ![]()
Offline