diff --git a/etc/postfix/main.cf b/etc/postfix/main.cf index 4e7436f..ea85cbb 100644 --- a/etc/postfix/main.cf +++ b/etc/postfix/main.cf @@ -41,7 +41,7 @@ inet_protocols = all #relay_domains = onion relay_domains = !dhosting4okcs22v.onion onion lelantos.org mail2tor.com anoninbox.net anonplus.org o3mail.org volatile.ch danwin1210.me home_mailbox = Maildir/ -canonical_maps = regexp:/etc/postfix/canonical +canonical_maps = proxy:mysql:/etc/postfix/sql/alias.cf regexp:/etc/postfix/canonical ignore_mx_lookup_error = yes always_add_missing_headers = yes message_drop_headers = bcc content-length resent-bcc return-path x-mailer received x-originating-ip x-original-to user-agent diff --git a/etc/postfix/sender_login_maps b/etc/postfix/sender_login_maps index 15a7fbc..3918fc1 100644 --- a/etc/postfix/sender_login_maps +++ b/etc/postfix/sender_login_maps @@ -1 +1,2 @@ /(.*)@dhosting4okcs22v.onion/ $1@dhosting4okcs22v.onion +/@([a-z2-7]{16}).onion/ $1.onion@dhosting4okcs22v.onion diff --git a/etc/postfix/sql/alias.cf b/etc/postfix/sql/alias.cf new file mode 100644 index 0000000..7f3bae5 --- /dev/null +++ b/etc/postfix/sql/alias.cf @@ -0,0 +1,5 @@ +user = postfix +password = MY_PASSWORD +hosts = localhost +dbname = hosting +query = SELECT '%d@dhosting4okcs22v.onion' FROM users WHERE '%d' = CONCAT(onion, '.onion') diff --git a/var/www/cron.php b/var/www/cron.php index 0424ec4..6bcf3dc 100644 --- a/var/www/cron.php +++ b/var/www/cron.php @@ -69,7 +69,7 @@ chdir = / pm = ondemand pm.max_children = 8 pm.process_idle_timeout = 10s; -php_admin_value[sendmail_path] = '/usr/bin/php /var/www/sendmail_wrapper.php \"$onion <$onion.onion@" . ADDRESS . ">\" | /usr/sbin/sendmail -t -i' +php_admin_value[sendmail_path] = '/usr/bin/php /var/www/sendmail_wrapper.php \"$onion.onion <$onion.onion@" . ADDRESS . ">\" | /usr/sbin/sendmail -t -i' php_admin_value[memory_limit] = 128M php_admin_value[disable_functions] = pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,exec,passthru,shell_exec,system,popen,proc_open,socket_listen,socket_create_listen,socket_bind,stream_socket_server,fsockopen,pfsockopen,posix_kill,php_uname,link,symlink,posix_uname php_admin_value[open_basedir] = /home/$onion.onion @@ -101,7 +101,7 @@ php_admin_value[session.save_path] = /home/$onion.onion/tmp chgrp("/var/lib/tor-instances/$firstchar/hidden_service_$onion.onion/private_key", "_tor-$firstchar"); //add hidden service to torrc $torrc=file_get_contents("/etc/tor/instances/$firstchar/torrc"); - $torrc.="HiddenServiceDir /var/lib/tor-instances/$firstchar/hidden_service_$onion.onion/\nHiddenServicePort 80 127.0.0.1:80\n"; + $torrc.="HiddenServiceDir /var/lib/tor-instances/$firstchar/hidden_service_$onion.onion/\nHiddenServicePort 80 127.0.0.1:80\nHiddenServicePort 25 127.0.0.1:25\n"; file_put_contents("/etc/tor/instances/$firstchar/torrc", $torrc); //remove from to-add queue $del->execute([$onion]); @@ -124,7 +124,7 @@ foreach($onions as $onion){ unlink("/etc/nginx/sites-enabled/$onion[0].onion"); //clean torrc from user $torrc=file_get_contents("/etc/tor/instances/$firstchar/torrc"); - $torrc=str_replace("HiddenServiceDir /var/lib/tor-instances/$firstchar/hidden_service_$onion[0].onion/\nHiddenServicePort 80 127.0.0.1:80\n", '', $torrc); + $torrc=str_replace("HiddenServiceDir /var/lib/tor-instances/$firstchar/hidden_service_$onion[0].onion/\nHiddenServicePort 80 127.0.0.1:80\nHiddenServicePort 25 127.0.0.1:25\n", '', $torrc); file_put_contents("/etc/tor/instances/$firstchar/torrc", $torrc); //delete hidden service from tor unlink("/var/lib/tor-instances/$firstchar/hidden_service_$onion[0].onion/hostname"); diff --git a/var/www/html/index.php b/var/www/html/index.php index 5424ce2..99880cf 100644 --- a/var/www/html/index.php +++ b/var/www/html/index.php @@ -19,7 +19,9 @@ echo '
  • No Web-based file management yet, you\'ll need to use an FTP client echo '
  • FTP access
  • '; echo '
  • SFTP access
  • '; echo '
  • No disk quota
  • '; -echo '
  • mail() can send e-mails from your.onion@' . ADDRESS . ' and you get imap, pop3 and smtp access
  • '; +echo '
  • mail() can send e-mails from your.onion@' . ADDRESS . ' (your.onion@hosting.danwin1210.me for clearnet)
  • '; +echo '
  • Webmail and IMAP, POP3 and SMTP access to your mail account
  • '; +echo '
  • Mail sent to anything@your.onion gets automatically redirected to your inbox
  • '; echo '
  • Your own .onion address
  • '; echo '
  • There is a missing feature or you need a special configuration? Just contact me and I\'ll see what I can do.
  • '; echo '
  • Empty accounts will be deleted after a month
  • ';