First of all: Thanks for all the work!
We have a config that has a defined default profile for mail, mattermost and filters.
Then there is another specific profile that just defines a deviant filter set to filter for another "to" address.
Mail to targetmailA@mail.server is received and posted to #targetchannelA,
however mail to targetmailB@mail.server is just shown as
mail2most | time="2024-02-06T07:22:50Z" level=debug msg="processing message" subject="Testmail" uid=18
mail2most | time="2024-02-06T07:22:50Z" level=debug msg="InlineHeader type is" type="text/plain; charset=UTF-8; format=flowed"
mail2most | time="2024-02-06T07:22:50Z" level=debug msg="message not passing the filter" subject="Testmail" uid=18
mail2most | time="2024-02-06T07:22:50Z" level=debug msg=mailserver server="mail.server:993" status=connected
mail2most | time="2024-02-06T07:22:50Z" level=debug msg="checking folders" folders="[INBOX]"
Even though there is no subject filter set at all.
Please see the config attached:
[General]
# File contains the default file location where mail2most stores its data
File = "data.json"
# RunAsService true:
# check regularly using TimeInterval for new emails
# false:
# just check once when u start - requires to restart mail2most for checking again
RunAsService = true
# global time interval for checking mails in seconds
TimeInterval = 10
[Logging]
# Loglevel = ["info", "debug", "error"]
Loglevel = "debug"
# LogType = ["json", "text"]
LogType = "text"
# Output = ["stdout", "logfile"]
Output = "stdout"
# Logfile is used if Output is set to "logfile"
Logfile = "mail2most.log"
# The DefaultProfile defines a set of defaults used in Profiles that do not define the specific section
# if you create an empty Profile the DefaultProfile is used
# if a Profile contains the section Mail, Mattermost or Filter this section will overwrite the sections from the Default Profile
# at least an empty Profile has to be created for the DefaultProfile to be processed
# only defining the DefaultProfile without having a [Profile] defined will not work
[DefaultProfile]
# The DefaultProfile.Mail defines a default mailserver
# if your Profile hast no defined mailserver this information will be used
[DefaultProfile.Mail]
ImapServer = "mail.server:993"
Username = "mail@mail.server"
Password = "supersecretpw"
# ReadOnly does not change any flags on emails
# Mail2Most saves the information about already send emails on its own
ReadOnly = false
# ImapTLS allows you to enable / disable tls encryption whithin the imap protocol (disable when using STARTLS)
ImapTLS = true
# StartTLS allows you to enable / disable tls encryption whithin the imap protocol using STARTTLS
StartTLS = true
# VerifyTLS disables certificate validation (only disable for self-signed certs)
VerifyTLS = true
# Limit allows you to limit the amount of emails read from the mail server, if set to 0 its unlimited
Limit = 0
# GenerateLocalUIDs creates a uid from message data instead of fetching the uid from the server
# this can be helpfull when getting Invalid messageset errors since some DoveCot mailserver did not implement IMAP correctly
GenerateLocalUIDs = false
# The DefaultProfile.Mattermost defines a default mattermost server
# if your Profile has no defined mattermost server this information will be used
[DefaultProfile.Mattermost]
URL = "https://mattermost.server"
Team = "my-team"
# you can define username password
Username = "m2m-mattermost-user"
Password = "extremelysecretpass"
# or accesstoken
# Channels contains all channels to post your messages
# if no channel is defined nothing is posted into a channel
Channels = ["#targetchannelA"]
# Users contains all users to post your message to, you can use the username or email address
# if no users are defined nothing is posted to any user
Users = ["user1","user2"]
# SubjectOnly will post only the mail subject
SubjectOnly = false
# BodyOnly will post only the mail body
BodyOnly = false
# SkipEmptyMessages - only post messages with non empty email bodys
SkipEmptyMessages = false
# StripHTML will remove all HTML tags bevor sending a msg to mattermost
StripHTML = true
# ConvertToMarkdown will convert html mails to markdown for better readability in mattermost
# if this option is set to true the StripHTML option is ignored
ConvertToMarkdown = true
# HideFrom allows you to hide the From Address in mattermost messages
HideFrom = false
# HideFromEmail true will only display the username
HideFromEmail = false
# allow posting mail attachments into mattermost
MailAttachments = true
# BodyPrefix adds a prefix to the message body e.g:
# BodyPrefix = "**This content was forwarded by Mail2Most and might be reformatted**"
BodyPrefix = ""
# BodySuffix adds a suffix to the message body e.g:
# BodySuffix = "**Disclaimer: This content was forwarded by Mail2Most and might be reformatted**"
BodySuffix = ""
# The DefaultProfile.Filter defines a default filter
# if your Profile has no defined filter this information will be used
[DefaultProfile.Filter]
# Folders filters your mails only in specific email folders
Folders = ["INBOX"]
# Unseen lets you process unseen mails only by checking the unseen mail flag
Unseen = true
# From filters for defined from addresses
From = [""]
# To filters for defined to addresses
To = ["targetmailA@mail.server"]
# Subject filters if the email subject contains one of the defined strings
#Subject = [""]
# TimeRange will only process mails that are not older than the defined time range
TimeRange = "24h"
# IgnoreMailErrorNotifications sets if Delivery Status Notifications are ignored or not
IgnoreMailErrorNotifications = true
### Profile targetchannelB
#
#[[Profile]] defines a profile, you can have as many as you want
[[Profile]]
# IgnoreDefaults lets you ignore the DefaultProfile settings and forces to set everything in the Profile
# this option should only be used if you try to overwrite a default with an empty value
# the better way is to define the value only in the profile and not in the defaults
IgnoreDefaults = false
[Profile.Mail]
[Profile.Mattermost]
Channels = ["#targetchannelB"]
#[Profile.Filter] contains all filters that are applied to your mails and overwrites the default
[Profile.Filter]
# Folders filters your mails only in specific email folders
Folders = ["INBOX"]
# Unseen lets you process unseen mails only by checking the unseen mail flag
Unseen = true
# From filters for defined from addresses
#From = [""]
# To filters for defined to addresses
To = ["targetmailB@mail.server"]
# Subject filters if the email subject contains one of the defined strings
#Subject = [""]
# TimeRange will only process mails that are not older than the defined time range
TimeRange = "24h"
# EmailErrorNotifications sets if Delivery Status Notifications are ignored or not
IgnoreMailErrorNotifications = true
We have also tried redefining complete Mail and Mattermost sections for the targetmailB Profile section, with no luck.
Is this even the right way to do it, if only the filters differ from the default profile and mail/mattermost stay the same?
Thanks in advance!
First of all: Thanks for all the work!
We have a config that has a defined default profile for mail, mattermost and filters.
Then there is another specific profile that just defines a deviant filter set to filter for another "to" address.
Mail to targetmailA@mail.server is received and posted to #targetchannelA,
however mail to targetmailB@mail.server is just shown as
mail2most | time="2024-02-06T07:22:50Z" level=debug msg="processing message" subject="Testmail" uid=18
mail2most | time="2024-02-06T07:22:50Z" level=debug msg="InlineHeader type is" type="text/plain; charset=UTF-8; format=flowed"
mail2most | time="2024-02-06T07:22:50Z" level=debug msg="message not passing the filter" subject="Testmail" uid=18
mail2most | time="2024-02-06T07:22:50Z" level=debug msg=mailserver server="mail.server:993" status=connected
mail2most | time="2024-02-06T07:22:50Z" level=debug msg="checking folders" folders="[INBOX]"
Even though there is no subject filter set at all.
Please see the config attached:
We have also tried redefining complete Mail and Mattermost sections for the targetmailB Profile section, with no luck.
Is this even the right way to do it, if only the filters differ from the default profile and mail/mattermost stay the same?
Thanks in advance!