#!/bin/sh . /usr/local/etc/dropbox.conf date_hash=`date2hash ${date_today}` # Give qmail a chance to deliver its mail unset secret1; while [ -z "${secret1}" ]; do secret1="`/usr/bin/head -c 256 /dev/urandom | dropbox_hash_command`" [ -e ${dropbox_mail_dir}/${date_hash}/${secret1}/ ] && unset secret1 done mkdir -p ${dropbox_mail_dir}/${date_hash}/${secret1}/ touch ${dropbox_mail_dir}/${date_hash}/${secret1}/Mailbox # Give lighty a chance to find that mail unset secret2; while [ -z "${secret2}" ]; do secret2="`/usr/bin/head -c 256 /dev/urandom | dropbox_hash_command`" [ -e ${dropbox_mail_dir}/${date_hash}/${secret2}/ ] && unset secret2 done ln -s ${dropbox_mail_dir}/${date_hash}/${secret1} ${dropbox_mail_dir}/${date_hash}/${secret2} # calculate mailbox url case "${SERVER_PORT}" in "444") mailbox_hostname=${dropbox_hostname_444} ;; "442") mailbox_hostname=${dropbox_hostname_442} ;; *) mailbox_hostname=${dropbox_hostname} ;; esac # localize lang=${0%/index.sh} lang=${lang##*/} unset language; for l in ${localize_known_languages}; do [ "${lang}" = "${l}" ] && language=${l}; done [ -z "${language}" ] && language=en eval localize_xx_about_us=\"\$localize_${language}_about_us\" eval localize_xx_documentation=\"\$localize_${language}_documentation\" eval localize_xx_url=\"\$localize_${language}_url\" eval localize_xx_author=\"\$localize_${language}_author\" eval localize_xx_expire=\"\$localize_${language}_expire\" eval localize_xx_email=\"\$localize_${language}_email\" # pretend to be a cgi echo "HTTP/1.0 200 OK" echo "Content-Type: text/html" echo echo "" echo "" echo "" echo "
" echo "${secret1}@${date_hash}.${dropbox_hostname}
${date_tomorrow} 11:59 p.m.