[ZendTo] autodropoff

Jules Jules at Zend.To
Sun Mar 15 14:36:42 GMT 2020


Kevin,

Firstly, the 'authIMAP' configuration is nothing to do with the 
'automation' features at all. It's just an alternative means of 
authenticating users, like LDAP, AD or local accounts.
So ignore all the IMAP stuff, that's a red herring. I suspect my 
"upgrade" script accidentally rearranged the comments in your 
preferences.php at some point, so they appear next to each other.

In /opt/zendto/bin there are a few "auto..." scripts. These are nothing 
more than simple bash scripts. Most of the code in them is spent 
processing and checking the command-line options. That's the boring bit.

The juicy bit is right near the bottom. All the scripts actually do is 
collect together all the command-line options and turn them into the 
parameters needed by "curl" in order to do a single HTTP GET or POST 
request. That single call to curl does the entire login / pass info / 
upload files operation in 1 hit.

So you need to create an AD user called "apiuser" or whatever, with a 
password that is passed along with everything else on the "autodropoff" 
command-line (for example).

The point of the scripts such as autodropoff is that you can run them on 
any Linux/UNIX box, they don't need to be run on the ZendTo server at 
all; and that they are trivial to re-code into any other language or 
operating system you want. They are really just a reference 
implementation to show you how to drive ZendTo programmatically. It was 
easiest for me to write that reference code in bash/curl.
So a Powershell or C#.Net version of those scripts, to be run on a 
Windows server, should be a quick and easy thing to write. It's just a 
big HTTPRequest. Along with the other auto... scripts in /opt/zendto/bin.

Does that help explain it?

Cheers,
Jules.

On 11/03/2020 23:25, Kevin Miller via ZendTo wrote:
> One of the departments that use Zendto here want to automate drop-offs.  They're windows centric and don't have any accounts on my Zendto server.  They access it via the authLDAPmumble settings with the authenticator set to "AD".  A brief description of what they want to accomplish follows:
>
> "Something that would allow us to copy and send from there programmatically...  We have an application we use that has templates that can be used with API's or web services.   We are having to store all the information in a "repository" and it would be easier if we could just click a Send via ZendTo process instead of them pulling the info from the repository and copying it to ZendTo via the web portal."
>
> I see in conf.php the following automation settings:
>
>    // You can list multiple usernames here. So different teams using the
>    // scriptable requests could be done with different "system accounts" to
>    // aid later diagnosis of problems as ZendTo will log the requests
>    // against this username.
>    'automationUsers' => array('apiuser'),
>    'authIMAPServer' => 'mail.soton.ac.uk',
>    'authIMAPDomain' => 'soton.ac.uk',
>    'authIMAPOrganization' => 'University of Southampton',
>    'authIMAPAdmins' => array(),
>
> Obviously I'll have to change them to match my network.  Internally we have an Exchange server, which can do IMAP.  We have several MailScanner gateways for inbound mail from the internet, and another MailScanner box which our internal printers/scanners send to and which acts as our outbound email server.  It will relay internal traffic to Exchange and accept/relay mail for the internet from Exchange.
>
> So do I need to create user in AD called (per the example above) "apiuser" which is then authenticated via arguments passed on the CLI to the autodropoff script?  If not in AD, then where?  On the Zendto box as a local account?
>
> How would my users run autodropoff?  They don't have local accounts on the Zendto box - what mechanism would they use to call the script and pass parameters?
>
> Thanks.  I'm sure there are questions I haven't thought to ask yet so please chime in with any pearls of wisdom if you've already been down this road...
>
> ...Kevin
> --
> Kevin Miller
> Network/email Administrator, CBJ MIS Dept.
> 155 South Seward Street
> Juneau, Alaska 99801
> Phone: (907) 586-0242, Fax: (907) 586-4588 Registered Linux User No: 307357
>
>
>
> _______________________________________________
> ZendTo mailing list
> ZendTo at zend.to
> http://jul.es/mailman/listinfo/zendto

Jules

-- 
Julian Field MEng CEng CITP MBCS MIEEE MACM

'Solutions nearly always come from the direction you least expect, which
  means there's no point trying to look in that direction because it won't
  be coming from there.' - Douglas Adams

www.Zend.To
Twitter: @JulesFM

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://jul.es/pipermail/zendto/attachments/20200315/2ee4b96e/attachment.html>


More information about the ZendTo mailing list