Add MMS sending capacilities #1

Merged
alex merged 12 commits from dev into master 2021-05-21 05:57:05 +00:00
3 changed files with 5 additions and 9 deletions
Showing only changes of commit de8dcbe4d4 - Show all commits

View file

@ -55,6 +55,7 @@ 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
[smtp]
hostname = localhost

View file

@ -49,7 +49,7 @@ class MMS2Mail:
MMS support is provided by python-messaging
"""
def __init__(self, config, delete=False, force_read=False,
def __init__(self, config, force_read=False,
force_unlock=False):
"""
Return class instance.
@ -57,21 +57,19 @@ class MMS2Mail:
:param config: The module configuration file
:type config: ConfigParser
:param delete: delete MMS after conversion
:type delete: bool
:param force_read: force converting an already read MMS (batch mode)
:type force_read: bool
:param force_unlock: Force mbox unlocking after a few minutes
:type force_unlock: bool
"""
self.delete = delete
self.force_read = force_read
self.force_unlock = force_unlock
cfg = config.get_config()
self.attach_mms = cfg.getboolean('mail', 'attach_mms',
fallback=False)
self.delete = cfg.getboolean('mail', 'delete_from_mmsd',
fallback=False)
self.domain = cfg.get('mail', 'domain',
fallback=socket.getfqdn())
self.user = cfg.get('mail', 'user', fallback=getpass.getuser())
@ -547,9 +545,6 @@ def main():
dest='disable_smtp')
parser.add_argument('--disable-mms-delivery', action='store_true',
dest='disable_mms_delivery')
parser.add_argument('--delete', action='store_true', dest='delete',
help="After procession ask mmsd to delete \
the mms from its storage")
parser.add_argument('--force-read', action='store_true',
dest='force_read', help="Force conversion even if MMS \
is marked as read")
@ -586,7 +581,6 @@ def main():
fallback=2525))
m = MMS2Mail(config=c,
delete=args.delete,
force_read=args.force_read,
force_unlock=args.force_unlock)
m.set_dbus(d)

View file

@ -3,6 +3,7 @@ mailbox = /var/mail/mobian
account = mobian
domain = mobian.lan
attach_mms = false
delete_from_mmsd = false
[smtp]
hostname = localhost