email sent via dma is received in plain text without attachments

1 view
Skip to first unread message

Dale Scott

unread,
Aug 22, 2025, 12:08:57 AMAug 22
to Freebsd Questions
Hi all, I'm hosting webERP, a PHP business web app, on FreeBSD 14.2 using PHP 8.2. webERP uses phpMail to send HTML-format emails with PDF attachments. The server uses dma to send email to the SMTP2GO smarthost for delivery. The trouble is that received email is text format instead of HTML and missing the expected PDF attachment.

Any idea what could be causing this or what to do about it?

Another developer on the webERP project is using a Linux shared hosting service and any sent emails are received in HTML format with expected PDF attachments. This seems to show webERP is doing the right thing although I expect there are still lots of differences in our environments, and things work on a Linux server in spite of issues while FreeBSD may be more pedantic about correctness.

Cheers,
Dale

--
Dale Scott
Engineering Manager | SME Business Software Support
Principal Consultant, dalescott.net
LinkedIn Profile, Dale Scott, P.Eng.

Marco Moock

unread,
Aug 22, 2025, 1:43:46 AMAug 22
to ques...@freebsd.org
Am 21.08.2025 um 22:08:13 Uhr schrieb Dale Scott:

> Hi all, I'm hosting webERP, a PHP business web app, on FreeBSD 14.2
> using PHP 8.2. webERP uses phpMail to send HTML-format emails with
> PDF attachments. The server uses dma to send email to the SMTP2GO
> smarthost for delivery. The trouble is that received email is text
> format instead of HTML and missing the expected PDF attachment.

Can you check if the mail is being sent TO dma with the attachment and
HTML part?

Maybe dma provides a hidden BCC option to send it to a local test
mailbox to verify.

--
Gruß
Marco

Send unsolicited bulk mail to 1755806...@cartoonies.org

John Levine

unread,
Aug 22, 2025, 11:49:30 AMAug 22
to freebsd-...@freebsd.org, da...@dalescott.net
According to Dale Scott <da...@dalescott.net>:
>-=-=-=-=-=-
>
>Hi all, I'm hosting webERP, a PHP business web app, on FreeBSD 14.2
>using PHP 8.2. webERP uses phpMail to send HTML-format emails with PDF
>attachments. The server uses dma to send email to the SMTP2GO smarthost
>for delivery. The trouble is that received email is text format instead
>of HTML and missing the expected PDF attachment.
>
>Any idea what could be causing this or what to do about it?

DMA does not do anything clever to the mail it handles. If you're not
getting the HTML and attachments, that's because the PHP script isn't
adding them. I suppose it's theoretically possible that SMTP2GO is
stripping them but that seems rather unlikely.

When you say phpMail, do you mean the PHPMailer library, the built in
PHP mail() function, or something else?


Dale Scott

unread,
Aug 22, 2025, 2:26:44 PMAug 22
to John Levine, freebsd-...@freebsd.org
On 2025-08-22 09:48, John Levine wrote:

> According to Dale Scott <da...@dalescott.net>:
>
>> -=-=-=-=-=-
>>
>> Hi all, I'm hosting webERP, a PHP business web app, on FreeBSD 14.2
>> using PHP 8.2. webERP uses phpMail to send HTML-format emails with PDF
>> attachments. The server uses dma to send email to the SMTP2GO
>> smarthost
>> for delivery. The trouble is that received email is text format
>> instead
>> of HTML and missing the expected PDF attachment.
>>
>> Any idea what could be causing this or what to do about it?
>
> DMA does not do anything clever to the mail it handles. If you're not
> getting the HTML and attachments, that's because the PHP script isn't
> adding them. I suppose it's theoretically possible that SMTP2GO is
> stripping them but that seems rather unlikely.
>

Thanks for your help John.

> When you say phpMail, do you mean the PHPMailer library, the built in
> PHP mail() function, or something else?

webERP uses PHPMailer which in the absence of a config flat specifiying
an SMTP server (aka smarthost), the php mail() function will be used,
passing the mail to the local MTA, which in my case is dma. The other
developer does not know the details of what is hosting services provider
is doing, only that mail is delivered and he is not specifying an SMTP
server in webERP.

Since the other developer can receive email with attachments, I think I
can assume webERP is correctly generating the mail. It seems possible
dma is removing the multi-part content due to some error that is ignored
on Linux.

My thinking is that I need to:

Check dma log (if one exists)
Check SMTP2GO logs
Run dma so that it generates logging (if possible)

Cheers,
Dale

Fyi, here is "show original" for a recent email, which should have been
in HTML and should have had an attached PDF. It seems to my naieve eye
that there is no HTML or attachment, and since this works for the other
developer, I should be able to assume webERP is correctly generating the
mail. It seems possible dma is removing the multi-part content due to
some error that is ignored on Linux.


