e-mail

Drupal mail modules notes

Mailman Groups

OG och mail lists mailman

Webmail Plus

Webmail Plus is a full-featured email client for Drupal. It's designed to provide email for any or all members of a Drupal site. It relies on a standard IMAP (Dovecot, Courier-IMAP) server for mail storage and localhost or SMTP (Postfix, Exim) server for mail delivery. It's a great way to add email/webmail functionality to your Drupal community site.

Message tagging

Support Ticketing System module file name error fix

To fix Support Ticketing System module filename error I have used this hack in support.module. The problem is that if the file name contains other characters than A-Z it end up in some unconverted file name that is not good looking and can in some cases make it hard to open. The file name can look like this: "=?ISO-8859-1?Q?Spr=E5khantering=2Epdf?=" when it should be "Språkhantering.pdf". It seems like urldecode() encounters a problem and returns some sort of ISO string. My solution was to replace all non A-Z characters by "x".

Extracts e-mail addresses

<?php
/**
 * Extracts e-mail addresses from a string
 *
 */
function mymodule_extract_mailaddresses($string) {
 
$string = check_plain($string);
 
 
$string preg_replace('/[^a-öA-Ö0-9\s@.-]/', ' ', $string);
 
 
$array = explode(' ', $string);
 
  foreach (
$array as $key => $value) {
    if(
stristr($value, '@')){
     
$email[$value] = trim($value);
     
//watchdog('test_v', 'Test: '.trim($value), WATCHDOG_DEBUG);
   
}
  }
 
 
  return
$email;
}
?>

Check e-mail address

<?php
function check_emailaddress($email){
  if(
eregi("^[0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-wyz][a-z](g|l|m|pa|t|u|v)?$", $email, $check)) {
    if(!
checkdnsrr(substr(strstr($check[0], '@'), 1), "ANY")) {
      return
FALSE;
    }
  } else {
    return
FALSE;
  }
}
?>