Archive for the ‘Programming’ Category

Qmail: forward emails to a PHP script

In qmail, first add the domain alias. For myscript@servername make /var/qmail/alias/.qmail-myscript If its for /var/qmail/mailnames/ should do it. Contents need to be along the lines of: |/var/www/vhosts/ references:

Zeus 301 redirect

Add the following to rewrite.script: match URL into $ with (.*) set SCRATCH:COND = %{IN:Host} match SCRATCH:COND into % with ^domainname\.co\.uk if not matched then goto RULE_0_END set URL =$1 set RESPONSE = 301 set OUT:Location = %{URL} set BODY = Please try <a href=”%{URL}”>here</a> instead\n RULE_0_END:

mod_rewrite 301 redirect

To redirect the entire site, for example to enforce www. , add the following to .htaccess Options +FollowSymLinks RewriteEngine On RewriteCond %{HTTP_HOST} ^domain\.com$ [NC] RewriteRule ^(.*)$$1 [R=301,L]


CDONTS was deprecated and replaced by CDOSYS in Winddows 2003.  You can still install and use CDONTs if you need it though.  Just google for CDONTS and register the DLL. CDONTS Example: <% Option Explicit Dim objMail Dim strSubject Dim strBody strSubject = “This is a test email in HTML format”