Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 19 additions & 3 deletions docs/TELEPHONY-APPS-PLAN.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,13 +163,29 @@ Today `omamobile-sit-data` puts `rmnet0` behind Wi-Fi with metric 700, and Netwo

| Need | How | Ready? |
| --- | --- | --- |
| WAP push (the MMS notification) arrives as a binary SMS | sitd passes the PDU's user data through; the bridge exports an `Sms` with `Data` set and `Text` empty, which mmsd-tng picks up | No: the codec keeps the bytes but nothing passes them on (T0, T3) |
| An APN that carries MMS | mmsd-tng's `MMS_APN` must match the connected bearer's APN. mmsd-tng supports no separate MMS bearer ("limitations of Modem Manager", its README), so the carrier must allow MMS on the internet APN. Many US carriers do; check ours (Q8) | Our config has one APN (`[network] apn`) |
| WAP push (the MMS notification) arrives as a binary SMS | sitd passes the PDU's user data through; the bridge exports an `Sms` with `Data` set and `Text` empty, which mmsd-tng picks up; on a phone without mmsd-tng installed the bridge exports the placeholder text instead, so Messages shows that a message came | Yes for the 9a's stack (#697): sitd keeps each part's WAP port and delivers a joined push as data; the bridge exports it with `Data` |
| An APN that carries MMS | mmsd-tng's `MMS_APN` must match the connected bearer's APN. mmsd-tng supports no separate MMS bearer ("limitations of Modem Manager", its README), so the carrier must allow MMS on the internet APN. Many US carriers do; check ours (Q8) | On the palmtop's carrier the MMS APN is the internet APN. A second bearer on it took the IMS bearer down (2026-11-02), so sitd sets up none |
| Fetch from the MMSC over mobile data, even with Wi-Fi up | mmsd-tng binds HTTP to the bearer's interface (`SO_BINDTODEVICE`, `src/service.c:3720-3732`) and resolves through that interface's DNS (c-ares or systemd-resolved with the ifindex). Needs `CarrierMMSC`, `CarrierMMSProxy`, or `http://mms.invalid` to look them up in mobile-broadband-provider-info | **Depends on M4.3:** rmnet0 is configured IPv4 only (MODEM-CLIENT §1.3). If the carrier's bearer is IPv6-only (common on T-Mobile's network [I]), MMS needs IPv6 on rmnet0 first. The packet processor (MODEM-PLAN 6.3) is built but untested on hardware; the legacy buffers carry data meanwhile |
| Sending MMS | mmsd-tng posts the M-Send.req to the MMSC the same way | as above |
| Storage and UI | mmsd-tng stores messages and serves `org.ofono.mms` on the session bus; Chatty and our app are its clients | install `mmsd-tng` (T3) |
| Storage and UI | mmsd-tng stores messages and serves `org.ofono.mms` on the session bus; Chatty and our app are its clients | `packages/mmsd-tng` (2.6.4, #697), not enabled; Messages' side is in the omatel apps (T3) |
| Group MMS | MMS with several recipients; mmsd-tng handles the PDUs | with the above |

**The bearer for mmsd-tng (#697):** sitd reports the internet bearer's device (the one omamobile-sit-data found and kept: a candidate still being probed isn't reported), address and DNS in its private status, and the bridge publishes them on the bearer (`Interface`, `Ip4Config`). mmsd-tng binds to that device and resolves the MMSC through those servers, so MMS goes over cellular with Wi-Fi up, without touching the system's routes or DNS.

**Received on 2026-11-03** (the palmtop, the daily kernel `7.3.0-rc6-omamobile-tegu-s2mpg15-m1-g991042e2eff3-dirty`, this stack): one picture from the owner's iPhone. The WAP push arrived as a binary SMS during a call, sitd stored it, the bridge exported it with the internet bearer's device and DNS, and mmsd-tng, started afterwards, fetched the 708 KB message over `rmnet0` with Wi-Fi up (state `received`, a PNG inside). It logged one complaint, an IP config without a method, fixed in the bridge since. Messages doesn't show it yet (T3 in the apps).

**Attended runbook, receive first (9a; steps 1 to 4 passed on 2026-11-03):**

| Step / risk | Commands or action | Expect / pass | Stop condition | Rollback |
| --- | --- | --- | --- | --- |
| 1. Read-only / none | `uname -r`; `pacman -Q omamobile-modem-sit omamobile-mmd mmsd-tng`; `omamobile-sit status`; `busctl --system get-property org.freedesktop.ModemManager1 <bearer> org.freedesktop.ModemManager1.Bearer Interface Ip4Config` | Registered with data; the bearer's Interface is the found device and Ip4Config has an address and DNS | No address or DNS, no data | None |
| 2. Settings / low | As the session user, `~/.mms/modemmanager/mms` (mode 0600) from `/usr/share/mmsd-tng/mms.example`: the carrier's MMSC, the APN (the internet APN), the proxy or `NULL`, the palmtop's number; `ForceCAres=true` | A private file, nothing started | Credentials or an IPv6-only MMS bearer needed | Remove the file |
| 3. Daemon / low | `systemctl --user start mmsd-tng.service` (never `-d`) | `org.ofono.mms` on the session bus | Startup errors | `systemctl --user stop mmsd-tng.service` |
| 4. Receive / medium | The owner sends one small picture to the palmtop, Wi-Fi up | One WAP push, one downloaded message in mmsd-tng's store, calls and texts unchanged | A download or routing failure, a second WAP consumer | Stop the daemon; keep its store |
| 5. Send / medium (after the apps' T3 changes) | One small picture from Messages to the owner | One copy received | An uncertain send: don't press Send again | Stop the daemon |

Never publish the MMSC, the APN, numbers, message URLs, WAP bytes or attachments, or mmsd-tng's debug output.

**What our data path still lacks for MMS** (MODEM-PLAN 6.3 and MODEM-CLIENT §1.3): M4.3 passing on the phone, IPv6 on `rmnet0` (or proof that the carrier gives IPv4), and the bearer exported as a Bearer object. Throughput isn't an issue for MMS (messages are a few hundred kB), so the packet processor isn't a prerequisite.

### 1.8 Requirements against MODEM-PLAN
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
From: W4HO <87742609+W4HO-ham@users.noreply.github.com>
Subject: [PATCH] MMS: apply the configured number when OwnNumbers is empty

--- a/plugins/modemmanager.c
+++ b/plugins/modemmanager.c
@@ -1761,6 +1761,10 @@
}
}

+ /* An empty OwnNumbers array never enters the loop above. */
+ if (!modem->modem_number_known && modem->modem_number)
+ mms_service_set_own_number (modem->service, modem->modem_number);
+
gdbus_modem = MM_GDBUS_MODEM (modem->modem);

modem->modem_state_watch_id = g_signal_connect (gdbus_modem,
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
From: W4HO <87742609+W4HO-ham@users.noreply.github.com>
Subject: [PATCH] MMS: fail closed if the bearer interface cannot be bound

--- a/src/service.c
+++ b/src/service.c
@@ -3735,7 +3735,10 @@
if (return_code == 0)
DBG ("Socket is bound to %s", request->service->interface);
else
- DBG ("Socket could not be bound! Error: %d", return_code);
+ {
+ g_warning ("MMS interface binding failed; closing socket");
+ g_socket_close (msg_socket, NULL);
+ }

g_signal_handler_disconnect (msg,
request->soupmessage_network_event_signal_id);
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
From: W4HO <87742609+W4HO-ham@users.noreply.github.com>
Subject: [PATCH] build: link dependencies used by modern libphonenumber headers

--- a/meson.build
+++ b/meson.build
@@ -119,6 +119,8 @@
dependency('libsoup-3.0'),
dependency('libcares', version : '>=1.18.1'),
cc.find_library('dl'),
+ dependency('protobuf'),
+ dependency('absl_absl_check'),
cc.find_library('phonenumber', required: true)
]

--- a/unit/meson.build
+++ b/unit/meson.build
@@ -3,6 +3,8 @@
dependency('mm-glib', version : '>=1.14'),
dependency('libcares', version : '>1.17'),
cc.find_library('dl'),
+ dependency('protobuf'),
+ dependency('absl_absl_check'),
cc.find_library('phonenumber', required: true)
]

Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
From: W4HO <87742609+W4HO-ham@users.noreply.github.com>
Subject: [PATCH] MMS: accept an international own number with a redacted IMSI

