Archive for the 'Email' Category

Lyris Listmanager is a nice mailing list management system. However, there are a few features that are missing out of the frontend that make it hard to get by your day-to-day office job. Fortunately, most of it is written with TCL routines which are not encoded, which makes for easy updates to this code.

Of course this is not supported by Lyris and if you have problems with it after making your changes, don’t expect them to support it. Make backup of your files - in Linux this is /usr/local/lm

For this example, I’m going to add the Full Name field to survey results. By default, it shows the email address but not the name of the responding user.

Step 1:

Backup!

cp -R /usr/local/lm /usr/local/lm.bak

Step 2:

Open the file which holds the routine for the “Survey Details” page. This is in /htdocs/reports/surveys/.tml

vi /usr/local/lm/htdocs/reports/surveys/.tml

Step 3:

Modify the code to add in FullName:

In the routine surveyreports::page_all_answers

Change
set sql "SELECT lyrSurveyResponse.WebDocID, lyrSurveyResponseAnswers.ResponseID as ResponseID, lyrSurveyQuestions.UserQuestionNumber, lyrSurveyResponse.ResponseTime, lyrSurveyResponse.MemberID, lyrSurveyResponse.RespondingIP, lyrSurveyResponse.MailingID, lyrSurveyQuestions.QuestionText, lyrSurveyAnswers.AnswerText, lyrSurveyResponseAnswers.FreeFormAnswer, [dbinfo::members_name].[dbinfo::members_emailaddr]

to

set sql "SELECT lyrSurveyResponse.WebDocID, lyrSurveyResponseAnswers.ResponseID as ResponseID, lyrSurveyQuestions.UserQuestionNumber, lyrSurveyResponse.ResponseTime, lyrSurveyResponse.MemberID, lyrSurveyResponse.RespondingIP, lyrSurveyResponse.MailingID, lyrSurveyQuestions.QuestionText, lyrSurveyAnswers.AnswerText, lyrSurveyResponseAnswers.FreeFormAnswer, [dbinfo::members_name].[dbinfo::members_emailaddr] as EmailAddr, members_.fullname_ as FullName

Change

array set heading_labels "AnswerText {Answer} ResponseTime {Date} QuestionText {Question} EmailAddr {Email Address}"

to

array set heading_labels "AnswerText {Answer} ResponseTime {Date} QuestionText {Question} FullName {Full Name} EmailAddr {Email Address}"

Change

array set column_width "ResponseTime 15 QuestionText 25 AnswerText 25 EmailAddr 25 Action_ 10"

to

array set column_width "ResponseTime 15 QuestionText 25 AnswerText 10 FullName 15 EmailAddr 25 Action_ 10"

Change

set sortable {QuestionText AnswerText ResponseTime EmailAddr RespondingIP}

to

set sortable {QuestionText AnswerText ResponseTime FullName EmailAddr RespondingIP}

Save this file and that is it! You will now have full names in your survey responses.

Technorati Tags: , ,

I used to use a Thunderbird addon to remove duplicate messages in Thunderbird. This is handy if your mail client becomes “de synced” from your mail server, whether it be an IMAP or POP3 connection. Also this can occur if you restore a backup or import mails and it creates duplicates.

However, after Thunderbird 2.0 was released, this old plugin was not compatible. Eyalroz re-released the plugin under GPL and with updates for Thunderbird 2.0. If you have a need to remove duplicate emails - this is the plugin you need! Get it:

Remove Duplicate Messages (alternate)

Here are a few handy items for Postfix email server users:

1. If your system is acting as a spam / antivirus / relay server for secondary internal servers, and your destination mail server is down, postfix will queue your messages to resend at a later time. In order for postfix to instantly re-queue these messages you use:

postqueue -f

2. The mailq equivilant specific to postfix is

postqueue -p

3. If you want to delete specific messages in your queue, use an ncurses based open source software called pfqueue. It will give you a menu that shows mail currently queued, and allows you to delete specific emails.

Technorati Tags: ,

Well I got a lesson in properly configuring your e-mail server’s error messages. Since setting up postfix as a anti-spam and anti-virus gateway for my exchange system (see my article Postfix as proxy to exchange server), I had left the option
soft_bounce = yes
enabled in my postfix configuration.

This worked fine for months. However, I was then “joe jobbed” - which means that some spammer used my domain name as the “from” or “reply to” address on their e-mails. This causes a flood of e-mails from mail servers, which messages such as, no user exists, this account has been deleted, etc. These e-mails are completely valid and authentic responses from e-mail servers.

Now - it is my personal opinion that mail servers should reject connections to users who are not real - not generate more messages and bandwidth sending out their rejection response. But I understand why some e-mail providers wish to keep this option on, and I think Exchange has it on by default. So trying to change peoples minds is not going to work - we need to deal with these rejection messages responsibly.

Here is where my server configuration showed its flaws. Here is the official definition of the 450 and 550 error messages:

