Re: Email is cut off

Charles Cazabon <[email protected]> Fri, 10 Dec 2021 10:06:16 -0600
Newsgroups gmane.mail.getmail.user
Message-ID <[email protected]>
Niklas Albers <[email protected]> wrote:
> 
> I just started to use getmail as a replacement for a Windows based fetcher.
> It will fetch the emails from the internet and forwards it via
> sendmail/postfix to our MS Exchange server, filtered with clamav and
> spamassassin.

Note that is a very-much-not-recommended setup.  After getmail retrieves the
message, it has to be processed locally by sendmail for injection into the
local queue, then sent to another MTA, where the same process is repeated, and
then delivered into the recipient's actual mailstore.

That's a lot of moving parts.  It can go wrong at several places in that
chain, and I would put quite a lot of money on the issue happening after
getmail hands off the message.

The fact that one recipient receives the full message proves getmail did
indeed hand off the full message to your configured MDA.

> The user which was using getmail just received an email containing the first
> three lines and then it was cut off, the other user received the whole mail
> containing a longer text including the history of the email exchange. Any
> ideas what could cause this behavior?

I have one wild guess, but I don't like guessing when trying to provide
support.  What you should do is look at the logs of all the processes
involved, for the entirely of their handling of the message in question.

1) getmail with --trace
2) logs of your two filter programs
3) sendmail injection logs
4) sendmail mail-handling & SMTP delivery logs
5) MSexchange reception, handling, and delivery logs

Ideally, get cron out of the picture and reproduce this from a shell manually
with just that one problematic message retrieved.

> Dec  9 07:10:02 serverXYZ spamd[375582]: spamd: clean message (1.1/4.0) for relay:1001 in 0.5 seconds, 155186 bytes.

So spamd saw what looks like the full message - 155kbytes.

> Dec  9 07:10:02 serverXYZ getmail: msg 334/334 (157415 bytes) msgid 395905161/19584 from <[email protected]> delivered to MDA_external command sendmail ()

spamd gave some output which getmail added to the message, increasing its size
a bit.

> Dec  9 07:10:02 serverXYZ postfix/cleanup[460672]: 78496311: message-id=<messageID>

Some MUA or MTA is generating broken message-IDs there.  You might want to fix
that.  Also, it looks like you're actually using Postfix, not sendmail.  The
sendmail command is common to all Unix MTAs for hysterical raisins.

> Dec  9 07:10:02 serverXYZ postfix/qmgr[156054]: 78496311: from=<[email protected]>, size=12969, nrcpt=1 (queue active)
> Dec  9 07:10:02 serverXYZ postfix/smtp[460674]: 78496311: to=<[email protected]>, relay=10.10.1.18[10.10.1.18]:25, delay=0.21, delays=0.05/0.01/0.01/0.13, dsn=2.6.0, status=sent (250 2.6.0 <messageID> [InternalId=57715770523654, Hostname=target.internal.domain] 14429 bytes in 0.122, 115,466 KB/sec Queued mail for delivery)

... and that shows, if its the same message, it's only 12kbytes.  So whatever
software did that step broke it.

Note: in future, when posting config/diagnostics data, please do not edit
anything out except the password.  It makes diagnosing your problem more
difficult.

Charles
-- 
-----------------------------------------------------------------------
Charles Cazabon
GPL'ed software available at:               http://pyropus.ca/software/
-----------------------------------------------------------------------