Return-Path:
<bt.o38eka1stjodoh3=5cx6oza1obd2=xzxv4mh...@em921279.dalescott.net>
Received: from mi301-ssvc.dcs.int.inet (LHLO mi301.dcs.int.inet)
(10.0.153.171) by cds323.dcs.int.inet with LMTP; Thu, 21 Aug 2025
15:37:51
-0600 (MDT)
Received: from omta022.cacentral1.a.cloudfilter.net ([10.0.143.222])
by cmsmtp with ESMTPS
id pCPVuQdHpRSTopCyluLTYn; Thu, 21 Aug 2025 15:37:51 -0600
Received: from shw-ibgw-4001a.ext.cloudfilter.net ([10.228.9.174])
by cmsmtp with ESMTPS
id pCL1uLQwH5MqypCyluSpen; Thu, 21 Aug 2025 21:37:51 +0000
Received: from a2i607.smtp2go.com ([103.47.206.95])
by cmsmtp with ESMTPS
id pCyjuGP729CuJpCykuFN6t; Thu, 21 Aug 2025 21:37:50 +0000
X-SHW-ORIG-RCPT: swiftcon...@shaw.ca
Authentication-Results: shw-ibgw-4001a.ext.cloudfilter.net;
dkim=pass header.d=smtpservice.net header.b=gVWEm7KB;
dkim=pass header.d=dalescott.net header.i=@dalescott.net
header.b=NqF8cFQg;
dmarc=permerror (record unparsable: required version tag missing from
record)
header.from=dalescott.net
X-Authority-Analysis: v=2.4 cv=D6vkKeRj c=1 sm=1 tr=0 ts=68a791ae b=1
cx=a_idp_d a=4bE9P08XUUryYeSYPjuXOQ==:117 a=4bE9P08XUUryYeSYPjuXOQ==:17
a=_IOwNaMQN_sA:10 a=2OwXVqhp2XgA:10 a=KVNK1R2Qs0gA:10 a=rR46ASE-1r4A:10
a=BsLg0OVx7u-3DZiCuggA:9 a=uDXMMbqNXFhfq9i5nQI5:22
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed;
d=smtpservice.net; s=mjqv30.a1-4.dyn; x=1755813170; h=Feedback-ID:
X-Smtpcorp-Track:Date:From:Message-Id:Subject:To:Reply-To:Sender:
List-Unsubscribe:List-Unsubscribe-Post;
bh=ioRfrMyoatc4o+Sb21K2gPfo4SyJd90L3jWDzykrIbo=;
b=gVWEm7KBulH72+0PPrR2NGCXBz
FSujQdXDoJSGrlmXfWkFq5hNsQZUNc45HLySt9LCD/8CV69EbcH/ELr7IsDtgSolFv4kn1LEzouLZ
0NvfNOdp3l8Mq83PIcgNj1n2oobSaeYOG1fyQNWr8Jmbwq9fw8j+hAnFYkK044Govg16PaYKOeBbz
TzD8Oxv/9glbkYG6AICYOzwT7bJbCj1l6K6KFBZbz3tw8SIQ3KVU3OC7g5o7UKHmpRb+kXncSFb/Q
7R/ww7HUQWA4lqiOafi8Mkz6iDsClchwjjEqPbqNoO10W6bcQjMuFgFCssnZl5kPj8VQyA83tnFih
XnQdYhOA==;
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dalescott.net;
i=@dalescott.net; q=dns/txt; s=s921279; t=1755812270; h=from : subject
: to : message-id : date;
bh=ioRfrMyoatc4o+Sb21K2gPfo4SyJd90L3jWDzykrIbo=;

b=NqF8cFQgKNNqLKQxCehNa6vHtZ8MeZg9G5ozpXHyFWvF+hJPP/U5BsLiR1zgVLTMx+Bi3Z

fxsm07WtlPB+aUJR/qwAkkZrgxYLsIPr4jIxSzwjpHlKKsiUyHH7NSEs8q1zr1Wis5G6SDDw

F7wZl2KE9VUXa61kltPITa39IYSjqWQy2RhDtST+/B/NlfA4K4b49vZqz2d6/xlCiHgNIbrH

