mms2mail/README.md

116 lines
3.1 KiB
Markdown
Raw Permalink Normal View History

2021-04-30 15:15:32 +00:00
# mms2mail
2021-05-11 14:52:27 +00:00
Mail bridge for mmsd.
2021-05-11 14:52:27 +00:00
mms2mail:
* convert incoming mms from mmsd to mail and store it in unix mbox.
* provide a smtp server converting mail to mms with mmsd.
By default:
* store mails in the current user mbox (```/var/mail/$USER```)
* in case the mbox is locked by another process the output could be found in ```$HOME/.mms/failsafembox```
* listen on localhost port 2525 for mail
2021-05-01 06:43:13 +00:00
2021-05-01 07:53:32 +00:00
## installation
2021-05-01 06:43:13 +00:00
### dependency
2021-05-01 06:43:13 +00:00
- python3
2021-05-11 14:52:27 +00:00
- python3-aiosmtpd
- python3-pydbus
2021-05-01 07:53:32 +00:00
### setup
Install the dependency and mms2mail (on debian based distribution):
```
make deb-deps install
```
For other distribution:
```
make pypy-deps install
```
To enable the daemon mode in systemd user :
```
make configure start
```
Depending on your distribution, you might have to add your account to the ```mail``` group to be able to lock and use the system mbox.
On Debian based distribution :
```
sudo addgroup $(whoami) mail
```
#### manual install
2021-05-11 14:52:27 +00:00
Install the dependency and mms2mail (on debian based distribution):
2021-05-01 07:53:32 +00:00
```
2021-05-10 08:30:37 +00:00
sudo apt-get install python3
sudo apt-get install python3-pydbus
2021-05-11 14:52:27 +00:00
sudo apt-get install python3-aiosmtpd
2021-05-01 07:53:32 +00:00
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
```
2021-05-19 06:08:09 +00:00
Depending on your distribution, you might have to add your account to the ```mail``` group to be able to lock and use the system mbox.
On Debian based distribution :
```
sudo addgroup $(whoami) mail
```
2021-05-01 06:43:13 +00:00
2021-05-01 07:53:32 +00:00
### config
An optional configuration file can be put in the home folder : ```$HOME/.mms/modemmanager/mms2mail.ini```. The default value are :
2021-05-01 06:43:13 +00:00
```
[mail]
2021-05-01 07:53:32 +00:00
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
delete_from_mmsd = false ; delete mms from mmsd storage upon successful conversion
2021-05-11 14:52:27 +00:00
[smtp]
hostname = localhost
port = 2525
2021-05-01 06:43:13 +00:00
```
2021-05-01 07:53:32 +00:00
## usage
2021-05-11 14:52:27 +00:00
### reference
```
2021-05-19 17:21:20 +00:00
mms2mail [-h] [--disable-smtp] [--disable-mms-delivery] [--force-read] [--force-unlock] [-l {critical,error,warning,info,debug}]
2021-05-01 07:53:32 +00:00
optional arguments:
-h, --help show this help message and exit
2021-05-11 14:52:27 +00:00
--disable-smtp
--disable-mms-delivery
--force-read Force conversion even if MMS is marked as read
2021-05-11 14:52:27 +00:00
--force-unlock BEWARE COULD LEAD TO WHOLE MBOX CORRUPTION Force unlocking the mbox after a few minutes /!\
2021-05-10 08:30:37 +00:00
-l {critical,error,warning,info,debug}, --logging {critical,error,warning,info,debug}
Define the logger output level
2021-05-11 14:52:27 +00:00
```
2021-05-19 17:21:20 +00:00
### Sending MMS
To send MMS, mail address not in the following format would be ignored :
```+123456789@domain``` with phone number in international format.
#### with Mutt :
2021-05-11 14:52:27 +00:00
To be able to send mms with mutt you need it to be built with SMTP support.
And and the following line in your ```$HOME/.muttrc```:
```
set smtp_url = "smtp://localhost:2525"
set ssl_starttls = no
set ssl_force_tls = no
```