Re: relay via smtps with special characters in username

2021-12-05 Thread Timo

No not the # somebody thoughts a : in a username is a good idea.
But Opensmtpd (and also postfix) use the : as the delimiter between 
username and password.


Instead of username:password in my secrets file i had a 
usernamepart1:usernamepart2:password

The smtp system wasn't able to split the string in a correct way.

After my change i could use the ; as the delimiter now i have 
usernamepart1:usernamepart2;password and the smtp system splits correct 
at the ; sign.



Am 2021-12-05 22:41, schrieb Thomas Bohl:
fixed it for myself. I changed the delimiter in sourcecode, table.c 
Line 557 from : to ; and build my own Opensmtpd from scratch.


My secrets file ist now myrelay username;password

Everything works as expected :)


Did you had a problem with the # symbol?

The man page states: "Comments can be put anywhere in the file using a
hash mark (‘#’), and extend to the end of the current line."




Re: relay via smtps with special characters in username

2021-12-05 Thread Thomas Bohl
fixed it for myself. I changed the delimiter in sourcecode, table.c Line 
557 from : to ; and build my own Opensmtpd from scratch.


My secrets file ist now myrelay username;password

Everything works as expected :)


Did you had a problem with the # symbol?

The man page states: "Comments can be put anywhere in the file using a
hash mark (‘#’), and extend to the end of the current line."



Re: relay via smtps with special characters in username

2021-12-05 Thread Timo

Hi,

fixed it for myself. I changed the delimiter in sourcecode, table.c Line 
557 from : to ; and build my own Opensmtpd from scratch.


My secrets file ist now myrelay username;password

Everything works as expected :)

Have a nice time

Regards

Timo

Am 2021-12-04 14:13, schrieb Timo:


Hello to everyone,

I try to setup a Debian smtp host, we have to relay to a special system 
with a fixed username and a selfsigned certificate.


I could send mails via thunderbird and also swaks is working fine, but 
opensmtpd gives me an


mta error reason=AUTH rejected: 501 5.5.4 (Invalid command arguments)

I think the username is the problem it has several # and one :
I tried to escpape the special characters in several ways, without 
luck


Here are my settings:

smtpd.conf:

# $OpenBSD: smtpd.conf,v 1.10 2018/05/24 11:40:17 gilles Exp $
table aliases file:/etc/aliases
listen on localhost
table secrets file:/etc/secrets
action "myserver" relay host smtps://myrelay@192.168.100.5:465 auth 


match from local for any action "myserver"

/etc/secrets:

myrelay 
usernamepart1#usernamepart2:465#usernamepart3#usernamepart4:password


debug log:

[411]: lookup: fetch RELAYHOST from table static: -> 
"smtps://myrelay@192.168.00.5:465"
[411]: lookup: lookup "myrelay" as CREDENTIALS in table static:secrets 
->

"usernamepart1#usernamepart2:465#usernamepart3#usernamepart4:password"
[412]: 40979230afbdaaf2 mta connecting 
address=smtps://192.168.100.5:465 host=192.168.100.5

[412]: 40979230afbdaaf2 mta connected
[412]: 40979230afbdaaf2 mta tls 
ciphers=TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256

[412]: 40979230afbdaaf2 mta server-cert-check result="failure"
[412]: 40979230afbdaaf2 mta error reason=AUTH rejected: 501 5.5.4 
(Invalid command arguments)
[412]: smtp-out: Disabling route [] <-> 192.168.100.5 (192.168.100.5) 
for 15s
[412]: smtp-out: No valid route for [connector 
[]->[relay:192.168.100.5,port=465,smtps,auth=secrets:myrelay,mx],0x0]


Is there a way to get this setting running?

Thanks in advance

Regards

Timo