dada_bridge.pl is located in the, dada/plugins directory of the Dada Mail distribution.
dada_bridge.pl is a program created to allow the support of sending email from your mail reader to a Dada Mail list, both for announce-only tasks and discussion lists.
Before I get asked the inevitable question, ``why did you reinvent another wheel?'', here's my response:
dada_bridge.pl, along with Dada Mail is not meant to be a replacement for similar systems, such as Mailman or Majordomo. dada_bridge.pl is a much simpler program with far fewer features then either of these two programs.
As with most of Dada Mail, the primary goals are usability and... well - style!
dada_bridge.pl does solve a few problems with trying to use similar programs -
Having solved these two problems also makes dada_bridge.pl potentially more secure to use and opens its use to a wider audience.
Many of dada_bridge.pl's concepts are slightly different than what you may be used to in traditional mailing lists:
Usually, in a mailing list manager, this address is created automatically by the program itself: not so in Dada Mail - you'll have to manually create the email (POP3) account and plug in the email, pop3 server and username/password into Dada Mail.
This sounds like a step backward, but it allows anyone who can make POP3 accounts to have a discussion mailing list. You also have a whole lot of flexibility when it comes to what the List Email can be.
In normal use, dada_bridge.pl will check this account and route any messages it finds accordingly. When in normal use, do not check this account yourself.
Saying all this, dada_bridge.pl's niche is probably with small to medium sized lists. This program has not been tested with lists larger than a few hundred, so your mileage may vary.
The other thing you may want to take into consideration is the lack of proper threading in Dada Mail's web-based archives. At the moment, archives are only sorted by date.
This may/may not be a deal breaker, but also take into consideration that the displaying of complex email messages is usually actually better in Dada Mail than most other mail archive viewing programs.
One more thing to take into consideration is that there is currently no filter in place to reject messages based on size or type. There is a way currently to strip messages with attachments of a certain file ending or mime-type.
These two issues may be at least partly worked around using the preferences of your POP email account. Many services will at least allow you to set a per-mailbox limit, or even a per-message limit for size.
As for content, Dada Mail is currently completely MIME-aware and will accept anything it can parse, which means, multipart messages, attachments, inline embedded images - the works.
For a stopgap solution to the last issues, you may look into a mail filtering program like Procmail, which can be configured to death.
Multipart messages, attachments and inline embedded images will work very well if you use the *SQL backend for Archives. They may not work at all if you don't.
Since you don't have any control over the type of messages being sent using dada_bridge.pl, I would use the *SQL backend for Archives.
For the same reason, I also and cannot stress enough that you check,
Disable Embedded JavaScript in Archived Messages
In Dada Mail's List control panel under, Manage Archives - Archive Options - Advanced. This will prevent exploitations embedded in messages sent to the list when viewed in Dada Mail's own archives. Along with Javascript, this option will strip out: embed, object, frame, iframe, and meta tags.
This feature does require the use of a CPAN module called, HTML::Scrubber, which you may have to install yourself.
If you do not have this available, I do urgently suggest you do not use archiving for discussion lists.
Before we get into installation, here's how dada_bridge.pl is used:
One part of dada_bridge.pl is run as a Dada Mail plugin - you'll have to log into your list before you're able to make any changes to its settings.
The second part of dada_bridge.pl is the part that actually looks for any new mail to be examined and hopefully, broadcasted and sent out to your list. This part of dada_bridge.pl is usually run via a cronjob.
There's a few ways that dada_bridge.pl can do the second part, and we'll go in detail on how to set up both ways.
We're assuming your cgi-bin looks like this:
/home/account/cgi-bin/dada
and inside the dada directory is the mail.cgi file and the DADA (uppercase) directory. Make a new directory in the dada directory called, plugins (if it's not already there).
Upload your tweaked copy of dada_bridge.pl into that plugins directory. chmod 755 dada_bridge.pl
This plugin will give you a new menu item in your list control panel. Tell Dada Mail to make this menu item by tweaking the Config.pm file. Find this line in Config.pm file:
# {-Title => 'Discussion lists',
# -Title_URL => $PLUGIN_URL."/dada_bridge.pl",
# -Function => 'dada_bridge',
# -Activated => 1,
# },
Uncomment it (take off the ``#'''s)
Save the Config.pm file.
You're basically done configurating the dada_bridge.pl script. You can now, log into your list and under the, plugins heading you should now see a linked entitled, ``Discussion lists''. Clicking that will allow you to set up your list to receive mail from a mail reader.
Messages will not yet be received and sent out via dada_bridge.pl.
For that to happen - two things will have to be configured. The first is setting up the List Email - that's done in the control panel for the plugin itself and should (hopefully) be self-explanitory.
The second is to set up the cronjob and that's what we'll talk about next:
There's basically two ways to configure dada_bridge.pl to be run via a cronjob - the hard way, and the easy way. We'll start with the easy way, since it'll get you up and running.
We're going to assume that you already know how to set up a cronjob.
Basically, you just have to set up the cronjob to check a specific URL, and this is the URL:
http://example.com/cgi-bin/dada/plugins/dada_bridge.pl?run=1
Where, http://example.com/cgi-bin/dada/plugins/dada_bridge.pl is the URL to your copy of dada_bridge.pl
This will basically have dada_bridge.pl check any awaiting messages and hopefully, deliver them.
You may have to look through your hosting account's own FAQ, Knowledgebase and/or other docs to see exactly how you invoke a URL via a cronjob, but here's some examples on how it's usually done. In all these examples, I'll be running the script every minute ( * * * * * ) - tailor to your taste.
* * * * * /usr/local/bin/curl -s --get --data run=1 --url http://example.com/cgi-bin/dada/plugins/dada_bridge.pl
* * * * * /usr/bin/wget -O - -q http://example.com/cgi-bin/dada/plugins/dada_bridge.pl?run=1
or just try:
* * * * * wget http://example.com/cgi-bin/dada/plugins/dada_bridge.pl?run=1
If you do want to use this way of invoking the program to check awaiting messages and send them out, make sure to change the variable, $Allow_Manual_Run to, 1:
my $Allow_Manual_Run = 1;
at the top of the dada_bridge.pl script. If this variable is not set to, 1 this method will not work.
Conversly, if you'd like to disable this technique, the set the variable, $Allow_Manual_Run to, 0.
Running the plugin like this is somewhat risky, as you're allowing an anonymous web browser to run the script in a way that was originally designed to only be run either after successfully logging into the list control panel, or, when invoking this script via the command line.
If you'd like, you can set up a simple Passcode, to have some semblence of security over who runs the program. Do this by setting the, $Manual_Run_Passcode variable in the dada_bridge.pl source itself.
If you set the variable like so:
$Manual_Run_Passcode = 'sneaky';
You'll then have to change the URL in these examples to:
http://exampl.com/cgi-bin/dada/plugins/dada_bridge.pl?run=1&passcode=sneaky
If you'd like to only run one list, you may do so by changing the about URL's to something like this:
http://exampl.com/cgi-bin/dada/plugins/dada_bridge.pl?run=1&list=mylist
where, mylist is the listshortname of the list you'd like to have run.
This way isn't really ``hard'', it's just more traditional. We'll be setting up the script - and this means more configuration of the script itself, to be invoked correctly via the command line.
You'll need to explicitly state where both the:
This is because this script will be running in a different environment and from a different location than what you'd run it as, when you visit it in a web-browser. It's annoying, but one of the things you have to do when running a command line script via a cronjob.
As an example: use lib qw() lines probably look like:
use lib qw( /home/myaccount/www/cgi-bin/dada /home/myaccount/www/cgi-bin/dada/DADA/perllib /usr/local/lib/perl5/site_perl/5.8.0/mach /usr/local/lib/perl5/site_perl/5.8.0 /usr/local/lib/perl5/site_perl /usr/local/lib/perl5/5.8.0/BSDPAN /usr/local/lib/perl5/5.8.0/mach /usr/local/lib/perl5/5.8.0 );
The first few lines:
/home/myaccount/www/cgi-bin/dada /home/myaccount/www/cgi-bin/dada/DADA/perllib Are the B<Absolute Path of the local Dada Mail libraries>.
/home/myaccount/www/cgi-bin/dada is the absolute path to where the, dada directory in your cgi-bin (as it may be obvious).
/home/myaccount/www/cgi-bin/dada/DADA/perllib is a directory inside your dada directory. Most like if you can find that first line (), just tack on, ``/DADA/perllib'' and you've got the second line.
If you don't know where your site-wide Perl libraries are, try running this via the command line:
perl -e 'print $_ ."\n" foreach @INC';
If you do not know how to run the above command, visit your Dada Mail in a web browser, log into your list and on the left hand menu and: click, About Dada Mail
Under Script Information, click the, More... link and under the, Perl Library Locations, select each point that begins with a, ``/'' and use those as your site-wide path to your perl libraries.
Cron Jobs are scheduled tasks. We need something to check your POP3 email account quite a bit. We're going to set a cron job to test for new messages every minute. Here's an example cron tab:
* * * * * /usr/bin/perl /home/myaccount/cgi-bin/dada/plugins/dada_bridge.pl >/dev/null 2>&1
Where, /home/myaccount/cgi-bin/dada/plugins/dada_bridge.pl is the full path to the script we just configured.
Dada Mail can also be run manually via the command line. The various paramaters that can be passed are listed below.
By default, the ability for dada_bridge.pl to send and receive messages is disabled on a per-list basis. To enable sending, log into your list control panel and go to the dada_bridge.pl admin screen.
Uncheck:
Disable sending using this method
And you're off to the races.
You can access the dada_bridge.pl script via the command line. There are a few options you can use:
Example:
prompt>dada_bridge.pl --test pop3 --list yourlistshortname
Will test the pop3 connection of a list with a shortname of, yourlistshortname
Another Example:
prompt>dada_bridge.pl --verbose --list yourlistshortname
Will check for messages to deliver for list, yourlistshortname and outputting a lot of information on the command line.
Sometimes, the plugin has a hard time guessing what its own URL is. If this is happening, you can manually set the URL of the plugin in $Plugin_URL
Allows you to invoke the plugin to check and send awaiting messages via a URL. See, ``The Easy Way'' cronjob setting up docs, above.
Allows you to set a passcode if you want to allow manually running the plugin. See, ``Tehe Easy Way'' cronjob setting up docs, above.
You can specificy how many messages you want to have the program actually handle per execution of the script by changing the, $MessagesAtOnce variable in the source of the script itself. By default, it's set conservatively to, 1.
Sets a hard limit on how large a single message can actually be, before you won't allow the message to be processed. If a message is too large, it'll be simple deleted. A warning will be written in the error log, but the original sender will not be notified.
The text of the email message that gets sent out to the list owner, when they receive an email message that requires moderation.
The text of the email message that gets sent out to the subscriber who has a email message sent to the list that was rejected during moderation.
This plugin, much more so than the main Dada Mail program is a bit finicky, since you have to rely on getting a successful connection to your POP3 server and also be able to run the program via a cronjob.
The easiest way to debug your POP3 account info is to actually test it out.
If you have a command line, drop into it and connect to your POP3 server, like so:
prompt:]telnet pop3.example.com 110 Trying 12.123.123.123... Connected to pop3.example.com. Escape character is '^]'. +OK <37892.1178250885@hedwig.summersault.com> user user%example.com +OK pass sneaky +OK list
In the above example, pop3.example.com is your POP3 server. You'll be typing in:
user user%example.com
and:
pass sneaky
(changing them to their real values) when prompted. This is basically what dada_bridge.pl does itself.
If you don't have a command line, try adding an account in a desktop mail reader. If these credentials work there, they'll most likely work for dada_bridge.pl.
If your account information is correct and also logs in when you test the pop3 login information through dada_bridge.pl yourself, check to see if there isn't an email filter attached the account that looks at messages before they're delivered to the POP3 Mailbox and outright deletes messages because it triggered a flag.
This could be the cause of mysterious occurences of messages never reaching the POP3 Mailbox.
Copyright (c) 2004 - 2007 Justin Simoni
All rights reserved.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.