akrava / gmail-tg-notifications

Simple telegram bot to forward emails from Gmail to any chat, channel or private group
https://t.me/gmail_notifications_bot
MIT License
23 stars 11 forks source link

Regex to filter alias #15

Open aditya-shri opened 2 years ago

aditya-shri commented 2 years ago

As I have setup an alias for my gmail, so this is feature request. Can new command be added which will forword emails of particular alias to bot.

Also regex for filtering alias if multiple alias is present.

akrava commented 2 years ago

Does gmail support aliases? Interesting, I'll see it. So you want to filter mails by sender, right? Because bot can filter mail by sender now, see #4 issue.

aditya-shri commented 2 years ago

No based the mail the sender sent to. So if I have multiple alias with a different domain name for the gmail then I want only those to be sent to telegram

akrava commented 2 years ago

Okay, got it. I'll implement filtering emails by filed "To" in emails, which means the receiver address. As far as there is an implemented feature for filtering by sender address (see #4) I'd want to implement your feature request in the same way as in #4. Here the short description:

Use /filter_emails command to filter incoming mails from senders email addressess. To set filter rule to block only emails from specified senders you should type such message, where on the second line there should be block word and on the third line there should be list of senders emails separeted by whitespaces. Example:

/filter_emails
block
john@example.com tom@simple.org

To set filter rule to allow only emails from specified senders you should type such message, where on the second line there should be allow word and on the third line there should be list of senders emails separeted by whitespaces. Example:

/filter_emails
allow
john@example.com tom@simple.org

So I'd want to use a list of emails instead of regex. I just think that list of emails will be more clear for common users, rather than regex. But if regex is more preferable way, let me know about it.