浏览代码

i2p firewall for smtp

Bob Mottram 7 年前
父节点
当前提交
6444469967
共有 1 个文件被更改,包括 11 次插入3 次删除
  1. 11
    3
      src/freedombone-app-bdsmail

+ 11
- 3
src/freedombone-app-bdsmail 查看文件

36
 BDSMAIL_REPO="https://github.com/majestrate/bdsmail"
36
 BDSMAIL_REPO="https://github.com/majestrate/bdsmail"
37
 BDSMAIL_COMMIT='6a2296b0b8e6c3da61081b85802e7b1cc88ca285'
37
 BDSMAIL_COMMIT='6a2296b0b8e6c3da61081b85802e7b1cc88ca285'
38
 BDSMAIL_DIR=/etc/bdsmail
38
 BDSMAIL_DIR=/etc/bdsmail
39
+I2P_SAM_PORT=7656
40
+I2P_SMTP_PORT=2525
39
 
41
 
40
 bdsmail=(MY_USERNAME)
42
 bdsmail=(MY_USERNAME)
41
 
43
 
205
         rm /etc/systemd/system/bdsmail.service
207
         rm /etc/systemd/system/bdsmail.service
206
     fi
208
     fi
207
 
209
 
210
+    firewall_remove $I2P_SAM_PORT
211
+    firewall_remove $I2P_SMTP_PORT
212
+
208
     for d in /home/*/ ; do
213
     for d in /home/*/ ; do
209
         USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
214
         USERNAME=$(echo "$d" | awk -F '/' '{print $3}')
210
         if [[ $(is_valid_user "$USERNAME") == "1" ]]; then
215
         if [[ $(is_valid_user "$USERNAME") == "1" ]]; then
277
     # create configuration file
282
     # create configuration file
278
     $BDSMAIL_DIR/bin/bdsconfig > $BDSMAIL_DIR/config.ini
283
     $BDSMAIL_DIR/bin/bdsconfig > $BDSMAIL_DIR/config.ini
279
     echo '[maild]' > $BDSMAIL_DIR/config.ini
284
     echo '[maild]' > $BDSMAIL_DIR/config.ini
280
-    echo 'i2paddr = 127.0.0.1:7656' >> $BDSMAIL_DIR/config.ini
285
+    echo "i2paddr = 127.0.0.1:$I2P_SAM_PORT" >> $BDSMAIL_DIR/config.ini
281
     echo 'i2pkeyfile = bdsmail-privkey.dat' >> $BDSMAIL_DIR/config.ini
286
     echo 'i2pkeyfile = bdsmail-privkey.dat' >> $BDSMAIL_DIR/config.ini
282
-    echo 'bindmail = 127.0.0.1:2525' >> $BDSMAIL_DIR/config.ini
287
+    echo "bindmail = 127.0.0.1:$I2P_SMTP_PORT" >> $BDSMAIL_DIR/config.ini
283
     echo 'bindweb = 127.0.0.1:8489' >> $BDSMAIL_DIR/config.ini
288
     echo 'bindweb = 127.0.0.1:8489' >> $BDSMAIL_DIR/config.ini
284
     echo 'domain = localhost' >> $BDSMAIL_DIR/config.ini
289
     echo 'domain = localhost' >> $BDSMAIL_DIR/config.ini
285
     echo 'maildir = mail' >> $BDSMAIL_DIR/config.ini
290
     echo 'maildir = mail' >> $BDSMAIL_DIR/config.ini
352
     # Create mutt configuration
357
     # Create mutt configuration
353
     mkdir /etc/skel/.mutt
358
     mkdir /etc/skel/.mutt
354
     echo 'set mbox_type=Maildir' > /etc/skel/.mutt/bdsmail
359
     echo 'set mbox_type=Maildir' > /etc/skel/.mutt/bdsmail
355
-    echo 'set smtp_url=smtp://127.0.0.1:2525/' >> /etc/skel/.mutt/bdsmail
360
+    echo "set smtp_url=smtp://127.0.0.1:$I2P_SMTP_PORT/" >> /etc/skel/.mutt/bdsmail
356
     echo 'set use_from=yes' >> /etc/skel/.mutt/bdsmail
361
     echo 'set use_from=yes' >> /etc/skel/.mutt/bdsmail
357
     echo "set from=username@${bds_domain}" >> /etc/skel/.mutt/bdsmail
362
     echo "set from=username@${bds_domain}" >> /etc/skel/.mutt/bdsmail
358
     echo "set spoolfile=~/Maildir/i2p" >> /etc/skel/.mutt/bdsmail
363
     echo "set spoolfile=~/Maildir/i2p" >> /etc/skel/.mutt/bdsmail
385
             exit 638762424;;
390
             exit 638762424;;
386
     esac
391
     esac
387
 
392
 
393
+    firewall_add i2psam $I2P_SAM_PORT
394
+    firewall_add i2psmtp $I2P_SMTP_PORT
395
+
388
     APP_INSTALLED=1
396
     APP_INSTALLED=1
389
 }
397
 }
390
 
398