
apt-get intall postfix

(choose to run as standalone daemon when asked)

setup a pop3 or imap server using always apt-get

apt-get install dovecot-common dovecot-imapd dovecot-pop3d

create your local account
useradd emailusername

configure it to catch all postfix

http://www.cyberciti.biz/faq/howto-setup-postfix-catch-all-email-accounts/

these steps:

Mapping is done using /etc/postfix/virtual file.
# vi /etc/postfix/virtual
Append code as follows, replacing domain and emailusername with actual values:
@yourdomain.com emailusername

Save and close the file. Run following command:
# postmap /etc/postfix/virtual

Also make sure you have following line in /etc/postfix/main.cf file:
virtual_alias_maps = hash:/etc/postfix/virtual

If you just added above, line reload postfix:
# service postfix reload

by these way all email with XXXXXXXXX@foxboxhost.tld

will be send to the realtive alias emailuser

then

modify /etc/.procmailrc as below

SHELL=/bin/sh
VERBOSE=OFF
MAILDIR=/mnt/flash/spool/maildir
DEFAULT=/mnt/flash/spool/mail/mails
LOGFILE=/var/log/procmail.log

:0
*  ^Subject:.*
{
:0c:
${DEFAULT}
:0
{
#bW:mail.body.lock
TONUM_=`formail -xFrom: \
      | expand | sed -e 's/^[ ]*//g' -e 's/[ ]*$//g' | sed -r 's/[+]+//g' | awk 'BEGIN { FS="@" } /@/ { print $1 }'`
#POSI=`expr index "${SUBJ_}" 00`
REPLA0=$SUBJ_
POSI=`expr substr $REPLA0 1 2`
LUN=`expr length $REPLA0`
#if [[ $POSI == "00" ]]; then
#       SUBJ_=`expr substr $REPLA0 3 $LUN`
#fi
    # Get the body of the message into a variable
    # Accept only the first five lines
    # Discard newlines, i.e. put everything on one line
    BODY_=`sed -e '1,/^$/ d' | head -5 | tr -d '\n'`
#echo "${SUBJ_} ${BODY_}" > /var/test.txt
#| /etc/sms/scripts/email2sms
}
:0:bW:mail.body.lock
| case $POSI in 00) SUBJ_=`expr substr $REPLA0 3 $LUN`;; *) REPLA0=$SUBJ;; esac;echo "From:mail\nTo:${TONUM_}\n\n${BODY_}" > $(mktemp /mnt/flash/spool/outgoing/smsgw.out.XXXXXX)
}

