Re: Issue with OpenSMTPD, procmail and comsat

2018-09-03 Thread d . rauschenb
Hi Gilles,

the following diff turns off the noise in /var/log/{messages,daemon}
but this is a hack and not a solution.

-dra

Index: comsat.c
===
RCS file: /cvs/src/libexec/comsat/comsat.c,v
retrieving revision 1.48
diff -u -p -r1.48 comsat.c
--- comsat.c3 Apr 2017 17:23:39 -   1.48
+++ comsat.c3 Sep 2018 15:23:23 -
@@ -221,7 +221,6 @@ mailfor(char *name)
cp[strcspn(cp, " \t\n")] = '\0';
offset = strtonum(cp, 0, LLONG_MAX, &errstr);
if (errstr) {
-   syslog(LOG_ERR, "'%s' is %s", cp + 1, errstr);
return;
}
while (--utp >= utmp) {



Re: Issue with OpenSMTPD, procmail and comsat

2018-09-03 Thread d . rauschenb
Hi Gilles,

On Mon, Sep 03, 2018 at 02:27:26PM +0200, Gilles Chehade wrote:
> On Mon, Sep 03, 2018 at 12:25:55PM +0200, d.rausch...@gmail.com wrote:
> > On Sun, Sep 02, 2018 at 01:25:46PM +0200, Gilles Chehade wrote:
> > 
> > From d...@ws.lan  Mon Sep  3 12:12:34 2018
> > 
> can you try:
> 
> procmail -f %{mbox.from} --

Not working. The two spaces betweem the mail address and the date do
not only occur in /var/mail/$USER they also appear in the filtered
mails.  Of course comsat(8) is not looking at them and my mail
user-agent (mutt) is accepting the two spaces.

-dra



Re: Issue with OpenSMTPD, procmail and comsat

2018-09-03 Thread Gilles Chehade
On Mon, Sep 03, 2018 at 12:25:55PM +0200, d.rausch...@gmail.com wrote:
> Hi Gilles,
> 
> On Sun, Sep 02, 2018 at 01:25:46PM +0200, Gilles Chehade wrote:
> > Can you provide me with the corrupt line procmail includes so I can
> > check if it is invalid indeed ?
> 
> The corrput line:
> 
> From d...@ws.lan  Mon Sep  3 12:12:34 2018
> 
> The differenc I encountered is with .forward to procmail there are
> TWO spaces between the email address and the date, without .forward to
> procmail there is only ONE space.
> 
> If I edit such a two spaced mail with vi(1) and concat it to
> /var/mail/$USER comsat(8) is silenced. No error message but ksh
> reports "you have mail in /var/mail/dra" as it should.
> 

interesting, it's not clear to me how this can happen but at least this
means the fix will not be a special case.

can you try:

procmail -f %{mbox.from} --

i'll try to reproduce the bug at home but I'm unable before tonight.



-- 
Gilles Chehade

https://www.poolp.org  @poolpOrg



Re: Issue with OpenSMTPD, procmail and comsat

2018-09-03 Thread d . rauschenb
Hi Gilles,

On Sun, Sep 02, 2018 at 01:25:46PM +0200, Gilles Chehade wrote:
> Can you provide me with the corrupt line procmail includes so I can
> check if it is invalid indeed ?

The corrput line:

>From d...@ws.lan  Mon Sep  3 12:12:34 2018

The differenc I encountered is with .forward to procmail there are
TWO spaces between the email address and the date, without .forward to
procmail there is only ONE space.

If I edit such a two spaced mail with vi(1) and concat it to
/var/mail/$USER comsat(8) is silenced. No error message but ksh
reports "you have mail in /var/mail/dra" as it should.

-dra



Re: Issue with OpenSMTPD, procmail and comsat

2018-09-02 Thread Gilles Chehade
You forgot to mention what version of OpenBSD you are using ?

On Sun, Sep 02, 2018 at 01:03:48PM +0200, d.rausch...@gmail.com wrote:
> Hi,
> 
> I figured out an issue with opensmtpd, procmail, and comsat.
> The .forward for procamil must be
> 
> "|exec /usr/local/bin/procmail -f - || exit 75"
> 
> The -f - option makes procmail to include a dummy mail-from header
> line. But this line is corrupt. comsat(8) does not like this:
> 
> Sep  1 19:10:41 ws comsat[11416]: ':/var/mail/dra' is invalid
> 
> in /var/log/messages. But mutt can read this mail.
> 
> Without the -f - option in the .forward file my mailspool is corrupted
> because of the missin first line (mail-from header). The currect
> solution is: I have turned off comsat in inetd.conf. But i am
> unsatisfied with this. It would be better if opensmtpd would include
> the mail-from header if processinf the .forward to procmail.
> 

I don't like the idea that because procmail produces a corrupt line that
comsat doesn't understand, smtpd should have a special case and parse an
aliases mapping or forward files looking for the string "procmail".

If you're running current, you might want to try:

   "|exec /usr/local/bin/procmail -f %{mbox.from} || exit 75"

in case it helps procmail produce a correct sender.

Can you provide me with the corrupt line procmail includes so I can
check if it is invalid indeed ?

-- 
Gilles Chehade

https://www.poolp.org  @poolpOrg



Issue with OpenSMTPD, procmail and comsat

2018-09-02 Thread d . rauschenb
Hi,

I figured out an issue with opensmtpd, procmail, and comsat.
The .forward for procamil must be

"|exec /usr/local/bin/procmail -f - || exit 75"

The -f - option makes procmail to include a dummy mail-from header
line. But this line is corrupt. comsat(8) does not like this:

Sep  1 19:10:41 ws comsat[11416]: ':/var/mail/dra' is invalid

in /var/log/messages. But mutt can read this mail.

Without the -f - option in the .forward file my mailspool is corrupted
because of the missin first line (mail-from header). The currect
solution is: I have turned off comsat in inetd.conf. But i am
unsatisfied with this. It would be better if opensmtpd would include
the mail-from header if processinf the .forward to procmail.

-dra