Forum OpenACS Q&A: Re: Sending Emails via SMTP port 587

Collapse
Posted by Tyge Cawthon on

Thank you for your feedback.

I misunderstood how to use the command line version_ns=GIT

Using the example provide on the OpenACS website, and from a fresh install, I executed the following command.

[root@install-ns]# version_ns=GIT  \
build_dir=/usr/local/src/modules/nssmtpd \
ns_modules=”nssmtpd” \
bash install-ns.sh build

This is the message from that execution:

Already on 'main'
Your branch is up to date with 'origin/main'.
Cloning into '”nssmtpd”'...
remote: Repository not found.
fatal: repository 'https://github.com/naviserver-project/”nssmtpd”/' not found

Hence, the question "how to properly create the nssmtpd.so file"

I did test your command from a fresh install. The results worked perfectly.

[root]# ns_modules="nsdbpg nssmtpd" bash install-ns.sh build

nssmtpd.so fixed. Thank you.

We are still having configuration issues. We have tried a number of things with no success.

Our setup is.
Two physical servers, about 300 miles from apart each other.

  1. OpenACS server
  2. actual Email server

OpenACS is configured as follows:

ACS Mail Services Lite  Parameter
Rollout support - 
EmailDeliveryMode - changed from default to nssmtpd

This is the only change done in ACS Mail Services Lite GUI

/usr/local/ns/config.tcl
lines we changed
    smtpdport   587
#
# Sample configuration for the nssmtpd module.
#
# To use this, it is necessary to install the NaviServer nssmtpd
# module first, and to provide a nonempty "smtpdport" below, and set
# the package parameter "EmailDeliveryMode" in the acs-mail-lite
# package to "nssmtpd". See: https://openacs.org/xowiki/outgoing_email
#
# 
ns_section "ns/server/${server}/module/nssmtpd" {
    ns_param port $smtpdport
    ns_param address 127.0.0.1
    ns_param relay localhost:25
    ns_param spamd localhost
    ns_param initproc smtpd::init
    ns_param rcptproc smtpd::rcpt
    ns_param dataproc smtpd::data
    ns_param errorproc smtpd::error
    ns_param relaydomains "localhost"
    ns_param localdomains "localhost"
    
    #
    # Next section is for STARTTLS functionality:
    #
    #ns_param certificate "pathToYourCertificateChainFile.pem"
    #added by Tyge
    #ns_param certificate "${serverroot}/etc/certfile.pem" 
    ns_param certificate "/var/www/oacs-5-10-0/etc/certfile.pem"    
    #ns_param cafile ""
    #ns_param capath ""
    #ns_param ciphers "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-CHACHA20-POLY1305"

    ns_param logging on ;# default: off
    ns_param logfile ${logdir}/smtpsend.log
    ns_param logrollfmt %Y-%m-%d ;# format appended to log filename
    #ns_param logmaxbackup 100 ;# 10, max number of backup log files
    #ns_param logroll true ;# true, should server log files automatically
    #ns_param logrollonsignal true ;# false, perform roll on a sighup
    #ns_param logrollhour 0 ;# 0, specify at which hour to roll
}

ns_section ns/server/${server}/modules {
    if {$smtpdport ne ""} {ns_param nssmtpd nssmtpd}
}

We changed ns_param address and ns_param port to the public ip and port of the mail server and tried various combinations of the mail servers domain in relaydomains, localdomains, and relay but always get an error.

/var/www/oacs-5-10-0/log/error.log

Error: Ns_SockBinderListen: sendmsg() failed: sent 53 bytes, 'Cannot assign requested address'
Error: nssmtpd:0: failed to listen on ip-address:port: Cannot assign requested address

where ip-address and port are from ns_param address and ns_param port

smtpsend.log

-conn:oacs-5-10-0:default:0:3- 000 CONNECT_FAILURE [localhost]:25 1.405307 0 bounce340288.40686728395.1-892+1742590661+17483600470EE754FB7CC497100117047873E3C9@celtic-arts.org> RCPT: xxxx@labmaster.com

We do not know where "[localhost]:25" is coming from. We ended up modifying each of the ns_params (relay, spamd, relaydomains, etc) to see what would make a difference, but it did not change the error message