[pfx] SASL auth failure

2023-07-09 Thread Patrick Mahan via Postfix-users
OS: FreeBSD (13.2-RELEASE FreeBSD 13.2-RELEASE
releng/13.2-n254617-525ecfdad597 GENERIC amd64)
Postfix: 3.7.4

Mail client: Thunderbird 102.13.0 (Mac OSX)

Thanks for the help in recovering my Postfix configuration and setup, it
has been running fairly smoothly, but for one item: submissions.

When I attempt to email from my thunderbird mail client, it simply hangs
and I am seeing the following error message on the console -

Jul  9 12:03:37 ns postfix/submissions/smtpd[19404]: fatal: no SASL
authentication mechanisms

Looking at /var/log/maillog for further details I see -

Jul  9 12:03:37 ns postfix/submissions/smtpd[19404]: SSL_accept:TLSv1.3
early data
Jul  9 12:03:37 ns postfix/submissions/smtpd[19404]: SSL_accept:SSLv3/TLS
read finished
Jul  9 12:03:37 ns postfix/submissions/smtpd[19404]:
crowtrobot[23.24.207.146]: Reusing old session (RFC 5077 session ticket)
Jul  9 12:03:37 ns postfix/submissions/smtpd[19404]: Anonymous TLS
connection established from crowtrobot[23.24.207.146]: TLSv1.3 with cipher
TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature
ECDSA (P-256)
Jul  9 12:03:37 ns postfix/submissions/smtpd[19404]: fatal: no SASL
authentication mechanisms
Jul  9 12:03:38 ns postfix/master[63473]: warning: process
/usr/local/libexec/postfix/smtpd pid 19404 exit status 1

Here is my submission configuration from master.cf -

submission inet n   -   n   -   -   smtpd
  -o syslog_name=postfix/submissions
  -o smtpd_tls_security_level=encrypt
  -o tls_preempt_cipherlist=yes

I have cyrus SASL installed and dovecot has been compiled with that
support  -

root@ns:/mnt/oldsysusr/local/etc # postconf -a
cyrus
dovecot
root@ns:/mnt/oldsysusr/local/etc # postconf -A
cyrus

However, in my postfix main.cf, I have smtpd_sasl_path set to -

smtpd_sasl_path = private/auth

When according to TLS_README it should be -

smtpd_sasl_path = smtpd

But my previous setup was working with this configuration, but now it is
failing.  So I have obviously gone astray and any pointers as to where to
begin my re-education is appreciated.

Also, it may be that I need to talk to the FreeBSD community.

Thanks,

Patrick
___
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org


[pfx] Re: Postfix "sendmail -bv" command: Trouble with spamassassin and virtual_aliases

2023-07-09 Thread Robert Senger via Postfix-users
Thanks to all of you for your tips and advices!

This turned out to be far more complicated than I thought...

I am staying with spamass-milter and bash scripting for the moment (but
implemented all of your programming advices), it's a testing
environment only. I'll have a look at amavis as well as going on with
python or so.

What makes it even more complex is that I need to take into account not
only virtual_mailbox_maps and virtual_alias_maps (which could _and_do_
include regex and mailman aliases), but also relay_recipient_maps if
the system is a backup mx...

However, I created a script that does what I need it to do. It's not a
perfect solution, but at least quite okay. For now, it needs to know
whether an address was found in virtual_mailbox_maps, is a static or
regex alias in virtual_alias_maps or a mailing list alias. So I can't
use postconf, but have to configure the script to my needs. And it's
able to cope with multiple recipients, and aliases expanding to
multiple addresses/aliases. 

For the moment, I am happy with that ;)

Best regards,

Robert


Am Donnerstag, dem 29.06.2023 um 17:21 +0200 schrieb Robert Senger via
Postfix-users:
> Hi all!
> 
> I am running Postfix 3.4.23 on Debian 10.13 Buster, with SpamAssassin
> 4.0.0 and spamass-milter 0.4.0-2 for spam detection.
> 
> Until now, SpamAssassin was configured to use system wide bayes
> database for the bayesian classifier, which is trained by both sa's
> autolearn feature and by sa-learn called every time when users move
> mails into or out of their Spam folders in dovecot.
> 
> Now I'd like to switch to user specific bayes databases stored in
> mysql. Basically, this works. But I am facing problems when static
> virtual_aliases or even virtual_aliases defined as regular
> expressions
> (to enable throw-away wildcard addresses like
> ) come into play.   
> 
> The point is that spamassassin needs to know the username when
> processing an email, to update the correct bayes database. The
> username
> given to spamassassin by spamass-milter is the email address of the
> recipient. This is fine, as long as an email is sent to the (real)
> virtual user. But for any email sent to an alias, spamassassin gets
> the
> alias address rather than the (real) username, and creates bayes
> databases for every alias or evan wildcard address, which is not
> desired.
> 
> Now, I've figured out that spamass-milter has an option to run
> "sendmail -bv" command, to expands aliases to the real username, and
> extract the expanded username from the output of that command. Cool
> ;)
> 
> But postfix' "sendmail -bv" command behaves different from the
> original. It does not write its results to stdout, but sends an email
> to the calling user. This breaks the expansion of virtual_aliases...
> 
> Of course, I could write my own "sendmail" script which takes the
> virtual_alias, calls mysql, returns sendmail compatible output to
> spamass-milter, and give this script as "path to sendmail" to
> spamass-
> milter... This is what I did now (see below), and it works. But this
> is, to be honest, a really dirty hack, and I must say that I don't
> really know what I am doing here... at least I do not know if I open
> any bad security holes by passing arguments into mysql without any
> checks...
> 
> So, my question is, is there another possibility to expand virtual
> aliases to real virtual user names prior to running milters?
> 
> Thanks for help, and sorry if the text above is a bit confuse...
> 
> Regards,
> 
> Robert
>  
> This is my "sendmail -bv" substitute:
> 
> #!/bin/bash
> user=`echo "$2" | sed 's/[<>]//g'`
> ret=`echo "select destination from virtual_aliases where
> source=\"$user\";" | /usr/bin/mysql -upostfix -psecretpassword
> mailserver | tail -n 1`
> if [ -z "$ret" ]; then
>     echo "nobody... deliverable: mailer local, user $user"
> else
>     echo "nobody... deliverable: mailer local, user $ret"
> fi
> 

-- 
Robert Senger



___
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org