#include #include #include int main( int args, char **argv ) { char *local = argv[1], *dash; char dropbox_mail_dir[ 1024 ]; struct stat sb; if( !local ) return 100; snprintf( dropbox_mail_dir, sizeof( dropbox_mail_dir ) - 1, "/var/www/mail/incoming/%s/", local ); dash = strchr( dropbox_mail_dir, '-' ); if( dash ) { *dash = '/'; if( !stat( dropbox_mail_dir, &sb ) && ( sb.st_mode & S_IFDIR ) ) { printf( "www%c80%c80%c%s%c%c%c", 0, 0, 0, dropbox_mail_dir, 0, 0, 0 ); return 0; } } printf( "www%c80%c80%c/var/www/mail/spam/%c%c%c", 0, 0, 0, 0, 0, 0 ); return 0; }