450 Requested mail action not taken: mailbox unavailable (e.g., mailbox busy)
550 Requested action not taken: mailbox unavailable (e.g., mailbox not found, no access, or command rejected for policy reasons)

The difference between the two error codes is not really apparent at first glance. However, 400 level commands tells the remote servers that there is a temporary error, and it should try again later. How much later depends on each server’s settings. The 500 level commands tell the remote server that it is a permanent failure, and it should not try again later.

In the case of a joe job - you have thousands of servers responding to your server that addresses can’t be found (or any other error). When you have each of those servers “retrying” their e-mail connects every 10 minutes or so, your server will quickly find itself rejecting a whole lot of messages.

Fortunately, the fix is easy. Fix your server to respond with a 550 instead of 450. Look at the change in the graph below - almost immediately after I switched to the 550 message:

SMTP 450 vs 550 rejection rate

You can see the benefits of keeping the 550 message. In postfix, the change is simple, change the soft_bounce line to:

soft_bounce = no

You can also customize your rejection codes for particular errors as below.

unknown_local_recipient_reject_code = 550
unknown_address_reject_code = 550
unknown_client_reject_code = 550
unknown_hostname_reject_code = 550
unknown_relay_recipient_reject_code = 550
unknown_virtual_alias_reject_code = 550
unknown_virtual_mailbox_reject_code = 550
unverified_recipient_reject_code = 550
unverified_sender_reject_code = 550

For more codes: Postconf manual

If your Mozilla Thunderbird is slow to open the inbox, or any other folder for that matter, there are two things that you can do to try to fix this problem.

Step #1: The first thing is to try to compact the folder. This should help if you have a large inbox. If you can’t even get to this step, or if it is just too slow, try step #2.

Step #2: The .msf “index” file is corrupted. If this file gets corrupted, you could see a slow initial loading of your inbox, messages will not open, you can not delete messages, etc. You may also see a message in the status windows when you open Thunderbird that says something about rebuilting index. The solution to this is to first close out of Thunderbird, then delete the inbox.msf file. If this is for a different folder name, you will see “folder name.msf” file corresponding to that folder. This file is located in your profile directory. For me this was: “C:\Documents and Settings\Dave\Application Data\Thunderbird\Profiles\default\svxnp81c.slt\Mail\systembash.com”
But this varies because of the random profile string and your account profile name.
Delete this file. Make sure you leave the real inbox file alone - this is a file that is named “inbox” (or your folder name) without a file extension.

Re-open Thunderbird - the index will automatically be rebuilt and you should now have normal access to your inbox!

I recently had a problem where my Spamassassin install started thinking that a lot of spam messages were really ham (non-spam). Since these were getting BAYES_00 scores of -2.5 they were almost all getting through my spam filter. These particular messages all were regarding STOCK quotes and were pretty obviously spam just by looking at the text of the messages. Somehow my Spamassassin install thought that they were not spam because the messages were being passed as ham by the Bayesian filter. Since they kept getting past, the bayesian filter kept learning them as HAM.

In order to break this vicious cycle, you just need to clear out the bayesian tokens. It’s very easy to do. As root user, type:
sa-learn --clear
This starts you fresh. By default, Spamassassin won’t use the bayes filter until it has 200 spam and ham messages, so until you get to that level it will continue to learn based the other Spamassassin detection settings.

Ideally, I would have sa-learn train using these spam messages. But since I use Outlook, and there is no “easy” way to have it interface with sa-learn, I find it easier to clean out the bayes tokens every once in a while. SpamAssassin Coach is a plugin for outlook which should connect to your spamd server and “learn” a message as ham or spam. But in practice, it did not work for me. It looks like the project has a lot of potential.

For more information on how Bayesian filtering works, check out this wikipedia article.

Technorati Tags: , ,

More and more people seem to be using an open source mail server on linux, such as Postfix, to proxy e-mails coming in from the net and relaying them to their exchange server. I know I’ve had this type of setup since January and it has been working really well for me. It gives you the ability to do advanced spam and antivirus filtering on messages, while keeping the easy to use GUI interface for creating exchange mailboxes. When will we get a great e-mail client so we can finally ditch the Exchange/Outlook setup that most businesses rely on? I know I haven’t found a solution that comes close (I’m sorry, Evolution for Win32 needs to come a bit further, and Thunderbird isn’t even close).

Anyway, once you have this system set up (there are some great instructions here, maybe I will cover this more another day), you may wish to sync up your Exchange users with your postfix “relay users” in order to trash messages coming in who are not addressed to anyone on the Exchange server. This will free up CPU cycles on the exchange server postfix server, and also reduce some bandwidth. Fortunately, Exchange 2000 and beyond use LDAP to publish this information. You can use Perl’s Net::LDAP module to grab this information. Chris Covington put together this nice script to grab the Exchange users and post to a file, which can then be postmapped and used in relay_recipient_maps. I hope you find it as useful as I did! [Local Mirror of the Script]

  • Welcome to systemBash, a technology and system administration blog by David Drager. If you enjoy this sort of content, can can subscribe to the RSS using the link to the right.