[fix] Systemd User Unit
This commit is contained in:
parent
c977a63252
commit
a091051069
2 changed files with 43 additions and 18 deletions
59
README.md
59
README.md
|
@ -2,6 +2,48 @@
|
||||||
|
|
||||||
Convert MMSd MMS file to mbox.
|
Convert MMSd MMS file to mbox.
|
||||||
|
|
||||||
|
## installation
|
||||||
|
|
||||||
|
### dependancy
|
||||||
|
|
||||||
|
- python3
|
||||||
|
- python3-watchdog (apt install python3-watchdog)
|
||||||
|
- python-messaging (https://www.github.com/davegermiquet/python-messaging.git)
|
||||||
|
- marrow.mailer (pip install marrow.mailer)
|
||||||
|
|
||||||
|
### setup
|
||||||
|
Install the dependancy and mms2mail:
|
||||||
|
```
|
||||||
|
sudo apt install python3-watchdog # pip install --user watchdog
|
||||||
|
pip install --user marrow-mailer
|
||||||
|
|
||||||
|
git clone https://www.github.com/davegermiquet/python-messaging.git
|
||||||
|
cd python-messaging
|
||||||
|
python3 setup.py install --user
|
||||||
|
|
||||||
|
mkdir -p ~/.local/bin
|
||||||
|
cp mms2mail ~/.local/bin
|
||||||
|
```
|
||||||
|
To enable the daemon mode in systemd user :
|
||||||
|
```
|
||||||
|
mkdir -p ~/.config/systemd/user
|
||||||
|
cp mms2mail.service ~/.config/systemd/user/
|
||||||
|
systemctl --user daemon-reload
|
||||||
|
systemctl --user enable mms2mail
|
||||||
|
systemctl --user start mms2mail
|
||||||
|
```
|
||||||
|
|
||||||
|
### config
|
||||||
|
An optional configuration file can be put in the home folder : ```$HOME/.mms/modemmanager/mms2mail.ini```. The default value are :
|
||||||
|
|
||||||
|
```
|
||||||
|
[mail]
|
||||||
|
mailbox = /var/mail/$USER ; the mailbox where mms are appended
|
||||||
|
user = $USER ; the user account specified as recipient
|
||||||
|
domain = $HOSTNAME ; the domain part appended to phone number and user
|
||||||
|
attach_mms = false ; whether to attach the full mms binary file
|
||||||
|
```
|
||||||
|
|
||||||
## usage
|
## usage
|
||||||
|
|
||||||
mms2mail [-h] [-d | -f FILE]
|
mms2mail [-h] [-d | -f FILE]
|
||||||
|
@ -11,20 +53,3 @@ optional arguments:
|
||||||
-d, --daemon watch for new mms in the mmsd storage folder
|
-d, --daemon watch for new mms in the mmsd storage folder
|
||||||
-f FILE, --file FILE parse a single mms file
|
-f FILE, --file FILE parse a single mms file
|
||||||
|
|
||||||
## dependancy
|
|
||||||
|
|
||||||
- python3
|
|
||||||
- python3-watchdog (apt install python3-watchdog)
|
|
||||||
- python-messaging (https://www.github.com/davegermiquet/python-messaging.git)
|
|
||||||
- marrow.mailer (pip install marrow.mailer)
|
|
||||||
|
|
||||||
## config
|
|
||||||
```$HOME/.mms/modemmanager/mms2mail.ini```
|
|
||||||
|
|
||||||
```
|
|
||||||
[mail]
|
|
||||||
mailbox = /var/mail/mobian
|
|
||||||
account = mobian
|
|
||||||
domain = "mobian.lan"
|
|
||||||
attach_mms = false
|
|
||||||
```
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ Description=Multimedia Messaging Service to Mail converter Daemon
|
||||||
After=mmsd.service
|
After=mmsd.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
ExecStart=mms2mail -d
|
ExecStart=python3 %h/.local/bin/mms2mail -d
|
||||||
|
|
||||||
Restart=on-failure
|
Restart=on-failure
|
||||||
RestartSec=10s
|
RestartSec=10s
|
||||||
|
|
Loading…
Reference in a new issue