Re: Pluses in addresses do not work as expected

2021-01-31 Thread Chris Bennett
On Sun, Jan 31, 2021 at 08:39:18PM -0600, Edgar Pettijohn wrote:
> > action "outbound" relay host smtp+tls://b...@smtp.example.com auth secrts
> > ^^^
> 
> Along with your other 100 users. You would then need to have match rules to 
> correspond to 
> their action rules. I don't really see much need since you could just 
> configure
> their mua's to do this.
> I think the majority of people use this so that their system
> mail reaches them. Such as the output from /etc/daily and the like.

OK, that makes a lot of sense using it for system mail or with just one
or two users.
Thanks
Chris

> 
> Edgar
> 



Re: Pluses in addresses do not work as expected

2021-01-31 Thread Edgar Pettijohn
On Sun, Jan 31, 2021 at 04:24:28PM -0600, Chris Bennett wrote:
> On Sun, Jan 31, 2021 at 03:51:01PM +0100, Pascal Huisman wrote:
> > Which got me out of the mess. See man smtpd.conf
> > It now switches to the user before delivering. So it's not vmail as
> > directory owner, but the username who is directory owner. In the trace
> > you can see the switch in user in the trace.
> > 
> > My virtual user config: 
> > pascal:someencryptedpasswdhash:pascal:1000:1000:/home/pascal::userdb_ma
> > il=maildir:/home/pascal/Maildir
> > 
> 
> The example in smtpd.conf shows:
> 
> action "outbound" relay host smtp+tls://b...@smtp.example.com auth secrts
> ^^^
> Having bob here completely confuses me.
> I'm not using this method, but I have to ask the question:
> What happens if you have two users, bob and jane? Or a hundred users?

You would need to create a credentials table mapping the label `bob' to his 
credentials.
Along with your other 100 users. You would then need to have match rules to 
correspond to 
their action rules. I don't really see much need since you could just configure
their mua's to do this. I think the majority of people use this so that their 
system
mail reaches them. Such as the output from /etc/daily and the like.

> It seems to me that there needs to be a table or something in
> smtpd.conf.

See table(5) under credential tables.

> Could someone explain this example to me, please.
> 
> I'd really like to remove my dunce cap on this one.
> Thanks,
> Chris Bennett
> 
> 
> 

Edgar



Re: Pluses in addresses do not work as expected

2021-01-31 Thread Chris Bennett
On Sun, Jan 31, 2021 at 03:51:01PM +0100, Pascal Huisman wrote:
> Which got me out of the mess. See man smtpd.conf
> It now switches to the user before delivering. So it's not vmail as
> directory owner, but the username who is directory owner. In the trace
> you can see the switch in user in the trace.
> 
> My virtual user config: 
> pascal:someencryptedpasswdhash:pascal:1000:1000:/home/pascal::userdb_ma
> il=maildir:/home/pascal/Maildir
> 

The example in smtpd.conf shows:

action "outbound" relay host smtp+tls://b...@smtp.example.com auth secrts
^^^
Having bob here completely confuses me.
I'm not using this method, but I have to ask the question:
What happens if you have two users, bob and jane? Or a hundred users?
It seems to me that there needs to be a table or something in
smtpd.conf.
Could someone explain this example to me, please.

I'd really like to remove my dunce cap on this one.
Thanks,
Chris Bennett





Re: Pluses in addresses do not work as expected

2021-01-31 Thread Pascal Huisman
Dear Bartalan,

I don't have any troubles:


   mtp: 0xf9fd879e000: STATE_HELO -> STATE_BODY
   <<< [MSG] From: pascal 
   <<< [MSG] Date: Sun, 31 Jan 2021 15:18:06 +0100 (CET)
   <<< [MSG] To: pascal+maill...@pascallen.nl
<<< [MSG] Subject: lalal
<<< [MSG]
debug: 0xf9fd879b000: adding Message-ID
<<< [MSG] lala
<<< [MSG] ...
<<< [MSG] .
<<< [EOM]
debug: 0xf9fd879e000: end of message, error=0
smtp: 0xf9fd879e000: >>> 250 2.0.0 b94f4e11 Message accepted for
delivery
5c4a2ac08812e9f5 smtp message msgid=b94f4e11 size=377 nrcpt=1
proto=ESMTP
5c4a2ac08812e9f5 smtp envelope evpid=b94f4e11b762f5bc from=<
pas...@mail.pascallen.nl> to=
smtp: 0xf9fd879e000: STATE_BODY -> STATE_HELO
debug: scheduler: evp:b94f4e11b762f5bc scheduled (mda)
smtp: 0xf9fd879e000: <<< QUIT
smtp: 0xf9fd879e000: >>> 221 2.0.0 Bye
smtp: 0xf9fd879e000: STATE_HELO -> STATE_QUIT
5c4a2ac08812e9f5 smtp disconnected reason=quit
mda: new user 5c4a2ac289677301 for ":pascal"
debug: lka: userinfo :pascal
debug: control -> client: pipe closed
debug: clearing p=client, fd=12, pid=0
debug: mda: new session 5c4a2ac32f6531e9 for user
":pascal" evpid b94f4e11b762f5bc
debug: mda: no more envelope for ":pascal"
debug: mda: got message fd 12 for session 5c4a2ac32f6531e9 evpid
b94f4e11b762f5bc
debug: mda: querying mda fd for session 5c4a2ac32f6531e9 evpid
b94f4e11b762f5bc
debug: smtpd: forking mda for session 5c4a2ac32f6531e9: pascal as
pascal
debug: mda: got mda fd 13 for session 5c4a2ac32f6531e9 evpid
b94f4e11b762f5bc
debug: mda: end-of-file for session 5c4a2ac32f6531e9 evpid
b94f4e11b762f5bc
debug: mda: all data sent for session 5c4a2ac32f6531e9 evpid
b94f4e11b762f5bc
debug: smtpd: mda process done for session 5c4a2ac32f6531e9: exited
okay
5c4a2ac289677301 mda delivery evpid=b94f4e11b762f5bc from=<
pas...@mail.pascallen.nl> to= rcpt=<
pascal+maill...@pascallen.nl> user=pascal delay=0s result=Ok
stat=Delivered
debug: mda: session 5c4a2ac32f6531e9 done
debug: mda: user "pascal" becomes runnable
debug: mda: all done for user ":pascal"

What I did have problems with. Having virtual users and maildir
delivery in /home/%u was, permissions. Opensmtpd uses 700 with the
vmail user. Where dovecot couldn't read the /home/%u/Maildir directory.
Also sshd requires 700 permissions on /home. So having more lose
permissions was not the option.

I changed this part on your config: maildir
"/var/vmail/%{dest.domain}/%{dest.user:lowercase|strip}" 

to

~/Maildir

Which got me out of the mess. See man smtpd.conf
It now switches to the user before delivering. So it's not vmail as
directory owner, but the username who is directory owner. In the trace
you can see the switch in user in the trace.

My virtual user config: 
pascal:someencryptedpasswdhash:pascal:1000:1000:/home/pascal::userdb_ma
il=maildir:/home/pascal/Maildir

I didn't test this while setting up. Your mail to the list triggered me
to test.

Hope this helps. And good luck with rspamd. I'm switching from
exim/spamassassin and have been watching videos and reading docs for 3
days now. Start simple, test, build out, test, etc.

Pascal.