[Sussex] Automated FTP

Jon Fautley jon at geekpeople.net
Sun Jul 11 16:55:21 UTC 2004


Nicholas Butler wrote:
> Well thats been a diversion. Looking at this from a MAIL TRANSFER AGENT 
> ( e.g. the exim, Sendmail, Postfix ) point of view its clear that they 
> really dont want to muck about with content.

Indeed - one large message and you can kill the MTA..not good :|

>  From a Mail User Agent Point of View, following delivery to an account 
> by a MTA ( see above ) then its possible to view the whole Mail Box ( 
> either as one file MBOX or multiple files MailDir ) as a file which can 
> be parsed by scripts, programs and the rest.
> 
> I did discover the PIPE command in the exim filter which let me build 
> something like if $h_subject contains "test" then pipe "somemimedecoder 
> -d outputdir " this then would put a file to be uploaded somewhere, so 
> it kinda cracked that nut, though im not sure how much of a good ide it 
> is enabling a mail agent to indiscrimately accept files to upload to a 
> destination.

It's the same system blogger use for remote blog updates - you specify a 
'secret' code, that only you know, then email 
username-secretcode at blogger.com, and the entry is added to your blog. 
Nice and simple.

Personally, you could look at using Perl w/Net::FTP, and then using the 
system aliases file, you can create an alias, say, 
filbert-rules at geekpeople.net, where the aliases file reads 
"|/usr/bin/upload.pl to.this.site" - but you'd need to write the app in 
perl, then deal with the de-miming, etc... quite complicated, but it 
could be done :)

Jon




More information about the Sussex mailing list