Re: smtpd / mail.lmtp rewrites from address, breaking lmtp

2019-09-16 Thread Reio Remma

On 17.09.2019 1:08, Michal Krzysztofowicz wrote:

Thanks for looking after this. Unfortunately, no dice:
Sep 16 21:57:13 atlantic smtpd[83146]: 70aec8652b2efbe8 mda delivery evpid=0f662ffc0f395dbe 
from= to= rcpt= 
user=me delay=0s result=PermFail stat=Error ("/bin/sh: no closing quote”)



’ is not in MAILADDR_ALLOWED, ' and `  are though.

I'll test the slash issue tomorrow once I figure out how to apply the 
patch. Nearly 20 years have passed since I last applied one. :D


Good luck,
Reio



Re: smtpd / mail.lmtp rewrites from address, breaking lmtp

2019-09-16 Thread Michal Krzysztofowicz


> 
> can you try the following diff ?
> 
> [...]
> 

Thanks for looking after this. Unfortunately, no dice: 

Sep 16 21:57:13 atlantic smtpd[83146]: 70aec8652b2efbe8 mda delivery 
evpid=0f662ffc0f395dbe from= to= 
rcpt= user=me delay=0s result=PermFail stat=Error ("/bin/sh: 
no closing quote”)

After that, my smtpd sends a bounce message back to the sender. 

Just to make sure you have a full picture, the following are the relevant 
action and match statements from my smtpd.conf: 

action "lmtp" mda "/usr/libexec/mail.lmtp -f \"%{sender}\" -d /var/dovecot/lmtp 
%{user.username}" virtual 
match from any for domain  !rcpt-to  action 
“lmtp"

Thanks!
Mike

-- 
Michal Krzysztofowicz
http://beautifulocean.org/




Re: smtpd / mail.lmtp rewrites from address, breaking lmtp

2019-09-16 Thread Gilles Chehade
On Tue, Aug 27, 2019 at 10:30:01PM +0100, Michal Krzysztofowicz wrote:
> Hi again Gilles,
> 
> > A possible fix to your issue would be to add ' to the allowed charset in
> > util.c, can you try and see if it is enough to solve your issue ?
> 
> If I read the code correctly, the ' is already allowed. valid_localpart() 
> inside util.c defines IS_ATEXT macro as below:
> 
> #define IS_ATEXT(c) (isalnum((unsigned char)(c)) || 
> strchr(MAILADDR_ALLOWED, (c)))
> 
> then MAILADDR_ALLOWED is defined inside smtpd.h as:
> 
> #define MAILADDR_ALLOWED"!#$%&'*/?^`{|}~+-=_???
> 
> therefore it contains the ' character. 
> 
> Am I looking at the correct place? 
> 

can you try the following diff ?

Index: smtpd.h
===
RCS file: /cvs/src/usr.sbin/smtpd/smtpd.h,v
retrieving revision 1.636
diff -u -p -r1.636 smtpd.h
--- smtpd.h 11 Sep 2019 04:19:19 -  1.636
+++ smtpd.h 16 Sep 2019 18:03:05 -
@@ -69,8 +69,7 @@
  * potentially dangerous and need to be escaped.
  */
 #defineMAILADDR_ALLOWED"!#$%&'*/?^`{|}~+-=_"
-#defineMAILADDR_ESCAPE "!#$%&'*/?^`{|}~"
-
+#defineMAILADDR_ESCAPE "!#$&*?^`{|}"
 
 #define F_STARTTLS 0x01
 #define F_SMTPS0x02


-- 
Gilles Chehade @poolpOrg

https://www.poolp.orgpatreon: https://www.patreon.com/gilles



Re: smtpd / mail.lmtp rewrites from address, breaking lmtp

2019-08-27 Thread Michal Krzysztofowicz
Hi again Gilles,

> A possible fix to your issue would be to add ' to the allowed charset in
> util.c, can you try and see if it is enough to solve your issue ?

If I read the code correctly, the ' is already allowed. valid_localpart() 
inside util.c defines IS_ATEXT macro as below:

#define IS_ATEXT(c) (isalnum((unsigned char)(c)) || 
strchr(MAILADDR_ALLOWED, (c)))

then MAILADDR_ALLOWED is defined inside smtpd.h as:

#define MAILADDR_ALLOWED"!#$%&'*/?^`{|}~+-=_”

therefore it contains the ' character. 

Am I looking at the correct place? 

Thanks!
Mike


-- 
Michal Krzysztofowicz
http://beautifulocean.org/




Re: smtpd / mail.lmtp rewrites from address, breaking lmtp

2019-08-27 Thread Michal Krzysztofowicz


> On 10 Aug 2019, at 16:19, Gilles Chehade  wrote:
> 
> On Wed, Jun 26, 2019 at 10:56:50AM +0100, Michal Krzysztofowicz wrote:
>> Hi All,
>> 
> 
> Hi,

Hi Gilles,

> [...]
> Sorry, it took a while to start looking at this.

Thanks a lot for getting back on this and sorry for a delayed response - I 
somehow managed to miss your response! 

> 
> We're very close to 6.6 freeze so I'm not comfortable addressing this in
> the current timeframe.
> 
> A possible fix to your issue would be to add ' to the allowed charset in
> util.c, can you try and see if it is enough to solve your issue ?

I’ll try that tonight or tomorrow. I actually have a test plan I can run to 
replicate this issue, so I’ll be able to confirm if this works. I’ll send an 
update to the list in the next day or two. 

Best Regards,
Mike

-- 
Michal Krzysztofowicz
http://beautifulocean.org/




Re: smtpd / mail.lmtp rewrites from address, breaking lmtp

2019-08-10 Thread Gilles Chehade
On Wed, Jun 26, 2019 at 10:56:50AM +0100, Michal Krzysztofowicz wrote:
> Hi All,
> 

Hi,

> I???ve been using OpenSMTPD on OpenBSD to run my email server since at least 
> 2015, and this setup has been working really well for me since. 
> 
> [...]
>
> Am I missing something in the configuration, or is this something that needs 
> to be fixed in smtpd? 
> 
> I???m running OpenBSD 6.5 patched to 005_libssl (so I guess it???s the 
> -stable flavour), with stock OpenSMTPD distributed with OpenBSD 6.5. 
> 

Sorry, it took a while to start looking at this.

We're very close to 6.6 freeze so I'm not comfortable addressing this in
the current timeframe.

A possible fix to your issue would be to add ' to the allowed charset in
util.c, can you try and see if it is enough to solve your issue ?

-- 
Gilles Chehade @poolpOrg

https://www.poolp.orgpatreon: https://www.patreon.com/gilles