Skip to content

Commit

Permalink
no bash escape to trigger pilerimport
Browse files Browse the repository at this point in the history
Co-authored-by: Davide Principi <[email protected]>
  • Loading branch information
stephdl and DavidePrincipi authored Apr 29, 2024
1 parent 45af344 commit 06e228c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions imageroot/bin/import-emails
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ if providers:
print(f"### Importing {user} to {os.environ['MODULE_ID']}", file=sys.stderr)

subprocess.run([
'/usr/bin/podman', 'exec', 'piler-app', '/bin/bash', '-c',
f"su - piler;cd /var/piler/imap;/usr/bin/pilerimport -i {ip_address} -u {user}*vmail -p {password} -P 993"
'/usr/bin/podman', 'exec', '-w', '/var/piler/imap', '-u', 'piler', 'piler-app',
'/usr/bin/pilerimport', '-i', ip_address, '-u', f'{user}*vmail', '-p', password, '-P', '993'
])
except Exception as e:
print(f"### Error to import {user} to {os.environ['MODULE_ID']}: {e}", file=sys.stderr)
Expand Down

0 comments on commit 06e228c

Please sign in to comment.