Forum OpenACS Q&A: Bad sender address syntax - postfix

Collapse
Posted by Archie Spinos on
Good day,

I have setup postfix and can send emails using the mail cmd client.
When I try to send notifications with openacs mail lite through the postfix it fails. In the mail log I can see that the sender is not being passed from the app to postfix correctly so it fails. Some extracts showing the issue:

input attribute name: address
input attribute value: mailto:-624-FB3F54A2D2B19745C7A852AE694A5D08CAD0A8D3-21457@mydomain.net
private/rewrite socket: wanted attribute: (list terminator)
input attribute name: (end)
rewrite_clnt: local: mailto:-624-FB3F54A2D2B19745C7A852AE694A5D08CAD0A8D3-21457@mydomain.net -> mailto:-624-FB3F54A2D2B19745C7A852AE694A5D08CAD0A8D3-21457@mydomain.net
event_request_timer: reset 0x8a124e 0x10a64a0 5
send attr request = resolve
send attr sender =
send attr address = mailto:-624-FB3F54A2D2B19745C7A852AE694A5D08CAD0A8D3-21457@mydomain.net

resolve_clnt: ' ->mailto:-624-FB3F54A2D2B19745C7A852AE694A5D08CAD0A8D3-21457@mydomain.net'; -> transp=relay-smtps' host=[box455.bluehost.com]:465' rcpt=`mailto:-624-FB3F54A2D2B19745C7A852AE694A5D08CAD0A8D3-21457@mydomain.net'; flags=error class=local

ctable_locate: install entry key mailto:-624-FB3F54A2D2B19745C7A852AE694A5D08CAD0A8D3-21457@mydomain.net

warning: Illegal address syntax from localhost[127.0.0.1] in MAIL command: mailto:-624-FB3F54A2D2B19745C7A852AE694A5D08CAD0A8D3-21457@mydomain.net

extract_addr: in: mailto:-624-FB3F54A2D2B19745C7A852AE694A5D08CAD0A8D3-21457@mydomain.net, result: mailto:-624-FB3F54A2D2B19745C7A852AE694A5D08CAD0A8D3-21457@mydomain.net

localhost[127.0.0.1]: 501 5.1.7 Bad sender address syntax

This happens even though I specify in the app sender address = mailto:user@mydomain.net

Any ideas on how to get past this? Should I make use of generic maps to translate all incoming emails to a specific email known to postfix server and if yes how?

Many thanks

Collapse
Posted by Gustaf Neumann on
Hi Archie,

i am not sure, what the problem might be. However, i would recommend to separate mail with notification issues. You can test the acs-mail to postfix interface with a command like the following from the developer shell (ds/shell):

acs_mail_lite::send_immediately -to_addr SOMEADDRESS -from_addr SOMEADDR -subject hi -body "What's up?"
If this works, then the problem is somewhere in the addressed generated by the notification clients.

What version of OpenACS are you using?

Best regards
-gn

Collapse
Posted by Archie Spinos on
Good morning Gustaf,

When I executed above from ds/shell I got the following:

ERROR:

while executing
"ad_raise notfound"
(procedure "rp_serve_abstract_file" line 32)
invoked from within
"rp_serve_abstract_file "$root/$extra_url""
("uplevel" body line 2)
invoked from within
"uplevel $code"
invoked from within
"smtp::sendmessage ::mime::1 -originator mailto:-39401-548F4F5D60BC43C5F4574227E008F1E64438A387-21457@mydomain.net -header {From mailto:root@mydomain.net} -heade..."
("eval" body line 1)
invoked from within
"eval $cmd_string"
(procedure "acs_mail_lite::smtp" line 30)
invoked from within
"acs_mail_lite::smtp -multi_token $tokens -headers $headers_list -originator $originator"
(procedure "acs_mail_lite::send_immediately" line 155)
invoked from within
"acs_mail_lite::send_immediately -to_addr mailto:ee1ads@yahoo.co.uk -from_addr mailto:root@mydomain.net -subject hi -body "What's up?""
("uplevel" body line 1)
invoked from within
"uplevel 1 [string map {"\\\r\n" " "} $script

How can I find the OpenACS version (I inherited the support so not very knowledgeable yet.)

Thanks

Collapse
Posted by Gustaf Neumann on
That's weird ...but it shows that the problem is in acs-mail-lite. You have definitely some older version installed, since the traceback above shows that "acs_mail_lite::smtp" calls "eval $cmd_string", which is not the case in current versions, which use a catch operation [1]. The "originator" field causing the problem is determined in [2] and passed as last argument to "acs_mail_lite::smtp" and uses "acs_mail_lite::bounce_address".

It looks to me, as if in your installation, the bounce prefix (parameter EnvelopePrefix of package acs-mail-lite) is not set correctly (look under /acs-admin, you can see/change the parameters of the installed services there). The parameter should have a value like e.g. "bounce".

The versions of OpenACS and the installed packages are listed by the package manager (/acs-admin/apm/). For OpenACS, this looks currently like the image below.

Hope this helps
-g

[1] https://openacs.org/api-doc/proc-view?proc=acs_mail_lite%3a%3asmtp&source_p=1
[2] https://openacs.org/api-doc/proc-view?proc=acs_mail_lite%3a%3asend_immediately&source_p=1

Collapse
Posted by Archie Spinos on
Gustaf,

I had actually left the EnvelopePrefix blank, and your answer led me there.

Many thanks,

Much appreciated

Archie