On 10.07.23 01:17, Robert Senger via Postfix-users wrote:
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...
I don't think so. It the recipient is remote, you don't need to
check/expand their username as theit homedirectory and SA settings aren't
available locally. Verification is (or may be) available via postfix.
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,
you should be able to use postconf for getting virtual_alias_maps or
alias_maps content and postmap to do the expansion within those two.
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.
great for you.
Am Donnerstag, dem 29.06.2023 um 17:21 +0200 schrieb Robert Senger via
Postfix-users:
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.
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
--
Matus UHLAR - fantomas, uh...@fantomas.sk ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
Eagles may soar, but weasels don't get sucked into jet engines.
_______________________________________________
Postfix-users mailing list -- postfix-users@postfix.org
To unsubscribe send an email to postfix-users-le...@postfix.org