View Single Post
Old 23rd November 2009, 07:19
almeister9 almeister9 is offline
Join Date: Sep 2008
Posts: 36
Thanks: 6
Thanked 3 Times in 3 Posts
Default The Ultra Elusive pure-uploadscript(8)

I have now started again from scratch.
I have an Ubuntu 9.04 32-bit server as Falko's:
up to stage 10.
with a working Pure-ftpd server as per Falkos:

I then installed ssmtp:
sudo apt-get install ssmtp

and configured:
sudo vi /etc/ssmtp/ssmtp.conf

Then by typing into terminal:
ssmtp and hitting enter, then
Subject: test email

hello world!

and then crtl+D it successfully sends a mail via my gmail account.

I edit Pure-ftp conf file:
vi /etc/default/pure-ftpd-common

and make sure option "STANDALONE_OR_INETD" is "STANDALONE"
(because it said to on the man page)
All that above I got from one of the very few sources I could find on the internet and it basically said "then create a script that does something useful and you are done.
This did not eaxctly help me.
I persisted:
vi /usr/local/sbin/
#! /bin/sh
echo "$1 uploaded" | ssmtp
Subject: New File Uploaded

"$1 uploaded"
No Dice
I found another source that gave a small amount of help:
which said:
Step 6: Check if the daemon really run with the new options. (Doesn't say how)
root 18623 0.0 0.0 12120 868 ? Ss 19:39 0:00 pure-ftpd (SERVER) www-data 18671 0.0 0.0 11912 672 ? Ss 19:40 0:00 /usr/sbin/pure-uploadscript -r /usr/local/sbin/ -B -u 33 -g 33
Don't know what that means
Step 7: Create a test script. E.g. this one will write the filename to a file called /tmp/pure-was-here<datestamp>.
#!/bin/sh echo "$1" > /tmp/pure-was-here$(date +%Y%m%d%H%M%S)
Step 8: Test the script, log in via ftp and upload a file:
I tried that and uploaded a file but the file in /TEMP/ doesn't get created.

I have read the man page for pure-uploadscript over and over but it doesn't seem to tell me how to do anything, just what it can do.

I assume that what I need to do now is:
1). Learn how to create a shell script and then place it somewhere and tell the conf page where it is (UPLOADSCRIPT=)
2). Learn how to get said shell script to use ssmtp to send an email using the available things passed from uploadscript ($1 and others ???)
3). Prey that it works because if it doesn't I have no where to turn.

I feel I am so close now,

Any help that any kind soul could lend me would be greatly appreciated.

Cheers Al.
Reply With Quote