1. Summary
  2. Files
  3. Support
  4. Report Spam
  5. Create account
  6. Log in

Ticket #26524 (assigned)

Opened 22 months ago

Last modified 14 months ago

Can't post standard XML files - even in code tags - to forums due to anti-spam measures.

Reported by: thor84no Owned by: ctsai
Keywords: PEND Cc:
Private: no

Description

I'm not sure if this is the right place to raise this, but it's the only place I could find. Anyway, it's highly annoying that the SF forums keep preventing me from posting full XML files because they have a bunch of URI's in the declaration (namespaces etc.) I'm not sure if the problem is just that the XML files I've been trying to post are relatively short or not, but surely there's a better way of preventing spam than to stop people posting their config files when asking for help.

Change History

Changed 22 months ago by ctsai

  • keywords PEND added; spam, forum, xml removed
  • owner set to ctsai
  • status changed from new to assigned

Greetings,

Could you post some sample text for what you're having problems posting here? (We don't have the same anti-spam measures in this ticketing system)

Also, the specific error message you're seeing would be helpful as well.

Thanks,
Chris Tsai, SourceForge.net Support

Changed 22 months ago by thor84no

Hello.

The example file I attempted to post earlier was a spring bean XML file:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
    <bean id="paramFilter" class="net.ubiquity.datamodel.synchronisation.extensions.SymmetricDsParameterFilter"/>
</beans>

I'm not 100% sure, but I believe the error message was:
"Sorry, the text entered looks like spam and cannot be posted."

Changed 14 months ago by scientastic