--- a/src/service.c
+++ b/src/service.c
@@ -3159,6 +3159,10 @@
g_warning ("mms_service_set_own_number(): Number is NULL!");
return FALSE;
}
+ /* A redacted IMSI supplies no region. An international own number
+ * can still be parsed without guessing a country for national numbers. */
+ if (service->country_code == NULL && own_number[0] == '+')
+ service->country_code = g_strdup ("ZZ");
if (service->country_code == NULL)
{
g_warning ("Country Code is NULL!");
--- a/unit/test-phone-utils.c
+++ b/unit/test-phone-utils.c
@@ -113,6 +113,15 @@
g_assert_cmpstr (output, ==, carrer_vvm_test3);
}

+static void
+international_number_without_imsi (void)
+{
+ g_autofree char *number = phone_utils_format_number_e164 ("+12025550123", "ZZ", FALSE);
+ g_autofree char *national = phone_utils_format_number_e164 ("2025550123", "ZZ", FALSE);
+ g_assert_cmpstr (number, ==, "+12025550123");
+ g_assert_null (national);
+}
+
int
main (int argc,
char **argv)
@@ -123,5 +132,7 @@
NULL, test_number_decode);


+ g_test_add_func ("/mmsutil/international-number-without-imsi",
+ international_number_without_imsi);
return g_test_run ();
}
49 changes: 49 additions & 0 deletions packages/mmsd-tng/PKGBUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# SPDX-License-Identifier: MIT
# Maintainer: W4HO <87742609+W4HO-ham@users.noreply.github.com>
pkgname=mmsd-tng
pkgver=2.6.4
pkgrel=1
pkgdesc="MMS daemon using ModemManager, with an opt-in user service"
arch=(aarch64)
url="https://gitlab.com/kop316/mmsd"
license=('GPL-2.0-only')
depends=(c-ares mobile-broadband-provider-info 'libmm-glib>=1.24' libsoup3 libphonenumber glib2 glibc gcc-libs protobuf abseil-cpp)
makedepends=(meson ninja pkgconf)
provides=(mmsd)
conflicts=(mmsd mmsd-tng-git)
options=('!lto')
source=("$pkgname-$pkgver.tar.gz::$url/-/archive/$pkgver/mmsd-$pkgver.tar.gz"
'0001-use-configured-number-with-empty-own-numbers.patch'
'0002-close-socket-on-interface-bind-failure.patch'
'0003-link-modern-libphonenumber-dependencies.patch'
'0004-accept-international-own-number-with-redacted-IMSI.patch')
sha256sums=('5772d4d1830664404d8f6ed96d9c35f6e7a53c60b1ac5571cd2a6183c7e633ed'
'2bddbd5812356656162920a8cf145a69a529f6e33a2109633de6b508aee99d8e'
'4c0a0997edfb936c50807459c51b97b55be6a404faf51bbcf7c993faf5041add'
'9875223ed387fc778d05e1624237fc94732822a09f9e847c52ce8be26a427008'
'6f1aedf09714b94415a608e591aefaa72e7539823b580ac493ce19022a5c7896')

