davmail 配置

官网
DavMail 是一个Java 编写Exchange 的代理gateway软件,让一般smtp+imap/pop3 客户端可以通过这个代理收发邮件

davmail 安装

davmail download

  1. unzip -d davmailxxx.zip -d /opt/davmail

davmail 配置

  1. 创建/opt/davmail/davmail.properties 拷贝官方实例配置 Official Config
  2. 如果是服务器注意修改davmail.url 为内部服务器地址
  3. 修改davmail.logFilePath=/opt/davmail/davmail.log
  4. 将davmail 注册到本地服务
    1. useradd davmail
    2. sudo chown -R davmail:davmail /opt/davmail
    3. sudo vim /lib/systemd/system/davmail.service
      1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      [Unit]
      Description=davmail proxy for exchange
      [Service]
      User=davmail
      Group=davmail
      Type=simple
      ExecStart=/opt/davmail/davmail.sh /opt/davmail/davmail.properties
      PIDFile=/var/run/davmail.pid
      [Install]
      WantedBy=multi-user.target graphical.target
    4. systemctl enable davmail
    5. systemctl start davmail
    6. ps aux|grep davmail 检查服务是否正常 可以通过直接运行 /opt/davmail/davmail.sh /opt/davmail/davmail.properties 查看错误信息
  5. 修改/opt/davmail/davmail.sh
    1
    2
    3
    4
    5
    6
    #!/bin/bash
    BASE=`dirname $0`
    BASE=/opt/davmail
    for i in $BASE/lib/*; do export CLASSPATH=$CLASSPATH:$i; done
    JAVA=`which java`
    $JAVA -Xmx512M -Dsun.net.inetaddr.ttl=60 -cp $BASE/davmail.jar:$CLASSPATH davmail.DavGateway $1

Thunder bird 配置

  1. STMP
    1. Server:localhost Port:1025
    2. UserName: you namee
    3. Connection security:Non
    4. Authentication Method:Password ,transmitted insecureity
  2. IMAP:
    1. Server:localhost Port:1143
    2. UserName: you name
    3. Connection security:None
    4. Authentication Method:Password ,transmitted insecureity