Wednesday, 28 October 2009

auto responder with postfix/virtual

To configure autoreponder for some address with postfix.

Edit the postfix virtual configuration:
Add -
email_address recepient_lists, email_address@autoreply.nic.net.sa
eg: wordpress@example.com recepient1@example.com, wordpress@google.com@autoreply.example.com

Edit the transport configuration:
Add -
autoreply.domain.com autoreply:
eg: autoreply.example.com autoreply:

Create pipe for the transponder in master.cf

autoreply unix - n n - - pipe
flags= user=nobody argv=/usr/local/bin/autoreply $sender $recipient


Created autoreply script at /usr/local/bin/autoreply
eg:

/usr/sbin/sendmail -oi -t << EOF
From: nobody@example.com
To: $1
Subject: Auto Response from example.com
Content-Type: text/plain; charset=utf-8

This is an autoreponder email.
EOF


There is other better way to do it with procmail and other tools, depends on your mail server setup

Add SPF for validation to mail server

It is good to have spf implemented to make the recepient mail servers trust your entity.

Use the spf wizard http://old.openspf.org/wizard.html to generate the record and add it in your dns zone file.

./arun

Tuesday, 27 October 2009

get rid of apache@localhost in received email headers

There is a good change that the foreign email servers will drop if the sender email headers are not properly formatted.
Anyway if you get apache@localhost in Received header (with postfix/apache/php), you can change the php.ini, sendmail_path program to use sendmail.postfix instead of sendmail binary.

like : sendmail_path = /usr/sbin/sendmail.postfix -t -i -f

./arun

Sunday, 25 October 2009

Hylafax/FaxMail with unicode encoding

It is pretty hard to get unicode works with fax ..
here are some scripts that i used to get the unicode done for incoming html/text faxes.

HTML
vi /etc/hylafax/faxmail/text/html
#!/bin/bash
cp -pf $1 /tmp/email.html
/usr/bin/lynx -dump -display_charset=utf-8 /tmp/email.html > /tmp/html_txt
/usr/bin/uniprint -font /etc/hylafax/faxmail/Cyberbit.ttf -in /tmp/html_txt -out /tmp/html_txt.uni
cat /tmp/html_txt.uni|/etc/hylafax/faxmail/filter.pl
rm /tmp/email.html
rm /tmp/html_txt
rm /tmp/html_txt.uni



plain text

vi /etc/hylafax/faxmail/text/plain
#!/bin/sh
/usr/bin/uniprint -font /etc/hylafax/faxmail/Cyberbit.ttf -in $1 -out /tmp/plain_txt
# echo " "
# echo "showpage"
cat /tmp/plain_txt | /etc/hylafax/faxmail/filter.pl
$rm /tmp/plain_txt


filter.pl
#!/usr/bin/perl
# Read from the standard input
@text=;
$size=@text;
# Count the number of "showpage"
$count=0;
for($i=0;$i<=$size;$i++){if($text[$i] =~ /showpage/){$count++;}}
# Discard the last line that contain "showpage"
$num=1;
for($i=0;$i<=$size;$i++){
if($text[$i] =~ /showpage/){
if($num!=$count){$num++;}
else{$text[$i]=~s/showpage//g;}
}
print $text[$i];
}

Wednesday, 21 October 2009

Cleanup mailman held messages

It will work usually with
$ cd /usr/lib/mailman
$ bin/discard /var/lib/mailman/data/heldmsg--*


If the list is too long
$ cd /var/lib/mailman
$ find data -name heldmsg--\* -print | xargs /usr/bin/discard

Sunday, 18 October 2009

Browse internet from Mac with android

At last i managed to get browsing working through 3G connection in android (donut 1.6).

Steps:
- Enable root in android
- install android-wifi-tether (http://code.google.com/p/android-wifi-tether/)
- configure it either with bluetooth or wireless
- connect your laptop with the android using wireless or bluetooth
- there we go now you should be able to browse internet, if you have netfilter module properly working in wireless tether
- since my kernel doesnt have netfilter module, the natting was not working - I was able to resolve domains from my laptop , but was not able to get the data
- Installed proxoid, and started
- Configured my webbrowser to use proxoid as proxy, it works ... charm!!!!

./arun

get the root access back on android development phone ADP1

It seems that after upgrading ADP1 with 1.6 , the root access gone.

It can be recovered with adb tool:

Connect your mobile with the computer,

do adb to the phone
$adb shell
$mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
$cd /system/bin
$cat sh > su
$chmod 4755 su


Worked Great!!!

Ref: http://phandroid.com/2009/04/29/adp-15-initial-thoughts/

Wednesday, 7 October 2009

working with "screen"

Screen is a full-screen window manager that multiplexes a physical terminal between several processes (typically interactive shells).

to activate screen enter
$ screen

open a new session Ctrl+a+c

Scroll between sessions Ctrl+a+a

retain the sessions
$screen -R

check $man screen for much beautiful options

Saturday, 3 October 2009

upgrade android to 1.5 cupcake

It was quiet trivial to update the android operating system to 1.5 manually,

The instructions for HTC ADP can be found at : http://developer.htc.com/adp.html

./arun

Tips to avoid spams from spamassassin

http://wiki.apache.org/spamassassin/AvoidingFpsForSenders

Fix for Postfix X-Authentication Warning

X-Authentication-Warning can appear on the mail header , when the user sending email is not trusted by the mail server. There is a chance that email are considered as spam because of this.

To fix it you can add the user to /etc/mail/trusted-users

If your system has forms that used to send email as apache user, you can add "apache" user to the trusted-users file.