3 Commits
0.3.1 ... 0.3.2

Author SHA1 Message Date
1c7dd7e44d Refind check for existing alias on server and in db 2023-11-09 12:02:11 +01:00
967390ddfa Update README.md 2023-10-03 10:24:33 +02:00
53ecb4302a Update README.md 2023-10-03 10:20:13 +02:00
2 changed files with 4 additions and 5 deletions

View File

@@ -4,7 +4,7 @@ _malias_ is a helper for mailcow instances. You can create, delete, search and l
## Installation
Download the latest release from https://gitlab.pm/rune/malias/releases. Unzip and move to a folder in you path (ease of use). I also recommend rename the file ```malias.py``` to just ```malias``` and make the file executable with ```chmod +x malias```. To install required python modules run ```pip3 install -r requirements.txt```
Download the latest release from [https://gitlab.pm/rune/malias/releases](https://iurl.no/release). Unzip and move to a folder in you path (ease of use). I also recommend rename the file ```malias.py``` to just ```malias``` and make the file executable with ```chmod +x malias```. To install required python modules run ```pip3 install -r requirements.txt```
## Usage

View File

@@ -29,7 +29,7 @@ database = filepath.joinpath('malias.db')
logfile = filepath.joinpath('malias.log')
Path(filepath).mkdir(parents=True, exist_ok=True)
logging.basicConfig(filename=logfile,level=logging.INFO,format='%(message)s')
app_version = '0.3.1'
app_version = '0.3.2'
def get_latest_release():
@@ -116,7 +116,6 @@ def get_settings(kind):
def get_api():
latest_release = get_latest_release()
cursor = conn.cursor()
cursor.execute('SELECT api FROM apikey')
apikey = cursor.fetchone()[0]
@@ -299,11 +298,11 @@ def checklist(alias):
remoteData = json.loads(remote)
i = 0
for search in remoteData:
if alias in remoteData[i]['address'] or alias in remoteData[i]['goto']:
if alias == remoteData[i]['address'] or alias == remoteData[i]['goto']:
alias_exist = True
i=i+1
cursor = conn.cursor()
cursor.execute('SELECT count(*) FROM aliases where alias like ? or goto like ?', (alias,alias,))
cursor.execute('SELECT count(*) FROM aliases where alias == ? or goto == ?', (alias,alias,))
count = cursor.fetchone()[0]
if count >= 1 :
alias_exist = True