prepare() {
cd "mmsd-$pkgver"
patch -Np1 -i "$srcdir/0001-use-configured-number-with-empty-own-numbers.patch"
patch -Np1 -i "$srcdir/0002-close-socket-on-interface-bind-failure.patch"
patch -Np1 -i "$srcdir/0003-link-modern-libphonenumber-dependencies.patch"
patch -Np1 -i "$srcdir/0004-accept-international-own-number-with-redacted-IMSI.patch"
}

build() {
arch-meson "mmsd-$pkgver" build -Dbuild-mmsctl=false
meson compile -C build
}

check() {
meson test -C build --print-errorlogs
"$startdir/test/all"
}

package() {
DESTDIR="$pkgdir" meson install -C build
install -Dm644 "$startdir/systemd/mmsd-tng.service" "$pkgdir/usr/lib/systemd/user/mmsd-tng.service"
install -Dm644 "$startdir/config/mms.example" "$pkgdir/usr/share/mmsd-tng/mms.example"
install -Dm644 "$startdir/README.md" "$pkgdir/usr/share/doc/mmsd-tng/README.md"
}
53 changes: 53 additions & 0 deletions packages/mmsd-tng/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<!-- SPDX-License-Identifier: MIT -->
# mmsd-tng

An opt-in, per-user MMS daemon using ModemManager's D-Bus API. It never
starts the modem or sitd. This package alone does not enable picture
messages in Messages: omatel-agent and omamessages need their T3 changes
in their own repositories. See `docs/TELEPHONY-APPS-PLAN.md` section 1.7.

Neither Arch nor Arch Linux ARM packages mmsd-tng (checked 2026-11-03), so
this recipe builds upstream's 2.6.4 tag with the AUR recipe's runtime
dependencies and a checked source checksum.