tSRV6uXKWOm66go6N09VEQRON2ZmeODQEGpKR8TBIZXlbLnjfBFYW6fP7YQ8OENPVVkRJtUV
55TCQs1L4SMPAxlQ7JBauxSgZiMYCasicvITOKXP18qJPnxW0ntVsF2Q==
Received: from [10.45.56.87] (helo=SmtpCorp)
by smtpcorp.com with esmtpsa
(TLS1.2:ECDHE_RSA_SECP256R1__AES_256_GCM:256)
(Exim 4.94.2-S2G) (envelope-from <mae...@dalescott.net>)
id 1upCyj-ED51Eh-EB
for swiftcon...@shaw.ca; Thu, 21 Aug 2025 21:37:49 +0000
Received: from [10.105.245.141] (helo=dalescott.net)
by smtpcorp.com with esmtpsa
(TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256)
(Exim 4.98.1-S2G) (envelope-from <mae...@dalescott.net>)
id 1upCyi-FnQW0hQ14Ef-eFxf for swiftcon...@shaw.ca;
Thu, 21 Aug 2025 21:37:48 +0000
Received: from www (uid 80) (envelope-from mae...@dalescott.net) id
21aeba
by dalescott.net (DragonFly Mail Agent v0.13+ on whizzer);
Thu, 21 Aug 2025 15:37:47 -0600
To: swiftcon...@shaw.ca
Subject: weberp_scc_ReOrderLevel_2025-08-21.pdf
Message-Id: <E1upCyi-FnQW...@message-id.smtpcorp.com>
From: mae...@dalescott.net
Date: Thu, 21 Aug 2025 21:37:48 +0000
X-Smtpcorp-Track: OGp4gWmWlPBf.lUvxSWY8kQHG.75HSzgCph0-
Feedback-ID: 921279m:921279a_T4Gmc:921279sBB8HigUNR
X-Report-Abuse: Please forward a copy of this message, including all
headers,
to <abuse-...@smtp2go.com>
X-CMAE-Envelope:
MS4xfKYZcwCI0x7lmGTuKISREVKTLPjmxbxeRzPmTTvOYP+e4Hh52x2rljtIRTrWmuMhTO6TYxs5Hj+6YvWPedkkrmvWe0qxrseuRUA0oERah9i1gJXmSFgS

krT6IAgvJGF+Zn2FQr8n3b06k+vq9zo13osz8MSyWmxuEgd7qqJVIarzjzU9vTG9QooEYq50VPK7SfHa3foLIqsuZigo3t67oGlMn4brdgY1qxkHChGTbtrb
hfVKF++X1BVrOhOZdBk7oJbi04v4yhxOg32QAqBNMh4=


Dale Scott

unread,
Aug 22, 2025, 3:02:18 PMAug 22
to Marco Moock, ques...@freebsd.org
On 2025-08-21 23:42, Marco Moock wrote:

> Am 21.08.2025 um 22:08:13 Uhr schrieb Dale Scott:
>
>> Hi all, I'm hosting webERP, a PHP business web app, on FreeBSD 14.2
>> using PHP 8.2. webERP uses phpMail to send HTML-format emails with
>> PDF attachments. The server uses dma to send email to the SMTP2GO
>> smarthost for delivery. The trouble is that received email is text
>> format instead of HTML and missing the expected PDF attachment.
>
> Can you check if the mail is being sent TO dma with the attachment and
> HTML part?
>
> Maybe dma provides a hidden BCC option to send it to a local test
> mailbox to verify.

Thanks Marco. I agree, the first step is to confirm what dma gets and
what is done with it.

fatty.merc...@aceecat.org

unread,
Aug 22, 2025, 4:45:29 PMAug 22
to ques...@freebsd.org
On Fri, Aug 22, 2025 at 12:26:04PM -0600, Dale Scott wrote:

> webERP uses PHPMailer which in the absence of a config flat
> specifiying an SMTP server (aka smarthost), the php mail() function
> will be used, passing the mail to the local MTA, which in my case is
> dma.

This can mean one of two different things:

- run a SMTP dialog on 127.0.0.1:25 , OR

- fork & exec off the MTA (maybe directly as dma, maybe as /usr/sbin/sendmail)
and pipe the contents of the message to it.

I suspect this *could* make a difference, because there are grotty
details to get right regarding how to mark the end of the message, and
even LF vs CRLF line endings. You can blame this on "be liberal in
accepting".

Also various anti-spam techs come into mind; the header you quote
shows the message has failed DMARC, I suppose this could cause
a paranoid mainstream provider to drop all attachments.

--
Ian

John R. Levine

unread,
Aug 22, 2025, 6:03:29 PMAug 22
to Dale Scott, freebsd-...@freebsd.org
On Fri, 22 Aug 2025, Dale Scott wrote:
>> DMA does not do anything clever to the mail it handles. ..

> Since the other developer can receive email with attachments, I think I can
> assume webERP is correctly generating the mail.

I would wager money that's it isn't.

> It seems possible dma is
> removing the multi-part content due to some error that is ignored on Linux.

DMA is a very small program. I have read all the source code. It does
not look inside the messages and it most definitely does not take messages
apart or remove parts of them.

If I were you, I would look at your PHP setup to figure out what's wrong.
I'd look for mistakes in configuration files, or perhaps corrupted or
missing template files. Since it's a Unix system, you always need to look
at file ownership and permissions -- it might be files or directories that
exist but that the PHP user (probably www) can't read.

A good start would be to edit your php.ini to use the development
settings so PHP tells you when something goes wrong.

Regards,
John Levine, jo...@taugh.com, Primary Perpetrator of "The Internet for Dummies",
Please consider the environment before reading this e-mail. https://jl.ly

Reply all
Reply to author
Forward
0 new messages