c840a1d04f
o plugins/check_badmailfromto - New plugin in the style of check_badmailfrom, which matches a pair of FROM/TO and makes it seem like the recipient's address no longer exists (but only from the matching sender's point of view). Useful for stalkers and other harassment cases. o plugins/dns_whitelist_soft - New plugin to provide a DNS-based whitelist (good for distributed sites). o various files - Replaced tab character with 8 spaces and adjusted line breaks for better readability. Changes by mct@toren.net (Michael C. Toren) o lib/Qpsmtpd/SMTP.pm - Assumes a MAIL FROM value of "<#@[]>" (utilized by qmail to indicate a null sender when generating a doublebounce message) is equivalent to "<>". Previously qpsmtpd complained that the value could not be parsed. - Adds LOGIN to the default list of supported auth mechanisms. The documentation in Auth.pm indicated that auth-login was not currently supported due to lack of functionality, however I can confirm that LOGIN appears to work fine as tested by using msmtp (http://msmtp.sourceforge.net/). Are there any indications that LOGIN support is actually broken in the current implementation? - Removes the "X-Qpsmtpd-Auth: True" header appended when a message has been sent by an authenticated user. One problem with such a header is that it's impossible to say which SMTP hop added it, and it provides no information which could be used to backtrack the transaction. I grepped through my mail archives a bit looking for how other MTAs handled the problem, and decided it would be best to place this information in the Received: header: Received: from remotehost (HELO remotehost) (192.168.42.42) (smtp-auth username foo, mechanism cram-md5) by mail.netisland.net (qpsmtpd/0.28) with ESMTP; <date> o lib/Qpsmtpd/Auth.pm: - Documentation update for the arguments passed to an auth handler; previously the $mechanism argument was not mentioned, which threw off the argument offsets. - Documentation update for auth-login removing the warning that auth-login is not currently supported due to lack of functionality. - Fix to execute a generic auth hook when a more specific auth-$mechanism hook does not exist. (Previously posted to the list last week.) - Upon authentication, sets $session->{_auth_user} and $session->{_auth_mechanism} so that SMTP.pm can include them in the Received: header. o plugins/queue/qmail-queue - Added a timestamp and the qmail-queue qp identifier to the "Queued!" 250 message, for compatibility with qmail-smtpd, which can be very useful for tracking message delivery from machine to machine. For example, the new 250 message might be: 250 Queued! 1105927468 qp 3210 <1105927457@netisland.net> qmail-smtpd returns: 250 ok 1106546213 qp 7129 Additionally, for consistency angle brackets are placed around the Message-ID displayed in the 250 if they were missing in the message header. o plugins/check_badmailfrom: - Changed the error message from "Mail from $bad not accepted here" to "sorry, your envelope sender is in my badmailfrom list", for compatibility with qmail-smtpd. I didn't see any reason to share with the sender the value of $bad, especially for situations where the sender was rejected resulting from a wildcard. o plugins/check_earlytalker: o plugins/require_resolvable_fromhost: - No longer checks for earlytalkers or resolvable senders if the connection note "whitelistclient" is set, which is nice for helping backup MX hosts empty their queue faster. o plugins/count_unrecognized_commands: - Return code changed from DENY_DISCONNECT, which isn't valid in an unrecognized_command hook, to DENY, which in this context drops the connection anyway. (Previously posted to the list last week.) git-svn-id: https://svn.perl.org/qpsmtpd/trunk@356 958fd67b-6ff1-0310-b445-bb7760255be9 |
||
---|---|---|
config.sample | ||
lib | ||
log | ||
plugins | ||
t | ||
.cvsignore | ||
Changes | ||
CREDITS | ||
LICENSE | ||
Makefile.PL | ||
MANIFEST | ||
MANIFEST.SKIP | ||
qpsmtpd | ||
qpsmtpd-forkserver | ||
qpsmtpd-server | ||
README | ||
README.plugins | ||
run | ||
STATUS |
# # this file is best read with `perldoc README` # =head1 NAME Qpsmtpd - qmail perl simple mail transfer protocol daemon web: http://develooper.com/code/qpsmtpd/ mailinglist: qpsmtpd-subscribe@perl.org =head1 DESCRIPTION What is Qpsmtpd? Qpsmtpd is an extensible smtp engine written in Perl. No, make that easily extensible! See plugins/quit_fortune for a very useful, er, cute example. =head2 What's new in this release? See the Changes file! :-) =head2 What's new in version 0.1x from 0.0x? Version 0.1x is all rearchitected, with an object oriented plugin infrastructure. Weeh, that sounds fancy! Of course it is keeping the well tested core code from version 0.0x which have had more than a years production usage on many sites. Noteworthy new features includes a SpamAssassin integration plugin, more documentation and support for arbitrarily large messages without exhausting memory (up to the size of whatever your file system supports). =head1 Installation =head2 Required Perl Modules The following Perl modules are required: Net::DNS Mail::Address If you use a version of Perl older than 5.8.0 you will also need Data::Dumper File::Temp The easiest way to install modules from CPAN is with the CPAN shell. Run it with perl -MCPAN -e shell =head2 qpsmtpd installation Make a new user and a directory where you'll install qpsmtpd. I usually use "smtpd" for the user and /home/smtpd/qpsmtpd/ for the directory. Put the files there. If you install from CVS you can just do run the following command in the /home/smtpd/ directory. cvs C<-d> :pserver:anonymous@cvs.perl.org:/cvs/public co qpsmtpd chmod o+t ~smtpd/qpsmtpd/ (or whatever directory you installed qpsmtpd in) to make supervise start the log process. Edit the file config/IP and put the ip address you want to use for qpsmtpd on the first line (or use 0 to bind to all interfaces). If you use the supervise tools, then you are practically done now! Just symlink /home/smtpd/qpsmtpd into your /services (or /var/services or /var/svscan or whatever) directory. Remember to shutdown qmail-smtpd if you are replacing it with qpsmtpd. If you don't use supervise, then you need to run the ./run script in some other way. The smtpd user needs write access to ~smtpd/qpsmtpd/tmp/ but should not need to write anywhere else. This directory can be configured with the "spool_dir" configuration. As per version 0.25 the distributed ./run script runs tcpserver with the -R flag to disable identd lookups. Remove the -R flag if that's not what you want. =head2 Configuration Configuration files can go into either /var/qmail/control or into the config subdirectory of the qpsmtpd installation. Configuration should be compatible with qmail-smtpd making qpsmtpd a drop-in replacement. If qmail is installed in a nonstandard location you should set the $QMAIL environment variable to that location in your "./run" file. If there is anything missing, then please send a patch (or just information about what's missing) to the mailinglist or to ask@develooper.com. =head1 Better Performance As of version 0.21 qpsmtpd supports "PPerl" http://search.cpan.org/search?dist=PPerl "PPerl turns ordinary perl scripts into long running daemons, making subsequent executions extremely fast. It forks several processes for each script, allowing many processes to call the script at once." Running under PPerl is easy - just change your "run" file to contain the following command: pperl -Tw -- --prefork=$MAXCLIENTS --maxclients=$MAXCLIENTS \ --no-cleanup ./qpsmtpd 2>&1 =head1 Plugins The qpsmtpd core only implements the SMTP protocol. No useful function can be done by qpsmtpd without loading plugins. Plugins are loaded on startup where each of them register their interest in various "hooks" provided by the qpsmtpd core engine. At least one plugin MUST allow or deny the RCPT command to enable receiving mail. The "check_relay" plugin is the standard plugin for this. Other plugins provides extra functionality related to this; for example the require_resolvable_fromhost plugin described above. =head1 Configuration files All the files used by qmail-smtpd should be supported; so see the man page for qmail-smtpd. Extra files used by qpsmtpd includes: =over 4 =item plugins List of plugins, one per line, to be loaded in the order they appear in the file. Plugins are in the plugins directory (or in a subdirectory of there). =item rhsbl_zones Right hand side blocking lists, one per line. For example: dsn.rfc-ignorant.org does not accept bounces - http://www.rfc-ignorant.org/ See http://www.rfc-ignorant.org/ for more examples. =item dnsbl_zones Normal ip based dns blocking lists ("RBLs"). For example: relays.ordb.org spamsources.fabel.dk =item require_resolvable_fromhost If this file contains anything but a 0 on the first line, envelope senders will be checked against DNS. If an A or a MX record can't be found the mail command will return a soft rejection (450). =item spool_dir If this file contains a directory, it will be the spool directory smtpd uses during the data transactions. If this file doesnt exist, it will default to use $ENV{HOME}/tmp/. This directory should be set with a mode of 700 and owned by the smtpd user. =item everything (?) that qmail-smtpd supports. In my test qpsmtpd installation I have a "config/me" file containing the hostname I use for testing qpsmtpd (so it doesn't introduce itself with the normal name of the server). =back =head1 Problems In case of problems always first check the logfile. As default it goes into log/main/current. Qpsmtpd can log a lot of debug information. You can get more or less by adjusting $TRACE_LEVEL in lib/Qpsmtpd.pm (sorry, no easy switch for that yet). Something between 1 and 3 should give you just a little bit. If you set it to 10 or higher you will get lots of information in the logs. If the logfile doesn't give away the problem, then post to the mailinglist (subscription instructions above). If possibly then put the logfile on a webserver and include a reference to it in the mail.