利用ubuntuextmail30分钟配置好一个功能强大的邮件

上传人:痛*** 文档编号:187100488 上传时间:2023-02-10 格式:PDF 页数:16 大小:351.01KB
返回 下载 相关 举报
利用ubuntuextmail30分钟配置好一个功能强大的邮件_第1页
第1页 / 共16页
利用ubuntuextmail30分钟配置好一个功能强大的邮件_第2页
第2页 / 共16页
利用ubuntuextmail30分钟配置好一个功能强大的邮件_第3页
第3页 / 共16页
亲,该文档总共16页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述
利用利用 Ubuntu ExtMail 30Ubuntu ExtMail 30 分钟配置好一个功能强分钟配置好一个功能强大的邮件大的邮件利用 Ubuntu ExtMail 30 分钟配置好一个功能强大的邮件服务器,以下文档通过 19 个大的步骤进行配置,配置成功!由于网上 Ubuntu ExtMail 的步骤特别多,看了都头痛,在此特别给朋友们制作了一个简洁的安装文档,希望大家喜欢:)环境:Ubuntu TLSpostfix 2.5.1ExtMailextman1.安装依赖包apt-getinstallmysql-serverapache2postfixpostfix-mysqlpostfix-doccourier-authdaemon courier-authlib-mysql courier-pop courier-pop-ssl courier-imapcourier-imap-ssl libsasl2-modules libsasl2-modules-sql sasl2-bin libpam-mysqlopenssllibapache2-mod-fastcgilibfcgi-perlbuild-essentiallibtoollibnet-server-perl libnet-cidr-perl libberkeleydb-perl arczoolzopliblzo1libstdc+5libgd-gd2-perllibfile-tail-perllibnet-dns-perllibdigest-sha1-perllibhtml-tagset-perllibio-multiplex-perllibdigest-HMAC-perllibhtml-parser-perllibnet-ip-perllibio-stringy-perllibio-socket-ssl-perllibio-zlib-perllibnet-ssleay-perllibunix-syslog-perllibtimedate-perl libmailtools-perl libconvert-binhex-perl libconvert-tnef-perllibconvert-uulib-perllibarchive-tar-perl perl-suid你会被询问以下问题:libcompress-zlib-perllibarchive-zip-perlCreate directories for web-based administration NoGeneral type of mail configuration:Internet SiteSystem mail name:下载和,并修改配置下载地址:xvzf xvzf /var/www/extsuitemv /var/www/extsuite/extmailmv /var/www/extsuite/extmancp/var/www/extsuite/extman/docs/mysql_virtual_*.cf/etc/postfix/注意,非常重要:修改/etc/postfix/mysql_virtual_*.cf,将其中的“localhost”均改为“.0.1”,修改数据库配置,保证能够连到mysql3.建立相关系统用户1)新建普通用户useradd-m-d/home/hugwww-s/bin/bash hugwwwpasswd hugwww2)删除以前 gid,uid 为 1000 的用户userdel-r gaojinbo3)建立 extmail 所需要的用户和组groupadd-g 1000 vgroupuseradd-m-g vgroup-u 1000-d/home/vmail-s/bin/false vuser4.修改权限chmod 755/etc/postfix/mysql_virtual_*.cfchgrp postfix/etc/postfix/mysql_virtual_*.cfchown-R vuser:vgroup/var/www/extsuite/extmail/cgi/chown-R vuser:vgroup/var/www/extsuite/extman/cgi/cd/var/www/extsuite/extmail/cpcd/var/www/extsuite/extman/cp5.修改/var/www/extsuite/extmail/里的其他参数,主要变动的内容见下:vi/var/www/extsuite/extmail/SYS_USER_LANG=zh_CNSYS_MYSQL_USER=extmailSYS_MYSQL_PASS=extmailSYS_MYSQL_DB=extmailSYS_MYSQL_SOCKET=/var/run/mysqld/SYS_AUTHLIB_SOCKET=/var/run/courier/authdaemon/socketSYS_MAILDIR_BASE=/home/vmailSYS_MESSAGE_SIZE_LIMIT=0 5M改/var/www/extsuite/extman/的参数vi/var/www/extsuite/extman/SYS_CAPTCHA_ON=0 改/var/www/extsuite/extman/contrib/my$sock=/var/run/mysqld/;8.数据库初始化执行以下命令导入 mysql 数据库结构及初始化数据,注意必须逐行输入以下命令.请把替换成自己的密码mysql-u root /var/www/extsuite/extman/docs/mysql-u root /var/www/extsuite/extman/docs/9.建立临时文件夹:mkdir/tmp/extmanchown-R vuser:vgroup/tmp/extman编辑,加入下面内容以实现开机自动建立编辑,加入下面内容以实现开机自动建立/etc/if !-d/tmp/extman;thenmkdir/tmp/extmanchown-R vuser:vgroup/tmp/extmanfi10.建立上边导入 mysql 的帐户的 Maildir,请输入如下命令:cd/var/www/extsuite/extman/tools./home/vmail/postmaster/Maildirchown-R vuser:vgroup/home/vmail/配置cd/etc/postfix/cpvi#TLS parameterssmtpd_tls_cert_file=/etc/postfix/smtpd_tls_key_file=/etc/postfix/smtpd_use_tls=yes#See/usr/share/doc/postfix/in the postfix-doc package for#information on enabling SSL in the smtp client.mydomain=myhostname=mail.$mydomainmyorigin=$mydomainmydestination=mail.$mydomain,localhost.$mydomain,localhostalias_maps=hash:/etc/aliasesalias_database=hash:/etc/aliasesrelayhost=mynetworks=message_size_limit=0mailbox_size_limit=0recipient_delimiter=+inet_interfaces=allhtml_directory=/usr/share/doc/postfix/html#virtual config#virtual_alias_domains=virtual_alias_maps=mysql:/etc/postfix/virtual_mailbox_domains=mysql:/etc/postfix/virtual_mailbox_maps=mysql:/etc/postfix/virtual_mailbox_limit_maps=mysql:/etc/postfix/virtual_mailbox_base=/home/vmailvirtual_uid_maps=static:1000virtual_gid_maps=static:1000virtual_create_maildirsize=yesvirtual_mailbox_extended=yesvirtual_overquota_bounce=yesvirtual_mailbox_limit_override=yesvirtual_maildir_limit_message=Sorry,the yourMaildir hasoverdrawn yourdiskspace quota,please free up some of spaces of your mailbox try again.proxy_read_maps=$local_recipient_maps$mydestination$virtual_alias_maps$virtual_alias_domains$virtual_mailbox_maps$virtual_mailbox_domains$relay_recipient_maps$relay_domains$canonical_maps$sender_canonical_maps$recipient_canonical_maps$virtual_mailbox_limit_maps重启 postfix/etc/postfix restart身份认证cd/etc/postfixopenssl req-new-outform PEM-out -newkey rsa:2048-nodes-keyout -keyform PEM-days 365-x509$relocated_maps$transport_maps$mynetworks它们询问你问题Country Name(2 letter code)AU:国家State or Province Name(full name)Some-State:省Locality Name(eg,city):城市Organization Name(eg,company)Internet Widgits Pty Ltd:组织名称Organizational Unit Name(eg,section):组织单位名称Common Name(eg,YOUR name):通用名称Email Address:邮件地址配置:vi/etc/apache2/sites-available/mailServerAdminServerNameDocumentRoot/var/www/extsuite/extmail/htmlAlias/extmail/cgi/var/www/extsuite/extmail/Alias/extmail/var/www/extsuite/extmail/htmlFastCgiExternalServer/var/www/extsuite/extmail/-host -idle-timeout 240SetHandler fastcgi-scriptScriptAlias/extman/cgi/var/www/extsuite/extman/cgi/Alias/extman/var/www/extsuite/extman/htmlErrorLog/var/log/apache2/#Possible values include:debug,info,notice,warn,error,crit,#alert,emerg.LogLevel warnCustomLog/var/log/apache2/combinedSuexecUserGroup vuser vgroup14.编辑/var/www/extsuite/extmail/dispatch-init文件:vi/var/www/extsuite/extmail/dispatch-initMAXFORK=10最后启动 fastcgi server:/var/www/extsuite/extmail/dispatch-init start如果没有意外将启动 10 个守护进程,可以通过以下命令将启动命令加到中,实现自启动:echo/var/www/extsuite/extmail/dispatch-init start/etc/认证1).更改 saslauthdvi/etc/default/saslauthd更改如下几项START=yes 创建文件/etc/smtpvi/etc/smtp内容如下:authrequireduser=extmailpasswd=extmailhost=db=extmailtable=mailboxusercolumn=username passwdcolumn=password crypt=1account sufficient user=extmail passwd=extmail host=db=extmail table=mailboxusercolumn=username passwdcolumn=password crypt=1解释一下:其实就是定义一个查询的方式 crypt=1 或者 0 表示加密或者不加密 注意对照你的数据库还有用户名密码 请保持跟自己的一致3).由于 postfix 处于 chroot,要想调用到 saslauthd 必须更改 socket 文件mkdir-p/var/spool/postfix/var/run/saslauthdvi/etc/postfix/sasl/创建,并且内容如下:pwcheck_method:saslauthdmech_list:plain loginallow_plaintext:trueauxprop_plugin:mysqlsql_hostnames:sql_user:extmailsql_password:extmailsql_database:extmaillog_level:7sql_select:SELECT password FROM mailbox WHERE username=%u%r and domain=%r4).更改 文件vi/etc/postfix/#SMTP AUTH config#broken_sasl_auth_clients=yessmtpd_sasl_auth_enable=yessmtpd_sasl_local_domain=$myhostnamesmtpd_sasl_security_options=noanonymous#smtpd related config#smtpd_recipient_restrictions=permit_mynetworks,permit_sasl_authenticated,reject_sender_login_mismatch,reject_unknown_sender_domain,reject_non_fqdn_hostname,reject_non_fqdn_sender,reject_non_fqdn_recipient,reject_unknown_recipient_domain,reject_unauth_destination,reject_unauth_pipelining,reject_invalid_hostname,check_recipient_maps5).添加用户adduser postfix sasl6).重启 postfix saslauthd/etc/postfix restart/etc/saslauthd restart7).测验telnet localhost 25Trying Connected to localhost.Escape character is.220 ESMTP Postfixehlo localhost250-PIPELINING250-SIZE 0250-VRFY250-ETRN250-STARTTLS250-AUTH PLAIN LOGIN250-AUTH=PLAIN LOGIN250-ENHANCEDSTATUSCODES250-8BITMIME250 DSNauth login334 VXNlcm5hbWU6cG9zdG1hc3RlckBleHRtYWlsLm9yZw=334 UGFzc3dvcmQ6ZXh0bWFpbA=235 2.7.0 Authentication successfulquit221 ByeConnection closed by foreign host.如果出现 Authentication successful 表示没有问题了验证vi/etc/courier/authdaemonrc#更改如下一项authmodulelist=authmysqlcp/etc/courier/authmysqlrc/etc/courier/authmysqlrc_origcat/dev/null /etc/courier/authmysqlrcvi/etc/courier/authmysqlrc#内容如下:MYSQL_SERVER localhostMYSQL_USERNAME extmailMYSQL_PASSWORD extmailMYSQL_SOCKET/var/run/mysqld/MYSQL_PORT 3306MYSQL_OPT 0MYSQL_DATABASE extmailMYSQL_USER_TABLE mailboxMYSQL_CRYPT_PWFIELD passwordMYSQL_UID_FIELD uidnumberMYSQL_GID_FIELD gidnumberMYSQL_LOGIN_FIELD usernameMYSQL_HOME_FIELD homedirMYSQL_NAME_FIELD nameMYSQL_MAILDIR_FIELD maildirMYSQL_QUOTA_FIELD quotaMYSQL_SELECT_CLAUSE SELECT username,password,uidnumber,gidnumber,CONCAT(/home/vmail/,homedir),CONCAT(/home/vmail/,maildir),quota,name,CONCAT(disablesmtpd=,disablesmtpd,disablesmtp=,disablesmtp,disablewebmail=,disablewebmail,disablenetdisk=,disablenetdisk,disableimap=,disableimap,disablepop3=,disablepop3,netdiskquota=,netdiskquota)FROM mailbox WHERE username=$(local_part)$(domain)配置 Courier-POP3vi/etc/courier/pop3dMAILDIRPATH=/home/vmail/配置 Courier-IMAPvi/etc/courier/imapdMAILDIRPATH=/home/vmail/重新启动/etc/courier-authdaemon restart/etc/courier-imap restart/etc/courier-imap-ssl restart/etc/courier-pop restart/etc/courier-pop-ssl restart测试 Courier-Authlib是否能成功连接 mysqlauthtest-s login extmail如果成功应该有如下显示Authentication succeeded.Authenticated(uid 1000,gid 1000)Home Directory:/home/vmail/postmasterMaildir:/home/vmail/postmaster/Maildir/Quota:0SEncrypted Password:$1$phz1mRrj$3ok6BjeaoJYWDBsEPZb5C0Cleartext Password:extmailOptions:disablesmtpd=0,disablesmtp=0,disablewebmail=0,disablenetdisk=0,disableimap=0,disablepop3=0,netdiskquota=S测试 pop3telnet localhost 110Trying Connected toEscape character is.+OK Hello there.user+OK Password required.pass extmail+OK logged in.list+OK POP3 clients that break here,they violate STD53.quit+OK Bye-bye.Connection closed by foreign host.如果出现问题请仔细分析日志17.图形日志 extmailapt-get install mailgraphcp-r/var/www/extsuite/extman/addon/mailgraph_ext/usr/local/mailgraph_extvi/usr/local/mailgraph_ext/mailgraph-init为:MAIL_LOG=/var/log/然后复制文件cp/var/www/extsuite/extman/addon/mailgraph_ext/mailgraph-init/etc/mailgraphcp/var/www/extsuite/extman/addon/mailgraph_ext/etc/qmonitor启动服务/etc/mailgraph start18.安装 Maildropapt-get install maildropvi/etc/So that you can continueto receive mail you need to remove some messages from your mailbox.19.解决 extman 问题1)修改相关服务路径vi/var/www/extsuite/extman/daemon/cmd_plugin/linux-cmd2)启动服务/var/www/extsuite/extman/daemon/cmdserver-v-d3)写入开机自动运行echo/var/www/extsuite/extman/daemon/cmdserver-v-d/etc/至此,全部完成 登录前台,后台后台默认用户名 默认密码 extmail*123*,登录前台需要自己先添加一个用户
展开阅读全文
相关资源
相关搜索

最新文档


当前位置:首页 > 管理文书 > 施工组织


copyright@ 2023-2025  zhuangpeitu.com 装配图网版权所有   联系电话:18123376007

备案号:ICP2024067431-1 川公网安备51140202000466号


本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知装配图网,我们立即给予删除!