roehling / postsrsd

Postfix Sender Rewriting Scheme daemon
326 stars 39 forks source link

Connection refused after upgrade to 2.0 #164

Closed ghost closed 1 year ago

ghost commented 1 year ago

Dear all

I've been using postsrsd for some years now, but somehow I can't get version 2.0 running with my setup.

The FreeBSD server has some aliases in /etc/aliases: other_user_at_gmail.com: "|/usr/local/bin/postforward.py other.user@gmail.com"

My Python script was used to connect to the postsrsd daemon via port 10001. But now it fails with Traceback (most recent call last): File "/usr/local/bin/postforward.py", line 92, in <module> main() File "/usr/local/bin/postforward.py", line 73, in main SRSReturnPath = _getSRSReturnPath(returnPath, SRSHOST, SRSPORT) File "/usr/local/bin/postforward.py", line 40, in _getSRSReturnPath sock.connect((SRSHOST, SRSPORT)) ConnectionRefusedError: [Errno 61] Connection refused

Is this kind of setup no longer supported? Or am I missing something?

Cheers

roehling commented 1 year ago

Quoting the README.rst:

Be aware that PostSRSd 2.x uses socketmap: tables, which are NOT compatible with tcp: tables.

Your setup can still work, but you need to communicate with a different protocol. This is also why I deliberately changed the default port. As you are using Python, you may find the read_netstring and write_netstring functions in tests/blackbox/socketmap.py helpful.

ghost commented 1 year ago

Thanks a lot! I thought this change just impacted the communication between Postfix and postsrsd. I'll fix my script accordingly.