secure rsync 
I want to rsync on my local-host via ssh from a remote host without a ssh enabled root account but full access to the whole filesystem.

ssh-keygen -t rsa
copy ~/.ssh/ to remote-host:/home/rsyncuser/.ssh/authorized_keys

rsync files with ssh:
rsync -vaHxr --numeric-ids --delete \
-e "ssh -c arcfour -o Compression=no -x" \
rsyncuser@remote-host:REMOTEDIR LOCALDIR

remote-host (source of files to rsync):
groupadd -g 3001 rsyncuser
useradd -u 3001 -g rsyncuser -s /bin/bash -m rsyncuser
ssh-dss 012345678...
limit access with from (optional).
On sucessfully ssh login command is executed.

echo “Rejected”
echo “Rejected”
echo “Rejected”
echo “Rejected”
echo “Rejected”
echo “Rejected”
rsync\ --server*)
echo "Rejected"
/usr/bin/sudo /usr/bin/rsync "$@";
rsyncuser ALL = NOPASSWD: /usr/bin/rsync

[ view entry ] ( 834 views )   |  print article
squirrelmail "Deutsch" 
apt-get install squirrelmail-locales squirrelmail-decode ispell wngerman

ln -s /etc/squirrelmail/apache.conf /etc/apache2/conf.d/squirrelmail.conf
chgrp -R www-data /usr/share/squirrelmail/

added "de_DE ISO-8859-1" to /var/lib/locales/supported.d/local

dpkg-reconfigure locales

invoke-rc.d apache2 restart

10/1: de_DE

[ view entry ] ( 761 views )   |  print article
Postfix and Spamassassin 
apt-get install spamassassin spamc re2c make gcc libc6-dev

I want to run spamassassin as non root user.
groupadd -g 3000 spamd
useradd -u 3000 -g spamd -s /bin/false -d /var/lib/spamassassin spamd
mkdir /var/lib/spamassassin
chown spamd:spamd /var/lib/spamassassin
OPTIONS="--create-prefs --max-children=5 --ipv4-only --username spamd \
--helper-home-dir /var/lib/spamassassin -s /var/log/spamd.log"
/var/log/spamd.log {
rotate 5
report_safe 0
lock_method flock
required_score 5.0
use_bayes 1
bayes_auto_learn 1
bayes_ignore_header X-Bogosity
bayes_ignore_header X-Spam-Flag
bayes_ignore_header X-Spam-Status
in /etc/spamassassin/v310.pre disabled Pyzor, Razor2 and SpamCop
in /etc/spamassassin/v320.pre enabled loadplugin Mail::SpamAssassin::Plugin::Rule2XSBody

cyrus unix - n n - - pipe flags=R user=cyrus argv=/usr/bin/spamc -f -u spamd \
-e /usr/sbin/cyrdeliver -f ${sender} -m ${extension} ${user}
i want to use a compiled ruleset for spamassassin
#> sa-update
#> su spamd -s /bin/sh -c sa-compile
#> invoke-rc.d spamassassin reload

users should be able to tell the mailserver what mails a spam or ham.
i created public mailboxes where uses can move sam or ham mails into:
sudo cyradm --user cyrus --server localhost
cm user.spam
sam user.spam anyone p
sam user.spam admin all
cm user.nospam
sam user.nospam anyone p
sam user.nospam admin all
Two cronjobs monitors these folders and let spamassassin learn.
*/5 * * * * root for n in /var/spool/cyrus/mail/s/user/spam/*\.; \
do [ -f "$n" ] && /usr/bin/sa-learn --dbpath /var/lib/spamassassin/.spamassassin \
--spam $n && rm -f $n && su cyrus -c "/usr/sbin/cyrreconstruct user.spam"; done
*/5 * * * * root for n in /var/spool/cyrus/mail/n/user/nospam/*\.; \
do [ -f "$n" ] && /usr/bin/sa-learn --dbpath /var/lib/spamassassin/.spamassassin \
--ham $n && rm -f $n && su cyrus -c "/usr/sbin/cyrreconstruct user.nospam"; done
Spamassassin marks mail-headers with X-Spam-Status. According to this users can create an own spam folder and with a sieve filter automatically move them to this folder if X-Spam-Status is Yes.

Because we are running as spamd

-sa-compile > /dev/null 2>&1
+su spamd -s /bin/sh -c sa-compile > /dev/null 2>&1

[ view entry ] ( 1059 views )   |  print article
cyrus postfix pop-before-smtp 
apt-get install pop-before-smtp

uncomment $pat for cyrus in /etc/pop-before-smtp/pop-before-smtp.conf

smtpd_recipient_restrictions = permit_mynetworks,
check_client_access hash:/var/lib/pop-before-smtp/hosts,
list collected IP's with:
pop-before-smtp --list

[ view entry ] ( 808 views )   |  print article
cyrus offline transfer mailboxes to a new server 
On old cyrus server:

export mailboxes.db:
su - cyrus -c 'ctl_mboxlist -d > cyrus_mboxlist.txt
export seen databases:
su - cyrus -c 'for seenfile in `find /var/lib/imap/user -name \*.seen`; do \
/usr/lib/cyrus/bin/cvt_cyrusdb $seenfile skiplist ${seenfile%seen}txt flat; \
export deliver.db: (check for your format, here is berkeley-nosync)
su - cyrus -c '/usr/lib/cyrus/bin/cvt_cyrusdb /var/lib/imap/deliver.db \
berkeley-nosync /var/lib/imap/deliver.txt flat'

Copy these files and all mailboxes to the new cyrus server, import and reconstruct mailboxes:

stop cyrus
remove old things:
rm /var/lib/imap/db/*
rm /var/lib/imap/tls_sessions.db
rm /var/lib/imap/mailboxes.db
rm /var/lib/imap/deliver.db
find /var/lib/imap/ -type f -name *.seen | xargs rm
check if all files ae owned by cyrus:mail
import mailboxes.db:
su - cyrus -c 'ctl_mboxlist -u <cyrus_mboxlist.txt'
reconstruct mailboxes:
cyrreconstruct -r user
import seen databases:
su - cyrus -c 'for txtfile in `find /var/lib/imap/user -name \*.txt`; do \
/usr/lib/cyrus/bin/cvt_cyrusdb $txtfile flat ${txtfile%txt}seen skiplist; \
import deliver.db:
su - cyrus -c '/usr/lib/cyrus/bin/cvt_cyrusdb /var/lib/imap/deliver.txt \
flat /var/lib/imap/deliver.db berkeley-nosync'
start cyrus

[ view entry ] ( 947 views )   |  print article

<<First <Back | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | Next> Last>>