Sources: [AUR recipe](https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=mmsd-tng-git),
[upstream 2.6.4](https://gitlab.com/kop316/mmsd/-/tree/2.6.4),
[Arch Linux ARM package indexes](https://de3.mirror.archlinuxarm.org/aarch64/extra/).
Upstream is GPL-2.0; its LGPL components retain their notices. Patches use
the corresponding upstream file's license.

The patches, and what drops each at a later version bump:

- `0001` uses the configured own number when ModemManager's OwnNumbers is
empty. Offered upstream as
[mmsd!133](https://gitlab.com/kop316/mmsd/-/merge_requests/133).
- `0002` closes the HTTP socket when it can't be bound to the interface.
Offered upstream as
[mmsd!134](https://gitlab.com/kop316/mmsd/-/merge_requests/134).
- `0003` links protobuf and Abseil, which current libphonenumber headers
need. Not offered upstream yet.
- `0004` parses an international own number without a region taken from the
IMSI. Not offered upstream yet.

mmsd-tng fetches MMS over a connected bearer whose APN is its `MMS_APN`,
bound to that bearer's device and resolving through the DNS in its
`Ip4Config`. On the 9a that's the internet bearer, where the carrier's MMS
APN is the internet APN: omamobile-mmd gives it the device sitd's data
network found and the carrier's DNS (see docs/TELEPHONY-APPS-PLAN.md 1.7).
Nothing is set up just for MMS, and the system's routes and DNS aren't
touched. A carrier with a separate MMS APN isn't supported yet.

Owner configuration, before the first start: copy
`/usr/share/mmsd-tng/mms.example` to `~/.mms/modemmanager/mms` (mode 0600)
as the same session user as omatel-agent, and replace `<MMSC>`, `<APN>` (the
internet APN) and `<OWN_NUMBER>`. Keep `ForceCAres=true` so DNS goes to the
bearer's servers. Set the MMS proxy to the carrier's `host:port`, or `NULL`
when there's none. Then `systemctl --user start mmsd-tng.service`.

No unit is enabled or D-Bus activated by this package. No carrier settings
are shipped. Do not enable upstream debug logging on the phone: it can
print numbers, message URLs, settings and message content. Never publish
its journal, settings, message store, WAP bytes or attachments.

IPv4 only for now (including an IPv4v6 bearer's IPv4 address and DNS);
IPv6-only MMS, modem suspend and carrier acceptance need attended runs.
16 changes: 16 additions & 0 deletions packages/mmsd-tng/config/mms.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# SPDX-License-Identifier: MIT
# Copy to ~/.mms/modemmanager/mms with mode 0600, before starting mmsd-tng.
# Replace placeholders privately. The APN is the internet APN ([network] apn).
[Modem Manager]
CarrierMMSC=<MMSC>
MMS_APN=<APN>
# NULL means no proxy. Otherwise use the carrier's host:port, without a URL scheme.
CarrierMMSProxy=NULL
# Fill in your own phone number; omamobile-mmd deliberately exports no OwnNumbers.
ModemNumber=<OWN_NUMBER>
AutoProcessOnConnection=true
AutoProcessSMSWAP=true

[Settings]
# Use only the bearer's DNS and interface, without changing system DNS.
ForceCAres=true
12 changes: 12 additions & 0 deletions packages/mmsd-tng/systemd/mmsd-tng.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# SPDX-License-Identifier: MIT
[Unit]
Description=MMS transport for the current user
After=dbus.service

[Service]
ExecStart=/usr/bin/mmsdtng
Restart=no
UMask=0077

[Install]
WantedBy=default.target
27 changes: 27 additions & 0 deletions packages/mmsd-tng/test/all
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash
# SPDX-License-Identifier: MIT
set -euo pipefail
cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.."
bash -n PKGBUILD
python3 - <<'PY'
import configparser
import hashlib
from pathlib import Path
import re
text = Path('PKGBUILD').read_text()
assert 'arch=(aarch64)' in text
assert 'meson test -C build --print-errorlogs' in text
assert 'arch-meson "mmsd-$pkgver" build' in text
assert 'SKIP' not in text
for path in Path('.').glob('*.patch'):
assert hashlib.sha256(path.read_bytes()).hexdigest() in text, path
unit = Path('systemd/mmsd-tng.service').read_text()
assert 'ExecStart=/usr/bin/mmsdtng\n' in unit and 'Restart=no' in unit
assert not re.search(r'^(Requires|Wants|BindsTo|ExecStartPre|ExecStartPost)=', unit, re.M)
config = configparser.ConfigParser(interpolation=None)
config.read('config/mms.example')
assert config['Modem Manager']['CarrierMMSC'] == '<MMSC>'
assert config['Modem Manager']['MMS_APN'] == '<APN>'
assert config['Settings'].getboolean('ForceCAres')
print('ok - pinned source, patches, aarch64 recipe and opt-in configuration')
PY
5 changes: 4 additions & 1 deletion packages/omamobile-mmd/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ pkgdesc="Omarchy Mobile ModemManager-compatible bridge: org.freedesktop.ModemMan
arch=(aarch64)
url="https://github.com/derekross/omarchy-mobile"
license=(MIT)
depends=(python python-gobject glib2 dbus polkit 'omamobile-modem-sit>=0.3.0')
# modem-sit from the version that reports the internet bearer's device,
# address and DNS in its status: with an older one the bearer's Interface
# would stay empty for good.
depends=(python python-gobject glib2 dbus polkit 'omamobile-modem-sit>=0.3.37')
checkdepends=(dbus)
# It owns ModemManager's bus name and ships its bus policy and polkit
# actions. Nothing in Arch or Arch Linux ARM hard-depends on modemmanager
Expand Down
Loading