smtp auth

The forum for help and support with FreeNATS as well as any useful hints and tips
paullanders
Posts: 92
Joined: Thu Sep 04, 2008 9:48 pm

smtp auth

Post by paullanders » Wed May 20, 2009 10:34 pm

Hi Dave. When I stopped receiving email alerts for a few days I discovered that my employer now enforces smtp auth for all outbound mail. :o Although I've now set all 4 smtp variables in System Configuration the alerts are still not being delivered. As an unrelated test I installed and configured sasl auth for Postfix on my Debian box (the one running FreeNATS) and I can send mail just fine from mailx. I'm unsure how to troubleshoot within FreeNATS and did not know if any logs would show the problem.

As always, thanks for your help!

Paul

dave
Site Admin
Posts: 260
Joined: Fri May 30, 2008 9:09 pm
Location: UK
Contact:

Re: smtp auth

Post by dave » Thu May 21, 2009 12:55 pm

Hi Paul,

Ok I have managed to replicate a problem with phpmailer sending via SMTP AUTH to some servers. It seems to be a bug within phpmailer.

The latest dev version now has phpmailer v 5.0.0 which appears to resolve this. I've been testing on UK ISPs etc and all seems fine now. If you continue to have problems I'll setup a SMTP AUTH server as a VM here and play more deeply.

