<email@example.com> (expanded from <firstname.lastname@example.org>): host
mx.poczta.onet.pl[18.104.22.168] said: 554 5.7.1 <email@example.com>:=
Recipient address rejected: Spf check: fail (in reply to RCPT TO command)
If you think for a moment the reason for error it's obvious. My server tried to forward e-mail using original From address.Onet.pl checked TXT record (using SPF standard) for my server domain myserver.com and noticed it's not allowed to send e-mails from me.
In order to make things work properly one have to rewrite envelope From field properly. Mailing list managers usually do that properly (/etc/aliases is not enough).
I wanted to make minimal and fast deployment of SMTP-only mail list manager. I selected smartlist because of it's simplicity. Firstly you have to install the software:
# apt-get install smartlist
Then you have to redirect two e-mail addresses: firstname.lastname@example.org and email@example.com to smartlist program (flist):
# cat >>/etc/aliases <<EOF
mylist: "|/var/list/.bin/flist mylist"
mylist-request: "|/var/list/.bin/flist mylist-request"
After that anyone can subscribe to the list using firstname.lastname@example.org.
If you want to initially populate mailing list (the mailing list is closed for example) it's very easy:
# su list
$ cd cd /var/list/mylist
$ cat >> dist <<EOF