aboutsummaryrefslogtreecommitdiff
path: root/smlmp/common.py (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Use conn.quit() at the end of transactionsAndrew Yu2023-07-061-0/+1
|
* Use sendmail(..., message.as_bytes(policy=policy))Andrew Yu2023-07-061-1/+1
|
* Change Python email.policy optionsAndrew Yu2023-07-061-1/+1
|
* Fix programming errorsAndrew Yu2023-07-031-3/+5
|
* Don't import sqlite3 - it's unusedAndrew Yu2023-07-021-1/+0
|
* FormattingAndrew Yu2023-07-021-1/+3
|
* Import sqlite3Andrew Yu2023-07-011-0/+1
|
* Horrible attempt at file lockingAndrew Yu2023-07-021-6/+31
|
* Bugfix: Fail when /etc/smlmp.conf exists but is unreadableAndrew Yu2023-07-021-3/+1
| | | | | | | | | Previous version simply checks for existence of /etc/smlmp.conf, and if it exists, uses config.read on it, which will silently fail if the file can't be read but exists, i.e. with wrong permissions. Since config.read returns a list of files that it successfully read, we can check if it returned something; if not, the config file wasn't read, and we enter a fail condition.
* Complain about missing configuration filesAndrew Yu2023-07-021-1/+5
|
* Bugfix: make report_error use exc's class nameAndrew Yu2023-07-021-2/+2
|
* Large commit (see commit details)Andrew Yu2023-07-021-0/+164
- Put things in the correct form of a Python package, with an "smlmp" directory that contains an empty "__init__".py and the "mda" and "common" modules. Change imports to reflect this change. - - Instead of importing a Python file to use as a configuration file, we now read /etc/smlmp.conf, which is an ini file parsed through configparser. An example smlmp.conf.example is provided with detailed comments documenting how each configuration option could be used. - Email addresses and related parts in the configuration and incoming emails are lower-cased, as email is a case insensitive protocol and we shall thus make case insensitive comparisons, simply by internally handling everything lowercase. - Instead of only providing an exception's arguments (exc.args) when sending exception reports, send the full traceback. (This causes the entire program to requires Python 3.10 or later.) In addition to emailing the administrator when a non-sender's-fault exception occurs, tell the sender that their email failed to deliver.