Ticket #847: imapproxy.10.patch

Datei imapproxy.10.patch, 14.6 KB (hinzugefügt von M66B, vor 8 Jahren)
  • make/Config.in

     
    118118source make/httpry/Config.in 
    119119source make/httptunnel/Config.in 
    120120source make/igmpproxy/Config.in 
     121source make/imapproxy/Config.in 
    121122source make/inadyn-mt/Config.in 
    122123source make/inotify-tools/Config.in 
    123124source make/iodine/Config.in 
  • make/imapproxy/files/.language

     
     1languages 
     2{ de en } 
     3default 
     4{ en } 
     5files 
     6{ 
     7    usr/lib/cgi-bin/imapproxy.cgi 
     8} 
  • make/imapproxy/files/root/usr/lib/cgi-bin/imapproxy.cgi

     
     1#!/bin/sh 
     2 
     3PATH=/bin:/usr/bin:/sbin:/usr/sbin 
     4. /usr/lib/libmodcgi.sh 
     5 
     6check "$IMAPPROXY_ENABLED" yes:auto "*":man 
     7check "$IMAPPROXY_SEND_TCP_KEEPALIVES" yes:send_tcp_keepalives 
     8check "$IMAPPROXY_ENABLE_SELECT_CACHE" yes:enable_select_cache 
     9check "$IMAPPROXY_FORCE_TLS" yes:force_tls 
     10check "$IMAPPROXY_ENABLE_ADMIN_COMMANDS" yes:enable_admin_commands 
     11 
     12sec_begin '$(lang de:"Starttyp" en:"Start type")' 
     13 
     14cat << EOF 
     15<p> 
     16<input id="e1" type="radio" name="enabled" value="yes"$auto_chk><label for="e1"> $(lang de:"Automatisch" en:"Automatic")</label> 
     17<input id="e2" type="radio" name="enabled" value="no"$man_chk><label for="e2"> $(lang de:"Manuell" en:"Manual")</label> 
     18</p> 
     19EOF 
     20 
     21sec_end 
     22 
     23sec_begin '$(lang de:"Connection" en:"Connection")' 
     24 
     25cat << EOF 
     26<p>$(lang de:"Host name" en:"Host name"): <input type="text" name="hostname" size="20" maxlength="255" value="$(html "$IMAPPROXY_HOSTNAME")"></p> 
     27<p>$(lang de:"Server port" en:"Server port"): <input type="text" name="server_port" size="5" maxlength="5" value="$(html "$IMAPPROXY_SERVER_PORT")"></p> 
     28<p>$(lang de:"Connect retries" en:"Connect retries"): <input type="text" name="connect_retries" size="5" maxlength="5" value="$(html "$IMAPPROXY_CONNECT_RETRIES")"></p> 
     29<p>$(lang de:"Connect delay" en:"Connect delay"): <input type="text" name="connect delay" size="5" maxlength="5" value="$(html "$IMAPPROXY_CONNECT_DELAY")"></p> 
     30<p>$(lang de:"Listen port" en:"Listen port"): <input type="text" name="listen_port" size="5" maxlength="5" value="$(html "$IMAPPROXY_LISTEN_PORT")"></p> 
     31<p>$(lang de:"Listen address" en:"Listen address"): <input type="text" name="listen_address" size="20" maxlength="255" value="$(html "$IMAPPROXY_LISTEN_ADDRESS")"></p> 
     32<p> 
     33<input type="hidden" name="send_tcp_keepalives" value="no"> 
     34<input id="c1" type="checkbox" name="send_tcp_keepalives" value="yes"$send_tcp_keepalives_chk><label for="c1"> $(lang de:"Send TCP keep alives" en:"Send TCP keep alives")</label> 
     35</p> 
     36EOF 
     37 
     38sec_end 
     39 
     40sec_begin '$(lang de:"Cache" en:"Cache")' 
     41 
     42cat << EOF 
     43<p>$(lang de:"Size" en:"Size"): <input type="text" name="cache_size" size="10" maxlength="255" value="$(html "$IMAPPROXY_CACHE_SIZE")"></p> 
     44<p>$(lang de:"Expiration time" en:"Expiration time"): <input type="text" name="expiration_time" size="10" maxlength="255" value="$(html "$IMAPPROXY_EXPIRATION_TIME")"></p> 
     45<p> 
     46<input type="hidden" name="enable_select_cache" value="no"> 
     47<input id="c2" type="checkbox" name="enable_select_cache" value="yes"$enable_select_cache_chk><label for="c2"> $(lang de:"Enable select cache" en:"Enable select cache")</label> 
     48</p> 
     49EOF 
     50 
     51sec_end 
     52 
     53sec_begin '$(lang de:"Security" en:"Security")' 
     54 
     55cat << EOF 
     56<p>$(lang de:"CA path" en:"CA path"): <input type="text" name="tls_ca_path" size="50" maxlength="255" value="$(html "$IMAPPROXY_TLS_CA_PATH")"></p> 
     57<p>$(lang de:"CA file" en:"CA file"): <input type="text" name="tls_ca_file" size="50" maxlength="255" value="$(html "$IMAPPROXY_TLS_CA_FILE")"></p> 
     58<p>$(lang de:"CERT file" en:"CERT file"): <input type="text" name="tls_cert_file" size="50" maxlength="255" value="$(html "$IMAPPROXY_TLS_CERT_FILE")"></p> 
     59<p>$(lang de:"KEY file" en:"KEY file"): <input type="text" name="tls_key_file" size="50" maxlength="255" value="$(html "$IMAPPROXY_TLS_KEY_FILE")"></p> 
     60<p> 
     61<input type="hidden" name="force_tls" value="no"> 
     62<input id="c3" type="checkbox" name="force_tls" value="yes"$force_tls_chk><label for="c3"> $(lang de:"Force TLS" en:"Force TLS")</label> 
     63</p> 
     64<p><small>$(lang de:"See ImapProxy README.ssl file for details" en:"See ImapProxy README.ssl file for details")</small></p> 
     65EOF 
     66 
     67sec_end 
     68 
     69sec_begin '$(lang de:"Debugging" en:"Debugging")' 
     70 
     71cat << EOF 
     72<p>$(lang de:"Syslog facility" en:"Syslog facility"): <input type="text" name="syslog_facility" size="20" maxlength="255" value="$(html "$IMAPPROXY_SYSLOG_FACILITY")"></p> 
     73<p>$(lang de:"Syslog priority mask" en:"Syslog priority mask"): <input type="text" name="syslog_prioritymask" size="20" maxlength="255" value="$(html "$IMAPPROXY_SYSLOG_PRIORITYMASK")"></p> 
     74<p> 
     75<input type="hidden" name="enable_admin_commands" value="no"> 
     76<input id="c4" type="checkbox" name="enable_admin_commands" value="yes"$enable_admin_commands_chk><label for="c4"> $(lang de:"Enable admin commands" en:"Enable admin commands")</label> 
     77</p> 
     78<p><small>$(lang de:"See ImapProxy README file for details" en:"See ImapProxy README file for details")</small></p> 
     79EOF 
     80 
     81sec_end 
     82 
  • make/imapproxy/files/root/etc/init.d/rc.imapproxy

    Property changes on: make/imapproxy/files/root/usr/lib/cgi-bin/imapproxy.cgi
    ___________________________________________________________________
    Added: svn:executable
       + *
    
     
     1#!/bin/sh 
     2 
     3DAEMON=imapproxy 
     4APP=in.imapproxyd 
     5. /etc/init.d/modlibrc 
     6 
     7config() { 
     8    { 
     9        if [ -x "/tmp/flash/${DAEMON}_conf" ]; then 
     10            /tmp/flash/${DAEMON}_conf 
     11        else 
     12            /mod/etc/default.$DAEMON/${DAEMON}_conf 
     13        fi 
     14 
     15    } > /mod/etc/$DAEMON.conf 
     16 
     17    mkdir -p /tmp/$DAEMON 
     18} 
     19 
     20start() { 
     21    modlib_startdaemon $APP -f /mod/etc/$DAEMON.conf -p /var/run/$DAEMON.pid 
     22} 
     23 
     24case $1 in 
     25    ""|load) 
     26        modlib_addgroup nobody 
     27        modlib_adduser nobody -s /bin/false -D -S -H -G nobody -g 'nobody' 
     28 
     29        modreg cgi 'imapproxy' 'ImapProxy' 
     30        modlib_start $IMAPPROXY_ENABLED 
     31        ;; 
     32    unload) 
     33        modlib_stop 
     34        modunreg cgi 'imapproxy' 
     35        ;; 
     36    start) 
     37        modlib_start 
     38        ;; 
     39    stop) 
     40        modlib_stop 
     41        ;; 
     42    restart) 
     43        modlib_restart 
     44        ;; 
     45    status) 
     46        modlib_status 
     47        ;; 
     48    *) 
     49        echo "Usage: $0 [load|unload|start|stop|restart|status]" 1>&2 
     50        exit 1 
     51        ;; 
     52esac 
     53 
     54exit 0 
  • make/imapproxy/files/root/etc/default.imapproxy/imapproxy.cfg

    Property changes on: make/imapproxy/files/root/etc/init.d/rc.imapproxy
    ___________________________________________________________________
    Added: svn:executable
       + *
    
     
     1export IMAPPROXY_ENABLED='no' 
     2export IMAPPROXY_HOSTNAME='imap.mail.yahoo.com' 
     3export IMAPPROXY_CONNECT_RETRIES='10' 
     4export IMAPPROXY_CONNECT_DELAY='5' 
     5export IMAPPROXY_CACHE_SIZE='3072' 
     6export IMAPPROXY_LISTEN_PORT='143' 
     7export IMAPPROXY_LISTEN_ADDRESS='0.0.0.0' 
     8export IMAPPROXY_SERVER_PORT='143' 
     9export IMAPPROXY_EXPIRATION_TIME='300' 
     10export IMAPPROXY_SYSLOG_FACILITY='LOG_MAIL' 
     11export IMAPPROXY_SYSLOG_PRIORITYMASK='LOG_INFO' 
     12export IMAPPROXY_SEND_TCP_KEEPALIVES='no' 
     13export IMAPPROXY_ENABLE_SELECT_CACHE='no' 
     14export IMAPPROXY_FORCE_TLS='no' 
     15export IMAPPROXY_ENABLE_ADMIN_COMMANDS='no' 
     16export IMAPPROXY_TLS_CA_FILE='/usr/share/cert/cacert.pem' 
     17export IMAPPROXY_TLS_CA_PATH='/usr/share/cert' 
     18export IMAPPROXY_TLS_CERT_FILE='/usr/share/cert/server.crt' 
     19export IMAPPROXY_TLS_KEY_FILE='/usr/share/cert/key.pem' 
     20 
  • make/imapproxy/files/root/etc/default.imapproxy/imapproxy_conf

     
     1#!/bin/sh 
     2 
     3cat << EOF 
     4server_hostname $IMAPPROXY_HOSTNAME 
     5connect_retries $IMAPPROXY_CONNECT_RETRIES 
     6connect_delay $IMAPPROXY_CONNECT_DELAY 
     7cache_size $IMAPPROXY_CACHE_SIZE 
     8listen_port $IMAPPROXY_LISTEN_PORT 
     9listen_address $IMAPPROXY_LISTEN_ADDRESS 
     10server_port $IMAPPROXY_SERVER_PORT 
     11cache_expiration_time $IMAPPROXY_EXPIRATION_TIME 
     12proc_username nobody 
     13proc_groupname nobody 
     14stat_filename /var/run/pimpstats 
     15protocol_log_filename /var/log/imapproxy_protocol.log 
     16syslog_facility $IMAPPROXY_SYSLOG_FACILITY 
     17syslog_prioritymask $IMAPPROXY_SYSLOG_PRIORITYMASK 
     18send_tcp_keepalives $IMAPPROXY_SEND_TCP_KEEPALIVES 
     19enable_select_cache $IMAPPROXY_ENABLE_SELECT_CACHE 
     20foreground_mode no 
     21force_tls $IMAPPROXY_FORCE_TLS 
     22chroot_directory /tmp/imapproxy 
     23enable_admin_commands $IMAPPROXY_ENABLE_ADMIN_COMMANDS 
     24tls_ca_file $IMAPPROXY_TLS_CA_FILE 
     25tls_ca_path $IMAPPROXY_TLS_CA_PATH 
     26tls_cert_file $IMAPPROXY_TLS_CERT_FILE 
     27tls_key_file $IMAPPROXY_TLS_KEY_FILE 
     28EOF 
     29 
  • make/imapproxy/Makefile.in

    Property changes on: make/imapproxy/files/root/etc/default.imapproxy/imapproxy_conf
    ___________________________________________________________________
    Added: svn:executable
       + *
    
     
     1ifeq ($(strip $(FREETZ_PACKAGE_IMAPPROXY)),y) 
     2PACKAGES+=imapproxy 
     3endif 
     4 
  • make/imapproxy/patches/yahoo.patch

     
     1--- src/imapcommon_org.c    2010-06-03 08:55:13.618446321 +0200 
     2+++ src/imapcommon.c    2010-06-03 09:24:49.042850702 +0200 
     3@@ -689,6 +689,96 @@ extern ICD_Struct *Get_Server_conn( char 
     4     } 
     5 #endif /* HAVE_LIBSSL */ 
     6  
     7+    /* 
     8+     * Yahoo! magic 
     9+     * if user name contains lower case "yahoo" 
     10+     */ 
     11+    if ( strstr( Username, "yahoo" ) != NULL ) 
     12+    { 
     13+   syslog( LOG_INFO, "Yahoo! magic" ); 
     14+ 
     15+   /* 
     16+    * Send the ID ("GUID" "1") command off to the IMAP server 
     17+    */ 
     18+   snprintf( SendBuf, BufLen, "A0000 ID (\"GUID\" \"1\")\r\n"); 
     19+   if ( IMAP_Write( Server.conn, SendBuf, strlen(SendBuf) ) == -1 ) 
     20+   { 
     21+       syslog( LOG_INFO, "Yahoo! magic failed: IMAP_Write() failed attempting to send ID (\"GUID\" \"1\") command to IMAP server: %s", strerror( errno ) ); 
     22+       goto fail; 
     23+   } 
     24+ 
     25+   /* 
     26+    * Read the server response 
     27+    */ 
     28+   for ( ;; ) 
     29+   { 
     30+       if ( ( rc = IMAP_Line_Read( &Server ) ) == -1 ) 
     31+       { 
     32+       syslog( LOG_INFO, "Yahoo! magic failed: No response from IMAP server after sending ID (\"GUID\" \"1\") command" ); 
     33+       goto fail; 
     34+       } 
     35+ 
     36+       if ( Server.LiteralBytesRemaining ) 
     37+       { 
     38+       syslog(LOG_ERR, "%s: Unexpected string literal in server ID (\"GUID\" \"1\") response.", fn ); 
     39+       goto fail; 
     40+       } 
     41+ 
     42+       if ( Server.ReadBuf[0] != '*' ) 
     43+       break; 
     44+   } 
     45+ 
     46+   /* 
     47+    * Try to match up the tag in the server response to the client tag. 
     48+    */ 
     49+   endptr = Server.ReadBuf + rc; 
     50+ 
     51+   tokenptr = memtok( Server.ReadBuf, endptr, &last ); 
     52+ 
     53+   if ( !tokenptr ) 
     54+   { 
     55+       /*  
     56+        * no tokens found in server response?  Not likely, but we still 
     57+        * have to check. 
     58+        */ 
     59+       syslog(LOG_INFO, "Yahoo! magic failed: server response to ID (\"GUID\" \"1\") command contained no tokens." ); 
     60+       goto fail; 
     61+   } 
     62+     
     63+   if ( memcmp( (const void *)tokenptr, (const void *)"A0000", strlen( tokenptr ) ) ) 
     64+   { 
     65+       /*  
     66+        * non-matching tag read back from the server... Lord knows what this 
     67+        * is, so we'll fail. 
     68+        */ 
     69+       syslog(LOG_INFO, "Yahoo! magic failed: server response to ID (\"GUID\" \"1\") command contained non-matching tag." ); 
     70+       goto fail; 
     71+   } 
     72+ 
     73+   /* 
     74+    * Now that we've matched the tags up, see if the response was 'OK' 
     75+    */ 
     76+   tokenptr = memtok( NULL, endptr, &last ); 
     77+ 
     78+   if ( !tokenptr ) 
     79+   { 
     80+       /* again, not likely but we still have to check... */ 
     81+       syslog(LOG_INFO, "Yahoo! magic failed: Malformed server response to ID (\"GUID\" \"1\") command" ); 
     82+       goto fail; 
     83+   } 
     84+ 
     85+   if ( memcmp( (const void *)tokenptr, "OK", 2 ) ) 
     86+   { 
     87+       /* 
     88+        * If the server sent back a "NO" or "BAD", we can look at the actual 
     89+        * server logs to figure out why.  We don't have to break our ass here 
     90+        * putting the string back together just for the sake of logging. 
     91+        */ 
     92+       syslog(LOG_INFO, "Yahoo! magic failed: non-OK server response to ID (\"GUID\" \"1\") command" ); 
     93+       goto fail; 
     94+   } 
     95+    } 
     96+ 
     97  
     98     /* 
     99      * Send the login command off to the IMAP server.  Have to treat a literal 
  • make/imapproxy/Config.in

     
     1config FREETZ_PACKAGE_IMAPPROXY 
     2    bool "ImapProxy 1.2.7" 
     3    select FREETZ_LIB_libcrypto 
     4    select FREETZ_LIB_libssl 
     5    default n 
     6    help 
     7        ImapProxy is a caching IMAP proxy server intended for use with WebMail clients 
     8        that cannot maintain persistent connections to an IMAP server 
     9 
  • make/imapproxy/imapproxy.mk

     
     1$(call PKG_INIT_BIN,1.2.7) 
     2$(PKG)_SOURCE:=up-$(pkg)-$($(PKG)_VERSION).tar.gz 
     3$(PKG)_SOURCE_MD5:=036b487a9a6d2b955f81eb80bd9faee0 
     4$(PKG)_SITE:=http://imapproxy.org/downloads 
     5$(PKG)_DIR:=$($(PKG)_SOURCE_DIR)/up-$(pkg)-$($(PKG)_VERSION) 
     6$(PKG)_BINARY1:=$($(PKG)_DIR)/bin/in.$(pkg)d 
     7$(PKG)_TARGET_BINARY1:=$($(PKG)_DEST_DIR)/usr/sbin/in.$(pkg)d 
     8$(PKG)_BINARY2:=$($(PKG)_DIR)/bin/pimpstat 
     9$(PKG)_TARGET_BINARY2:=$($(PKG)_DEST_DIR)/usr/sbin/pimpstat 
     10 
     11$(PKG)_DEPENDS_ON := openssl 
     12$(PKG)_LIBS := -lssl -lcrypto -ldl -lpthread 
     13 
     14$(PKG_SOURCE_DOWNLOAD) 
     15$(PKG_UNPACKED) 
     16$(PKG_CONFIGURED_CONFIGURE) 
     17 
     18$($(PKG)_BINARY1) $($(PKG)_BINARY2): $($(PKG)_DIR)/.configured 
     19    $(SUBMAKE) -C $(IMAPPROXY_DIR) \ 
     20        LDFLAGS="$(IMAPPROXY_LDFLAGS)" \ 
     21        LIBS="$(IMAPPROXY_LIBS)" 
     22 
     23$($(PKG)_TARGET_BINARY1): $($(PKG)_BINARY1) 
     24    $(INSTALL_BINARY_STRIP) 
     25 
     26$($(PKG)_TARGET_BINARY2): $($(PKG)_BINARY2) 
     27    $(INSTALL_BINARY_STRIP) 
     28 
     29$(pkg): 
     30 
     31$(pkg)-precompiled: $($(PKG)_TARGET_BINARY1) $($(PKG)_TARGET_BINARY2) 
     32 
     33$(pkg)-clean: 
     34    -$(SUBMAKE) -C $(IMAPPROXY_DIR) clean 
     35 
     36$(pkg)-uninstall: 
     37    $(RM) $(IMAPPROXY_TARGET_BINARY1) $(IMAPPROXY_TARGET_BINARY2) 
     38 
     39$(PKG_FINISH)