Posts Under 'email'

Postfix Header Checks

Postfix header checks to reject spam mails : /^Subject:.*=\?(big5|euc-kr|gb2312|ks_c_5601-1987)\?/ REJECT No foreign character sets, please. /^(Content-Type:.*|\s+)charset\s*=\s*”?(big5|euc-kr|gb2312|koi8|Windows-1251|ks_c_5601-1987)”?/ REJECT No foreign character sets, please. /^(Content-Type:.*|\s+)charset\s*=\s*”?(Windows-1251)\?/ REJECT Probably a windows virus. /^From:.*\@.*\.r[uo]/ REJECT No Russian or Romanian mail, please. /^From:.*\@.*\.bg/ REJECT No foreign character sets for bg, please. /^From:.*\@.*\.nz/ REJECT No foreign character sets for nz, please. /^From:.*\@.*\.lb/ […]

Read more »


Send Simple HTML email with JavaMail

Send Simple HTML email with JavaMail The JavaMail API provides a platform-independent and protocol-independent framework to build mail and messaging applications. This one is the simple program which can be used to send email with JAVA. import javax.mail.*; import javax.mail.internet.*; import java.util.Properties; class SimpleHTMLMail { public static void main(String[] args) throws Exception{ System.out.println("Sending mail…"); Properties […]

Read more »


How to filter spam with Spamassassin and Postfix in Debian

Install Spamassassin in Debian #apt-get install spamassassin spamc spamassassin package can also be integrated into a Mail Transport Agent such as postfix. Preparation By default Spamassassin will run as root users when you install from debian repository and is not started to avoid that, we are going to create a specific user and group for […]

Read more »