<firstname.lastname@example.org> (expanded from <email@example.com>): host
mx.poczta.onet.pl[18.104.22.168] said: 554 5.7.1 <firstname.lastname@example.org>:=
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: email@example.com and firstname.lastname@example.org 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 email@example.com.
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