{"id":17179120,"url":"https://github.com/flashmob/pop3-server-php","last_synced_at":"2025-04-13T17:11:44.427Z","repository":{"id":4943945,"uuid":"6101109","full_name":"flashmob/POP3-server-php","owner":"flashmob","description":"A cute POP3 server in PHP. Using libevent for Non blocking, event driven I/O","archived":false,"fork":false,"pushed_at":"2014-10-29T13:06:23.000Z","size":203,"stargazers_count":15,"open_issues_count":0,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-27T08:01:53.243Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/flashmob.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-10-06T08:31:14.000Z","updated_at":"2024-08-04T01:53:22.000Z","dependencies_parsed_at":"2022-08-22T18:30:38.119Z","dependency_job_id":null,"html_url":"https://github.com/flashmob/POP3-server-php","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flashmob%2FPOP3-server-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flashmob%2FPOP3-server-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flashmob%2FPOP3-server-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flashmob%2FPOP3-server-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flashmob","download_url":"https://codeload.github.com/flashmob/POP3-server-php/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248750108,"owners_count":21155686,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-15T00:24:54.396Z","updated_at":"2025-04-13T17:11:44.395Z","avatar_url":"https://github.com/flashmob.png","language":"PHP","readme":"POP3 Server in PHP\n=========\n\nCopyright (c) 2014 GuerrillaMail.com\n\nVersion: 1.2\n- Author: Flashmob, GuerrillaMail.com\n- Contact: flashmob@gmail.com\n- License: MIT\n- Repository: https://github.com/flashmob/POP3-server-php\n- Site: http://www.guerrillamail.com/\n\n\nAbout\n----\n\nThis is a prototype for a non-blocking, event driven POP3 server for GuerrillaMail.com\n\nEasy to interface with a database backend, a MySQL example is given.\n\nRequires the libevent extension from here http://pecl.php.net/package/libevent\n\nInstallation\n--------------\n\n\n```sh\ngit clone https://github.com/flashmob/POP3-server-php pop\ncd pop\ncp popd-config.php.dist popd-config.php\n(edit the config for your needs)\nphp ./pop3d.php -p 110 -v -l pop.log\n```\n\n(Run as root/wheel user, then the server will drop down to the UID specified in the config file.\nAlso, make sure ports aren't firewalled)\n\nArguments:\n-p [port]     110 default\n-v            Verbose\n-l [filename] Log file\n\n\nSee the Driver directory and implement your own driver\n\n\nSchema\n-----------\nThe Mysql.php file in the Driver directory is an example.\n\n```sql\nCREATE TABLE IF NOT EXISTS `gm2_mail` (\n    `mail_id` bigint(20) NOT NULL AUTO_INCREMENT,\n    `mail_address_id` varchar(32) CHARACTER SET latin1 NOT NULL,\n    `recipient` varchar(128) CHARACTER SET latin1 NOT NULL,\n    `size` int(11) NOT NULL,\n    `hash` char(32) CHARACTER SET latin1 DEFAULT NULL,\n    `raw_email` longblob NOT NULL,\n    `password`\n    PRIMARY KEY (`mail_id`),\n    KEY `mail_address_id` (`mail_address_id`)\n) ENGINE=InnoDB  DEFAULT CHARSET=utf8;\n```\n\nNotes:\n\nIn this example:\n\n- mail_address_id is an md5 of the email address\n\n- hash is the md5 of the entire message\n\n- It supports APOP auth, however, it's recommended that normal auth should be used, instead with SSL / TLS. \nSee below how to use Nginx to do that.\n\nLimitations\n--------------\n\n- Doesn't support SSL / STARTTLS directly, needs to proxy through Nginx (or another proxy?)\n\nNginx\n---------------\nYou may put this server behind Nginx\n\nHere's an example configuration\n\n\n```\nmail {\n\n    server {\n        auth_http 123.123.123.123:80/popauth.php;\n        listen   110;\n        server_name  pop.yourserver.com;\n        protocol pop3;\n        pop3_capabilities USER RESP-CODES \"EXPIRE 1\" \"LOGIN-DELAY 5\" \"TOP\" \"UIDL\";\n        proxy_pass_error_message on;\n        ssl_certificate      /etc/ssl/certs/yourserver.com.crt;\n        ssl_certificate_key  /etc/ssl/private/yourserver.com.key;\n        ssl_session_timeout  1m;\n        ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;\n        #ssl_protocols  SSLv2 SSLv3 TLSv1 TLSv1.1 TLSv1.2;\n        ssl_ciphers  ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5:!DSS;\n        ssl_prefer_server_ciphers   on;\n        # TLS off unless client issues STARTTLS command\n        starttls on;\n        proxy on;\n    }\n    \n    #SSL only \n    server {\n        auth_http 123.123.123.123:80/popauth.php;\n        listen  995;\n        server_name  pop.yourserver.com;\n        protocol pop3;\n        pop3_capabilities USER RESP-CODES \"EXPIRE 1\" \"LOGIN-DELAY 5\" \"TOP\" \"UIDL\";\n        proxy_pass_error_message on;\n        ssl on;\n        ssl_certificate      /etc/ssl/certs/yourserver.com.crt;\n        ssl_certificate_key  /etc/ssl/private/yourserver.com.key;\n        ssl_session_timeout  5m;\n        ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;\n        #ssl_protocols  SSLv2 SSLv3 TLSv1 TLSv1.1 TLSv1.2;\n        ssl_ciphers  ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5:!DSS;\n        ssl_prefer_server_ciphers   on;\n        # TLS off unless client issues STARTTLS command\n        starttls off;\n        proxy on;\n    }\n}\n\n```\n\nWhat does auth_http do?\n------------------\n\nFor each connection, Nginx will make a HTTP request to popauth.php to authenticate the user.\nYou would need to put popauth.php somewhere on your server's document root or symlink it.\nThen see inside popauth.php where you can customize for your needs.\nTypically, you would put the pop server to listen to some high port, eg 127.0.0.1:1101\nAnd then popauth.php is used to tell Nginx to proxy to there.\n\nSSL \u0026 Passwords\n---------------\n\nIt's best to allow access only through SSL / STARTTLS, and set the login type to 'Normal'\nThis means that the password would be encrypted when transmitted via SSL/TLS.\n\nAlso, this means that our backend doesn't have to store the plaintext password, instead it can only store a salted hash.\n(If for example APOP or CRAM-MD5 is used, that would imply the backend stores the plaintext password)\n\nYour own storage back-end\n--------------\nIf you want to have your own storage backend, see the PopDb/Driver/Mysql.php file. Simply implement all the methods\nin that file and specify to use it in the config.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflashmob%2Fpop3-server-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflashmob%2Fpop3-server-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflashmob%2Fpop3-server-php/lists"}