I also wanted to paste a Bash script as a response but was blocked by the same system. Here is my attempted reply (to the thread at https://sourceforge.net/projects/davmail/forums/forum/644057/topic/4641272/index/page/1):


I solved this problem in my own way. I learned how to create a Synology .spk (package file) and automated the process of creating the package itself. You can create your own package using the instructions here.

Disclaimer:
I DO NOT SUPPORT THIS IN ANY WAY. YOU SUPPORT IT YOURSELF AND RUN IT AT YOUR OWN RISK.

Prerequisites:
[ul]
[li]Java already installed on your machine. (I used the instructions at http://pcloadletter.co.uk/2011/08/23/java-package-for-synology/)[/li]
[li]Possibly, you may need the ipkg and other enhancements, although I tried to avoid dependencies on them./li
/ul

Configuration:
[ul]
[li]The initial basic configuration (Exchange webmail URL, and path to Java runtime environment) must be passed to the package build script, as described below./li
[li]The installed package doesn\'t yet have a UI, so if you need to do any further configuration beyond the basics, you\'ll have to tweak the configuration on the live Synology box by editing /var/packages/DavMail/target/davmail.properties from the command line./li
/ul

To build your own package:
[ol]
[li]Copy the script further below into a file called \'build-davmail-synology-package.sh\' and save it on your Synology, such as in the public/ directory/il
[li]Figure out what your Exchange webmail URL is-- see the Davmail documentation if you are confused. It usually looks like this: http://webmail.example.com/owa/ or http://webmail.example.com/exchange/[/li]
[li]Log in via SSH and figure out where your Java runtime environment is. For example, if you\'ve installed Java via the instructions at http://pcloadletter.co.uk/2011/08/23/java-package-for-synology/, then your JRE_HOME is likely /volume1/@appstore/java6/jre./li
[li]Change to the public/ directory (or wherever you saved the build script) and run the script by typing:
[code]/bin/sh build-davmail-synology-package.sh \"EXCHANGE_WEBMAIL_URL\" \"JRE_HOME\"/code
Of course, substitute your actual Exchange webmail URL and JRE_HOME when you call it./il
[li]If the build script runs successfully, it will tell you where the package file is when it is done. Copy that to a place you can access it, then use the DSM Package Center interface in your browser to upload and install it./li
/ol.

And now, the script:
[code]#!/bin/sh

echo
echo \"$0 starting...\"
echo

#-----------------------------------------------------------------------------
# Documentation
#-----------------------------------------------------------------------------
#
usage() {

cat <<EOF

This script builds a custom DavMail package for installing on a Synology
server.

This is a plain shell script and is designed to be able to be run on the
Synology box itself.

It depends on having Java already installed.

Usage:

$0 EXCHANGE_WEBMAIL_URL JRE_HOME [PORT_OFFSET]

where

EXCHANGE_WEBMAIL_URL is the URL you use in your browser to access the

Exchange webmail interface. Typically ends in
owa/ or exchange/. Examples:
http://webmail.example.com/owa/
http://webmail.example.com/exchange/
See DavMail documentation for more.

JRE_HOME is the path to the Java runtime environment (JRE)

installed on the Synology box. You may have to
hunt around to find this information.

PORT_OFFSET is a number to add to the standard port numbers for

each of the services. Default is $PORT_OFFSET.
For example, the standard IMAP port is 143; the
DavMail example configurations use $(( $PORT_OFFSET + 143 )).

EOF

exit 1

}

#-----------------------------------------------------------------------------
# Defaults
#-----------------------------------------------------------------------------
#
PORT_OFFSET=1000

# Version info for DavMail-- update when there\'s a new release
VERSION=4.1.0
BUILD=2042

#-----------------------------------------------------------------------------
# Arguments and settings
#-----------------------------------------------------------------------------
#

if [[ \"$1\" == \"-h\" \"$1\" == \"--help\" ]]; then

usage

fi

# Read arguments
EXCHANGE_WEBMAIL_URL=\"$1\"; shift
if [ ! \"$EXCHANGE_WEBMAIL_URL\" ]; then

echo \"Please provide EXCHANGE_WEBMAIL_URL.\"
usage

fi

JRE_HOME=\"$1\"; shift
if [ ! -x \"$JRE_HOME/bin/java\" ]; then

echo \"Missing or invalid JRE_HOME.\"
usage

fi

if [ \"$1\" ]; then

PORT_OFFSET=\"$1\"; shift

fi

#------------------------------------------------------------------------------
# Derived parameters
#------------------------------------------------------------------------------

# Name and location of the DavMail install file
ZIPFILE=\"davmail-$VERSION-$BUILD.zip\"
DOWNLOAD_URL=\"http://downloads.sourceforge.net/project/davmail/davmail/$VERSION/$ZIPFILE\"

# Port numbers
POP_PORT=$(( $PORT_OFFSET + 110 ))
IMAP_PORT=$(( $PORT_OFFSET + 143 ))
SMTP_PORT=$(( $PORT_OFFSET + 25 ))
CALDAV_PORT=$(( $PORT_OFFSET + 80 ))
LDAP_PORT=$(( $PORT_OFFSET + 389 ))

#------------------------------------------------------------------------------
# Start!
#------------------------------------------------------------------------------
#
# Save our current working directory. The finished package will be saved there
OUTPUT_DIR=$PWD

echo; echo \"Creating a temporary build directory...\"
rm -rf /tmp/DavMail
mkdir /tmp/DavMail
cd /tmp/DavMail

echo; echo \"Downloading the DavMail server software file...\"
wget $DOWNLOAD_URL -O /tmp/$ZIPFILE

echo; echo \"Unzipping into an internal package/ directory...\"
mkdir package
cd package
unzip /tmp/$ZIPFILE

echo; echo \"Extracting the icons...\"
# Synology likes a 72x72 icon, but the largest I could find in the davmail.jar
# is 48x48. We\'ll just have to let Synology scale it up
mkdir images
cd images
unzip ../davmail.jar tray.png tray32.png tray48.png
cd ..

# There are two ways of including an icon for the package:
# 1. As a PACKAGE_ICON.PNG file in the root of the .spk
# 2. As a base64-encoded string in the INFO file
#
# Choose your method by setting this variable to \"file\" or \"base64\"
ICON_INCLUDE_METHOD=\"base64\"

case $ICON_INCLUDE_METHOD in

\"file\")

echo \"Copying the largest one for the package...\"
cp images/tray48.png ../PACKAGE_ICON.PNG
;;

\"base64\")

echo \"Encoding the largest icon as a base64 string...\"
# The Synology doesn\'t have the base64 utility installed, so use PHP
BASE64_IMAGE=`php <<EOF

<?php
echo base64_encode(file_get_contents(\"images/tray48.png\"));
?>
EOF`

;;

esac

# Remove this line if/when we use the images for any kind of UI...
rm -rf images

# Adapted from http://davmail.sourceforge.net/serversetup.html
echo; echo \"Creating the configuration for davmail...\"
cat > davmail.properties <<EOF
davmail.url=$EXCHANGE_WEBMAIL_URL
davmail.enableEws=auto
davmail.popPort=$POP_PORT
davmail.imapPort=$IMAP_PORT
davmail.smtpPort=$SMTP_PORT
davmail.caldavPort=$CALDAV_PORT
davmail.ldapPort=$LDAP_PORT
davmail.keepDelay=30
davmail.sentKeepDelay=90
davmail.caldavPastDelay=90
davmail.imapIdleDelay=
davmail.useSystemProxies=false
davmail.enableProxy=false
davmail.proxyHost=
davmail.proxyPort=
davmail.proxyUser=
davmail.proxyPassword=
davmail.noProxyFor=
davmail.ssl.keystoreType=JKS
davmail.ssl.keyPass=
davmail.ssl.keystoreFile=
davmail.ssl.keystorePass=
davmail.smtpSaveInSent=true
davmail.server=true
davmail.server.certificate.hash=
davmail.bindAddress=
davmail.clientSoTimeout=
davmail.allowRemote=true
davmail.disableUpdateCheck=false
log4j.rootLogger=WARN
log4j.logger.davmail=DEBUG
log4j.logger.org.apache.commons.httpclient=WARN
log4j.logger.httpclient.wire=WARN
davmail.logFilePath=/var/packages/DavMail/target/log/davmail.log
EOF
mkdir log

echo; echo \"Creating package.tgz...\"
tar czf ../package.tgz *
cd ..
rm -rf package

echo; echo \"Creating the INFO file...\"
cat > INFO <<EOF
package=\"DavMail\"
version=\"$VERSION\"
maintainer=\"scientastic\"
description=\"Ever wanted to get rid of Outlook? DavMail is a POP/IMAP/SMTP/Caldav/Carddav/LDAP exchange gateway allowing users to use any mail/calendar client (e.g. Thunderbird with Lightning or Apple iCal) with an Exchange server, even from the internet or behind a firewall through Outlook Web Access. DavMail now includes an LDAP gateway to Exchange global address book and user personal contacts to allow recipient address completion in mail compose window and full calendar support with attendees free/busy display.\"
reloadui=\"no\"
arch=\"noarch\"
EOF
if [ \"$ICON_INCLUDE_METHOD\" = \"base64\" ]; then

echo \"package_icon=\\\"$BASE64_IMAGE\\\"\" >> INFO

fi

echo; echo \"Creating the package scripts...\"
mkdir scripts
cd scripts
cat > preinst <<EOF
#!/bin/sh
exit 0
EOF
cat > postinst <<\'EOF\'
#!/bin/sh

eval $(env | grep \"SYNOPKG_PKGDEST=\")
# This would be for later, if we install any kind of UI
# Wouldn\'t it be nice if we could just use Java Web Start to let them launch the UI on their desktop and control the settings saved in the server?
#ret=ln -s \"${SYNOPKG_PKGDEST}/davmail\" /usr/syno/synoman/webman/3rdparty/davmail
ret=chown -R admin.users $SYNOPKG_PKGDEST

exit 0
EOF
cat > preuninst <<EOF
#!/bin/sh
exit 0
EOF
cat > postuninst <<EOF
#!/bin/sh
# This would be for later, if we install any kind of UI
#rm -rf /usr/syno/synoman/webman/3rdparty/davmail
exit 0
EOF
cat > start-stop-status <<EOF
#!/bin/sh

case \\$1 in

start)

cd \\$SYNOPKG_PKGDEST
PATH=\\$PATH:$JRE_HOME/bin
nohup /bin/sh davmail.sh davmail.properties &
exit 0
;;

stop)

# Very hackish-- but works
java_pid=\\netstat -lnp | sed -n \"/$SMTP_PORT/ s|^.*LISTEN\\s*\\([0-9]\\+\\)/java\\$|\\1|p\"\\
kill \\$java_pid
exit 0
;;

status)

# TODO: implement?
exit 0
;;

log)

echo \"DavMail is installed properly. TODO: Add more info here...\" > /tmp/davmail.log
echo \"/tmp/davmail.log\"
exit 0
;;

esac
EOF
chmod +x *
cd ..

echo; echo \"Creating the Synology .spk file...\"
PACKAGE_FILE=\"$OUTPUT_DIR/DavMail-$VERSION-$BUILD-packaged-date +%F-%H-%M.spk\"
tar czf $PACKAGE_FILE *

echo; echo \"Cleaning up...\"
rm -rf /tmp/DavMail /tmp/$ZIPFILE

echo; echo \"Done!\"
echo
echo \"Package created at $PACKAGE_FILE.\"
echo \"You can install it via the DSM\'s Package Center.\"
echo/code

Changed 14 months ago by scientastic

OK, so I removed the Bash script and put it in a pastie, and it still rejects my post, which is as follows:

I solved this problem in my own way. I learned how to create a Synology .spk (package file) and automated the process of creating the package itself. You can create your own package using the instructions here.

Disclaimer:
I DO NOT SUPPORT THIS IN ANY WAY. YOU SUPPORT IT YOURSELF AND RUN IT AT YOUR OWN RISK.

Prerequisites:
[ul]
[li]Java already installed on your machine. (I used the instructions at http://pcloadletter.co.uk/2011/08/23/java-package-for-synology/)[/li]
[li]Possibly, you may need the ipkg and other enhancements, although I tried to avoid dependencies on them./li
/ul

Configuration:
[ul]
[li]The initial basic configuration (Exchange webmail URL, and path to Java runtime environment) must be passed to the package build script, as described below./li
[li]The installed package doesn\'t yet have a UI, so if you need to do any further configuration beyond the basics, you\'ll have to tweak the configuration on the live Synology box by editing /var/packages/DavMail/target/davmail.properties from the command line./li
/ul

To build your own package:
[ol]
[li]Copy the script from http://pastie.org/6118397 into a file called \'build-davmail-synology-package.sh\' and save it on your Synology, such as in the public/ directory/il
[li]Figure out what your Exchange webmail URL is-- see the Davmail documentation if you are confused. It usually looks like this: http://webmail.example.com/owa/ or http://webmail.example.com/exchange/[/li]
[li]Log in via SSH and figure out where your Java runtime environment is. For example, if you\'ve installed Java via the instructions at http://pcloadletter.co.uk/2011/08/23/java-package-for-synology/, then your JRE_HOME is likely /volume1/@appstore/java6/jre./li
[li]Change to the public/ directory (or wherever you saved the build script) and run the script by typing:
[code]/bin/sh build-davmail-synology-package.sh \"EXCHANGE_WEBMAIL_URL\" \"JRE_HOME\"/code
Of course, substitute your actual Exchange webmail URL and JRE_HOME when you call it./il
[li]If the build script runs successfully, it will tell you where the package file is when it is done. Copy that to a place you can access it, then use the DSM Package Center interface in your browser to upload and install it./li
/ol.

Changed 14 months ago by scientastic

Looks like it just doesn't like too many outbound URLs. I removed most of them and it went through.

Note: See TracTickets for help on using tickets.