So please try 1.04.3a at http://www.purplepixie.org/freenats/rel ... on=1.04.3a
(direct download link http://www.purplepixie.org/freenats/dow ... .3a.tar.gz )

If you continue to have problems then some logging output will hopefully point the way. To get this do the following:
  • Set the system variable log.level to 10 (to log everything)
    Go into server/bin
    Do: php logwatch.php -l 0 -f > logfile
    Do a mail test or whatever fails
    Control-C the logwatch
    The error should be shown in the logfile on the lines containing Flush:Email
    You will probably want to set log.level back aferward to avoid filling your log table too much
This should give a reasonable(ish) error and I can then try and replicate it again from this end.

Anyway - hope that helps and all is well with you.

Kind Regards,

Dave.

paullanders
Posts: 92
Joined: Thu Sep 04, 2008 9:48 pm

Re: smtp auth

Post by paullanders » Thu May 21, 2009 4:46 pm

Hi Dave.

I updated FreeNATS (only a filesystem update; should I update schema too?) I stopped receiving any alerts so I manually tested:

Code: Select all

sudo php /opt/freenats/server/bin/test-threaded.php 

Warning: require(../base/nats.php): failed to open stream: No such file or directory in /opt/freenats/server/bin/include.php on line 3

Fatal error: require(): Failed opening required '../base/nats.php' (include_path='.:/usr/share/php:/usr/share/pear') in /opt/freenats/server/bin/include.php on line 3
However, I checked and ../base/nats.php does exist.

Thanks!

Paul

dave
Site Admin
Posts: 260
Joined: Fri May 30, 2008 9:09 pm
Location: UK
Contact:

Re: smtp auth

Post by dave » Thu May 21, 2009 4:49 pm

Hi Paul,

When using the relative file locations it can get a bit confusing and take your PWD rather than the script directory.

So try:

cd /opt/freenats/server/bin
sudo php test-threaded.php

And see what happens. As for the schema update if you were running the latest beta release then you should be fine (famous last words!).

Cheers,

Dave.

paullanders
Posts: 92
Joined: Thu Sep 04, 2008 9:48 pm

Re: smtp auth

Post by paullanders » Thu May 21, 2009 5:02 pm

Ah, sorry about that. OK, here is the result now:

Code: Select all

paullanders@koha:/opt/freenats/server/bin$ sudo php ./test-threaded.php 
test-threaded.sh: spawning node tester processes

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /opt/freenats/server/base/nats.db.inc.php on line 89

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /opt/freenats/server/base/nats.db.inc.php on line 84

dave
Site Admin
Posts: 260
Joined: Fri May 30, 2008 9:09 pm
Location: UK
Contact:

Re: smtp auth

Post by dave » Thu May 21, 2009 5:11 pm

Paul,

I don't think any nodes are due to be tested perhaps?

Can you just try a "test" from the alert action? Try this with the logging script running I mentioned and see what happens.

Cheers,

Dave.

paullanders
Posts: 92
Joined: Thu Sep 04, 2008 9:48 pm

Re: smtp auth

Post by paullanders » Thu May 21, 2009 5:32 pm

Code: Select all

11:24:01 21/05/2009     2       DB:Query        Query Failed: SELECT nodeid FROM fnnode WHERE nodeenabled>0 AND masterid="" ORDER 
BY weight ASC
11:24:01 21/05/2009     2       DB:Query        Query Error: Unknown column 'masterid' in 'where clause' (1054)
11:25:01 21/05/2009     2       DB:Query        Query Failed: SELECT nodeid FROM fnnode WHERE nodeenabled>0 AND masterid="" ORDER 
BY weight ASC
11:25:01 21/05/2009     2       DB:Query        Query Error: Unknown column 'masterid' in 'where clause' (1054)
11:26:01 21/05/2009     2       DB:Query        Query Failed: SELECT nodeid FROM fnnode WHERE nodeenabled>0 AND masterid="" ORDER 
BY weight ASC
11:26:01 21/05/2009     2       DB:Query        Query Error: Unknown column 'masterid' in 'where clause' (1054)
11:27:01 21/05/2009     2       DB:Query        Query Failed: SELECT nodeid FROM fnnode WHERE nodeenabled>0 AND masterid="" ORDER 
BY weight ASC
11:27:01 21/05/2009     2       DB:Query        Query Error: Unknown column 'masterid' in 'where clause' (1054)
11:28:01 21/05/2009     2       DB:Query        Query Failed: SELECT nodeid FROM fnnode WHERE nodeenabled>0 AND masterid="" ORDER 
BY weight ASC
11:28:01 21/05/2009     2       DB:Query        Query Error: Unknown column 'masterid' in 'where clause' (1054)
I noticed the new "Master Node" option in node configurations, so does this imply I need to do a schema upgrade?

Paul

dave
Site Admin
Posts: 260
Joined: Fri May 30, 2008 9:09 pm
Location: UK
Contact:

Re: smtp auth

Post by dave » Thu May 21, 2009 5:37 pm

CRAPIOLA! Je suis une IDIOITE!!

Yes - absolutely!!

Sorry!!

FYI you can manually do it with just a:

mysql -u USERNAME -pWHATEVER --force DATABASENAME < schema.upgrade.sql

Totally forgot masters hadn't made it into the beta yet.

ARGH!

Cheers,

Dave.

paullanders
Posts: 92
Joined: Thu Sep 04, 2008 9:48 pm

Re: smtp auth

Post by paullanders » Thu May 21, 2009 9:25 pm

Hi Dave, here's where I stand:

Code: Select all

# php tester.php test_node
This sucessfully tests the node and fires an alert.

Code: Select all

koha:/opt/freenats/server/bin# php ./test-threaded.php
test-threaded.sh: spawning node tester processes
No output to the console (I think it usually lists all nodes as they are tested?) and the only entries in my logfile reference the 2 node-side tests.

It's like the "node enabled" setting is ignored on all nodes.

UPDATE - I discovered that although "node enabled" is already checked on all my nodes, if I simply click the "Save Node Settings" nothing happens visually but it magically begins testing that node! Any ideas on that? I left 5 of my nodes in the "unfixed" state in case you need me to help troubleshoot the issue.

Thanks!

Paul

paullanders
Posts: 92
Joined: Thu Sep 04, 2008 9:48 pm

Re: smtp auth

Post by paullanders » Thu May 21, 2009 11:05 pm

Hi Dave.

We kinda got sidetracked from the smtp issue. ;)

1. Currently if an alert is destined for an email address on our network it delivers fine. (The new smtp policies here will allow delivery without authentication if the recipient is within our domain. Outside our domain requires smtp authentication.)

2. If it is destined for a single address outside our domain, FreeNATS produces a small white bar at the top of the current window that says "SMTP Error: The following recipients failed: j.paul.landers@greatdomain.com "

3. If an alert has 2 email addresses separated by a comma, the alert produces the thin white line at the top of the current screen that says "Invalid address: paul.landers@greatdomain.com,dennis.crisp@greatdomain.com You must provide at least one recipient email address."

Thanks, Dave.

Post Reply