Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
HOWTO: qmail vpopmail courier-imap qmail-scanner etc (NEW)
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2, 3 ... 10, 11, 12 ... 23, 24, 25  Next  
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
petterg
Guru
Guru


Joined: 25 Mar 2004
Posts: 500
Location: Oslo, Norway

PostPosted: Fri Aug 20, 2004 6:44 pm    Post subject: Reply with quote

I'm trying to install the smtp reject patch TheSlab posted, but can't figure out how to include it in the ebuild.

I added
Code:
epatch ${DISTDIR}/qmail-smtpd-chkusr-1.0.patch

between
Code:
epatch ${DISTDIR}/qmail-limit-bounce-size.patch.txt
epatch ${FILESDIR}/${MY_PVR}/qmail-smtpd-esmtp-size-gentoo.patch

and
Code:
epatch ${FILESDIR}/${MY_PVR}/qmail-smtpd-relay-reject.gentoo.patch
epatch ${DISTDIR}/qmail-gentoo-1.03-r12-badrcptto-morebadrcptto-accdias.diff.bz2

in qmail-1.03-r15.ebuild. (If I try with r13 I get the same error.)
To me it seems like a problem with the patch file. That the patch is trying to patch the wrong files or so. All the other patches in the ebuild applies fine. Anyone got any idea of what I do wrong?
It's supposed to patch qmail, right? (Not to patch vpopmail?)

Here is the first part of /var/tmp/portage/qmail-1.03-r15/temp/qmail-smtpd-chkusr-1.0.patch-4001.out :
Code:
 
***** qmail-smtpd-chkusr-1.0.patch *****
 
========================================
 
PATCH COMMAND:  patch -p0 -d /var/tmp/portage/qmail-1.03-r15/work/qmail-1.03 < /usr/portage/distfiles/qmail-smtpd-chkusr-1.0.patch
 
========================================
can't find file to patch at input line 5
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|Only in qmail-1.03/: .qmail-smtpd.c.swp
|diff -uBbwr qmail-1.03.orig/Makefile qmail-1.03/Makefile
|--- qmail-1.03.orig/Makefile   2004-08-04 12:19:00.000000000 -0700
|+++ qmail-1.03/Makefile        2004-08-14 17:21:45.000000000 -0700
--------------------------
No file to patch.  Skipping patch.
1 out of 1 hunk ignored
can't find file to patch at input line 19
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|Only in qmail-1.03/: Makefile.orig
|Only in qmail-1.03/: Makefile.rej
|diff -uBbwr qmail-1.03.orig/qmail-smtpd.c qmail-1.03/qmail-smtpd.c
|--- qmail-1.03.orig/qmail-smtpd.c      2004-08-04 06:52:22.000000000 -0700
|+++ qmail-1.03/qmail-smtpd.c   2004-08-16 14:11:54.000000000 -0700
--------------------------
No file to patch.  Skipping patch.
5 out of 5 hunks ignored
========================================
 
PATCH COMMAND:  patch -p1 -d /var/tmp/portage/qmail-1.03-r15/work/qmail-1.03 < /usr/portage/distfiles/qmail-smtpd-chkusr-1.0.patch
 
========================================
patching file Makefile
Hunk #1 succeeded at 1584 (offset -25 lines).
patching file qmail-smtpd.c
Hunk #2 succeeded at 376 (offset -75 lines).
Hunk #3 succeeded at 656 (offset -105 lines).
Hunk #4 FAILED at 667.
Hunk #5 succeeded at 925 (offset -112 lines).
1 out of 5 hunks FAILED -- saving rejects to file qmail-smtpd.c.rej
========================================
 
PATCH COMMAND:  patch -p2 -d /var/tmp/portage/qmail-1.03-r15/work/qmail-1.03 < /usr/portage/distfiles/qmail-smtpd-chkusr-1.0.patch
 
========================================
missing header for unified diff at line 5 of patch
can't find file to patch at input line 5
Perhaps you used the wrong -p or --strip option?


(there are lots of more errors. This is the first part.)
Back to top
View user's profile Send private message
sucarino
n00b
n00b


Joined: 20 Aug 2004
Posts: 32
Location: San Jose, Costa Rica

PostPosted: Sat Aug 21, 2004 12:56 am    Post subject: spamc delay Reply with quote

hey, is it normal that when i tried

spamc -c -f < sample-spam2.txt

it takes more than 3 minutes for a simple file ????????

I've unmerged pyzor, razor, dcc ... i set skip_rbl_checks to 1 but spamc is still delaying a lot

what should i do? do i have something wrong? :(
Back to top
View user's profile Send private message
sucarino
n00b
n00b


Joined: 20 Aug 2004
Posts: 32
Location: San Jose, Costa Rica

PostPosted: Sat Aug 21, 2004 1:43 am    Post subject: virtual domain qmail, etc ---- wait, wait a minute Reply with quote

7) install f-prot and Mail-SpamAssassin. they must be running before installing qmail-scanner.

[code]> emerge /usr/portage/app-antivirus/f-prot/f-prot-4.4.2.ebuild
> emerge /usr/portage/dev-perl/Mail-SpamAssassin/Mail-SpamAssassin-2.63.ebuild

I found another post in this forum saying:

"But, as far as I know, implemeting a program as spamassassin on a virtual mailhost system is not going to work."

So, is it true that I can't filter my virtual domains mails with spamassassin???

:cry:
Back to top
View user's profile Send private message
sucarino
n00b
n00b


Joined: 20 Aug 2004
Posts: 32
Location: San Jose, Costa Rica

PostPosted: Sat Aug 21, 2004 2:03 am    Post subject: spamc problem Reply with quote

ryker wrote:
I've never had any luck getting Spam Assassin to work using this how to. I know you are supposed to emerge qmail-scanner afer f-prot and spam assassin, so qmail-scanner will pick them up and use them. For some reason, qmail-scanner is ignoring spam assassin. When I emerge qmail-scanner I get the following message:
Code:
Something like the SpamAssassin spamc is present, but is not capable of
detecting a serious piece of spam (didn't include a "X-Spam-Status: Yes"
line in output) - ignoring...
f-prot works fine. I can see mail is scanned by f-prot by looking at the mail header. But there's nothing in the header about spam asssassin.
Anyone have any ideas?


I have the same problem, did you find a solution?

thanx
Back to top
View user's profile Send private message
petterg
Guru
Guru


Joined: 25 Mar 2004
Posts: 500
Location: Oslo, Norway

PostPosted: Sat Aug 21, 2004 11:06 pm    Post subject: Reply with quote

I'm sure the guide tells you how to edit spamassassin config files to tag spam mails. If you also read the manual it will tell you how to add aditional headers. However this additional headers does not seem to apare in the mail.

Edit:
Regarding time issues, my petium 166 mmx spends 20-40 seconds pr. mail. The P4 server spends 1-2 seconds. I don't know how to solve it. Maybe unemerge spamassassin and qmailscanner, reemerge spamass. configure it as the guide tell you to (read all the text!) then reemerge qmailscanner
Back to top
View user's profile Send private message
sucarino
n00b
n00b


Joined: 20 Aug 2004
Posts: 32
Location: San Jose, Costa Rica

PostPosted: Sun Aug 22, 2004 3:45 am    Post subject: Reply with quote

petterg wrote:
I'm sure the guide tells you how to edit spamassassin config files to tag spam mails. If you also read the manual it will tell you how to add aditional headers. However this additional headers does not seem to apare in the mail.

Edit:
Regarding time issues, my petium 166 mmx spends 20-40 seconds pr. mail. The P4 server spends 1-2 seconds. I don't know how to solve it. Maybe unemerge spamassassin and qmailscanner, reemerge spamass. configure it as the guide tell you to (read all the text!) then reemerge qmailscanner


thank you very much for your reply. unfortunately i've forced to restart all the process again from scratch. i will try to be more careful this time (i can't imagine how) so cross your fingers for me. :lol:

By the way..just want comment that my experience was really weird. I unmerged all ebuilds and emerge againg without success. Every time when i tried to emerge qmail-scanner it spend about 5-8 minutes doing nothing.... just after ask for a confirmation on installation. And unbelievable, spamassassin spent like 4-5 minutes in a message with size less than 5kb.... ON A DUAL PENTIUM 4 at 2.0Mhz with 1Gb RAM. 8O

I have installed spamassassin in another less powerful PC running Red Hat, same file took about 0.992 sec. I really hope have more luck this time b/c I'm convinced that gentoo is my next affair, absolutly.

:wink:

(and sorry for my terrible english please)
Back to top
View user's profile Send private message
petterg
Guru
Guru


Joined: 25 Mar 2004
Posts: 500
Location: Oslo, Norway

PostPosted: Sun Aug 22, 2004 9:03 pm    Post subject: Reply with quote

sucarino wrote:
Every time when i tried to emerge qmail-scanner it spend about 5-8 minutes doing nothing.... just after ask for a confirmation on installation.


Same thing here... well at the mmx166 I guess it took about 40 minutes "doing nothing". I believe this "nothing" is searching for programs to include in the script, run some tests to see if the programs works and generate the script based on the gathered information.
Back to top
View user's profile Send private message
petterg
Guru
Guru


Joined: 25 Mar 2004
Posts: 500
Location: Oslo, Norway

PostPosted: Mon Aug 23, 2004 7:54 am    Post subject: Reply with quote

sucarino wrote:
spamassassin spent like 4-5 minutes in a message with size less than 5kb.... ON A DUAL PENTIUM 4 at 2.0Mhz with 1Gb RAM.

Maybe that delay is related to what is described in step 5 of the guide?
Back to top
View user's profile Send private message
TheSlab
n00b
n00b


Joined: 29 Apr 2004
Posts: 18
Location: Lanham, MD USA

PostPosted: Wed Aug 25, 2004 9:43 pm    Post subject: Reply with quote

petterg wrote:
I'm trying to install the smtp reject patch TheSlab posted, but can't figure out how to include it in the ebuild.


Sorry I've been out of town. Here is where I put it

Code:

    epatch ${DISTDIR}/qmail-gentoo-1.03-r12-badrcptto-morebadrcptto-accdias.diff.bz2

    EPATCH_SINGLE_MSG="Add support for qmail-smtpd-chkusr" \
    epatch ${DISTDIR}/qmail-smtpd-chkusr-1.0.patch

    # TODO TESTING NEEDED
    EPATCH_SINGLE_MSG="Enable stderr logging from checkpassword programs" \
Back to top
View user's profile Send private message
petterg
Guru
Guru


Joined: 25 Mar 2004
Posts: 500
Location: Oslo, Norway

PostPosted: Thu Aug 26, 2004 8:56 am    Post subject: Reply with quote

Thank you, TheSlab. Somehow it patched now.
I have no idea of why it failed before.

I'm using r15 now, a patches that seems force encrypted passwords in smtp-auth. (affected by the NOTLSBEFOREAUTH use flag)
Also I installed qmail-scanner 1.23. It seems to work better with spamassassin. (Add the SPAMASSASSIN use flag.)

However, I can't get this stuff tested as I'm out of public IP adresses. Before I can set this server into action I have to figure out how to move a virtual domain from one server to another. By 'move' I mean transfer all mail, all usernames, aliasses, passwords, etc. That way I can take down one server and release an ip.

I copied /var/vpopmail/domains and /var/lib/mysql/vpopmail from one of the servers to this server. I also added the virtual domain into the /var/qmail/control files.
Now, if I do a /var/vpopmail/bin/vdominfo mydomain.net I get "domain does not exist".

What else do I need to do to get the domain moved?

I'll guess this will also be a problem when restoring a mailsystem from a backup.

Edit:
I figured out how to move domain from one server to another. Here's how:
copied /var/vpopmail/domains/mydomain.net
renamed source mysql db vpopmail -> oldvpop
copied /var/lib/mysql/oldvpop
merged mysql db: oldvpop tables into vpopmail tables
ran /var/vpopmail/bin/vadddomain mydomain.net
ignored errors
copied /var/vpopmail/domains/mydomain.net again
Back to top
View user's profile Send private message
Jack_Sparrow
n00b
n00b


Joined: 18 Jul 2004
Posts: 52

PostPosted: Fri Aug 27, 2004 3:05 pm    Post subject: Reply with quote

Hi,

Its a good doc.
but i have a problem with dcc ebuild!
i receive this error :
Code:

root@tux etc # emerge /usr/portage/net-mail/dcc/dcc-1.2.28.ebuild
Calculating dependencies \!!! aux_get(): ebuild for 'net-mail/dcc-1.2.28' does not exist at:
!!!            /usr/portage/net-mail/dcc/dcc-1.2.28.ebuild
emerge: create(): aux_get() error on net-mail/dcc-1.2.28; aborting...


in the old doc, you say that we must force-emerged dcc ebuild. but can you tell me how i can do this? i try emerge -O /usr/portage/net-mail/dcc/dcc-1.2.28.ebuild

and no success.. thanks for your help!
Back to top
View user's profile Send private message
petterg
Guru
Guru


Joined: 25 Mar 2004
Posts: 500
Location: Oslo, Norway

PostPosted: Fri Aug 27, 2004 8:26 pm    Post subject: Reply with quote

Jack_Sparrow wrote:
Hi,

Its a good doc.
but i have a problem with dcc ebuild!


# ACCEPT_KEYWORDS="~x86" emerge dcc
Back to top
View user's profile Send private message
petterg
Guru
Guru


Joined: 25 Mar 2004
Posts: 500
Location: Oslo, Norway

PostPosted: Fri Aug 27, 2004 8:40 pm    Post subject: Reply with quote

Regarding the smtpd-chkusr patch.
I'm installing my second mailserver for the day. It seems like qmail and vpopmail has to get emerged without the patch before you can add the patch to the ebuild and reemerge qmail!

Regarding the qmail-scanner 1.23 (this is probably the case for all > 1.20)
There is a clamscan / clamdscan issue. I found a workarround that apared to work, but it turned out that virus files passed unaffected trough the scanner! - Well, this might be a clamav issue. Posible just configuration. Last time I used clamav was version 0.70. This time I used 0.75.
(I chose clamav over f-prot because of the f-prot licence.)
Back to top
View user's profile Send private message
petterg
Guru
Guru


Joined: 25 Mar 2004
Posts: 500
Location: Oslo, Norway

PostPosted: Sun Aug 29, 2004 12:30 pm    Post subject: Reply with quote

I still have issues with clamav 0.75 and qmail-scanner 1.23, but here is thing I don't understand regarding timeconsumation about the scanning prosess with spamassassin:

Pentium 3, 800MHz, 384MB ram, spamassassin 2.64, runing mailserver only, no traffic, avg cpuload=0:
* Identify clean message: 6-7 seconds
* Identify spam message: 48-54 seconds!!

Celeron 400MHz, 220MB ram, spamassassin 2.64, running mailserver only, no traffic, avg cpuload=0:
* Identify clean message: 20-23 seconds
* Identify spam message: 25-30 seconds

Pentium 166mmx, 112MB ram, spamassassin 2.63, active webserver, mailserver, mysql server, router, some load, avg cpuload=0.3:
* Identify clean message: 20-30 seconds
* Identify spam message: 20-30 seconds

So, the slowest computer, having the least amount of ram, having the highest work load is the fastes to indentify spam!
They are all running with same /etc/mail/spamassassin/local.cf

Why did I even think about replacing the 166mmx?

Edit: I also downgraded qmail-scanner to 1.16 on the P3 and celeron. It did not affect the timeconsumation.
Back to top
View user's profile Send private message
petterg
Guru
Guru


Joined: 25 Mar 2004
Posts: 500
Location: Oslo, Norway

PostPosted: Sun Aug 29, 2004 8:37 pm    Post subject: Reply with quote

Have debugged a bit now. Spamd log shows:
----/var/log/messages - cutout ----
Aug 29 22:15:03 lux spamd[6451]: debug: received-header: parsed as [ ip=193.120.211.219 rdns=mail.webnote.net helo=webnote.net by=mail.netnoteinc.com ident= ]
Aug 29 22:15:03 lux spamd[6451]: debug: received-header: parsed as [ ip=24.226.157.50 rdns=USR-157-050.dr.cgocable.ca helo=netsvr.Internet by=webnote.net ident= ]
Aug 29 22:15:03 lux spamd[6451]: debug: received-header: parsed as [ ip=216.214.106.173 rdns=max1-45.losangeles.corecomm.net helo=R00UqS18S by=netsvr.Internet ident= ]
Aug 29 22:15:53 lux spamd[6451]: debug: received-header: relay 193.120.211.219 trusted? no
Aug 29 22:15:53 lux spamd[6451]: debug: received-header: relay 24.226.157.50 trusted? no
Aug 29 22:15:53 lux spamd[6451]: debug: received-header: relay 216.214.106.173 trusted? no
Aug 29 22:15:53 lux spamd[6451]: debug: running header regexp tests; score so far=0
------- end cutout ------------

What is this a part of the logfile when the 4th qmail-scanner testmessage is passed to spamd.
What is the header stuff good for?
If I add the -L option to spamd the spamcheck is done in 0.3 seconds! Is it a bad idea to pass the -L to spamd?
Is there any kind of timeout setting that could affect this?
Back to top
View user's profile Send private message
TheSlab
n00b
n00b


Joined: 29 Apr 2004
Posts: 18
Location: Lanham, MD USA

PostPosted: Mon Aug 30, 2004 6:26 pm    Post subject: Reply with quote

Yeah, you need vpopmail files for the chkusr patch. So that qmail knows how to lookup account information. Sucks but that's just how it is. I remember the first time I compiled all this stuff by hand the docs said to compile qmail, vpopmail then recompile qmail with the patch. *shrug*

I'm not sure about the head part in your log. Using the -L flag doesn't seem to me to be a big deal. If you really wanna know the dns name of an IP you can just look it up yourself. My opinion is it's just for logging purposes. Maybe used in a blanked *.somedomain.com rule for spamassassin. I wouldn't worry about it too much.
Back to top
View user's profile Send private message
petterg
Guru
Guru


Joined: 25 Mar 2004
Posts: 500
Location: Oslo, Norway

PostPosted: Mon Aug 30, 2004 10:48 pm    Post subject: Reply with quote

The -L option in spamd seems to disable razor, pyzor and dcc, even when they are enabled in local.cf. I'm not sure how much use I have of these programs. (The wierdest thing is why the 166mmx behaves faster than the P3@800.)

Anyone tried the magic-smtpd with qmail? How should I go around to install it?
Back to top
View user's profile Send private message
petterg
Guru
Guru


Joined: 25 Mar 2004
Posts: 500
Location: Oslo, Norway

PostPosted: Fri Sep 03, 2004 3:58 pm    Post subject: Reply with quote

The chkusr patch makes a conflict with smtp using tsl.
The chkusr patch requires qmail-smtpd to run as "vpopmail". However tsl does not work if qmail-smtpd is running as anyone but "qmaild"!
This conflic is the same for qmail.1.03-r13 and ..-r15.



Aparently the best solution for running clamav with Qmail-scanner > 1.20 is to run clamd as the qscand user. (Edit /etc/clamav.conf and run chown -R qscand:qscand /var/lib/clamav)
Back to top
View user's profile Send private message
shira
Tux's lil' helper
Tux's lil' helper


Joined: 27 Aug 2002
Posts: 122

PostPosted: Mon Sep 06, 2004 1:36 am    Post subject: Reply with quote

qmail-scanner-queue doesn't run for some reason

I get this error msg in the logs:
Insecure directory in $ENV{PATH} while running with -T switch at /var/qmail/bin/qmail-scanner-queue.pl line 1750, <STDIN> line 19.

I tried disabling taint mode for perl by deleting the -T in front of #/usr/bin/perl (I had to in order to run qmail-scanner-queue -z)

I don't know how to fix this one
Back to top
View user's profile Send private message
petterg
Guru
Guru


Joined: 25 Mar 2004
Posts: 500
Location: Oslo, Norway

PostPosted: Mon Sep 06, 2004 2:22 pm    Post subject: Reply with quote

shira wrote:
qmail-scanner-queue doesn't run for some reason

I get this error msg in the logs:
Insecure directory in $ENV{PATH} while running with -T switch at /var/qmail/bin/qmail-scanner-queue.pl line 1750, <STDIN> line 19.

I tried disabling taint mode for perl by deleting the -T in front of #/usr/bin/perl (I had to in order to run qmail-scanner-queue -z)

I don't know how to fix this one


Guess you're running QmS > 1.2 .... there is a reason why it's masked :)

I got the same thing when I was running clamav as clamav:qscand. Check if you're running spamassassin and f-prot/clamav as the wrong user and/or group.

(And post in the forum if you get the QmS > 1.2 running. I strugeled a lot to get 1.23 to run with clamav. Finaly got it working it turned out to let mails pass as clean if a X-Spam header is present in incoming mail!)
Back to top
View user's profile Send private message
shira
Tux's lil' helper
Tux's lil' helper


Joined: 27 Aug 2002
Posts: 122

PostPosted: Mon Sep 06, 2004 3:42 pm    Post subject: Reply with quote

even with QmS 1.16 it spits out that error

during the merge:
>>> /usr/share/doc/qmail-scanner-1.16-r2/contrib/sub-sender-cache.pl.gz
>>> /usr/share/doc/qmail-scanner-1.16-r2/README.gz
>>> /usr/share/doc/qmail-scanner-1.16-r2/COPYING.gz
>>> /usr/share/doc/qmail-scanner-1.16-r2/CHANGES.gz
Insecure directory in $ENV{PATH} while running with -T switch at /var/qmail/bin/qmail-scanner-queue.pl line 1083.

SA and clamav are both owned by root and NOT world writable:

# ls -l /usr/bin/spamc /usr/bin/clamscan
-rwxr-xr-x 1 root root 42812 Sep 5 13:42 /usr/bin/clamscan
-r-xr-xr-x 1 root root 20516 Sep 1 20:03 /usr/bin/spamc
Back to top
View user's profile Send private message
petterg
Guru
Guru


Joined: 25 Mar 2004
Posts: 500
Location: Oslo, Norway

PostPosted: Mon Sep 06, 2004 9:52 pm    Post subject: Reply with quote

shira wrote:
SA and clamav are both owned by root and NOT world writable:

You have to look in their conf files to see what they run as. If you followed the guide you should have spamd running as vpopmail. For QmS 1.16 you don't need clamd running - it's not being used as a deamon by QmS. (By default only the updater is running.)

And btw: make sure spamd IS running before emerging QmS.

However, I don't think any of this will solve your problem as it's related to emerge, not the filtering itself
Back to top
View user's profile Send private message
shira
Tux's lil' helper
Tux's lil' helper


Joined: 27 Aug 2002
Posts: 122

PostPosted: Tue Sep 07, 2004 1:17 am    Post subject: Reply with quote

the error that gets spit out during the merge isn't portage's fault

it's something to do with perl and taint mode, though I don't know what
Back to top
View user's profile Send private message
catalinux
n00b
n00b


Joined: 30 Aug 2004
Posts: 10

PostPosted: Sat Sep 11, 2004 8:34 am    Post subject: another good patch javascript:emoticon(':D')validrcptto Reply with quote

[take a look at http://www3.sympatico.ca/humungusfungus/code/validrcptto.html
patched r15 qmail ebuild with:

EPATCH_SINGLE_MSG="qmail-pop3d fix for top output so Evolution doesn't barf" \
epatch ${FILESDIR}/${PVR}/qmail-pop3d-top-outputfix.patch
line new EPATCH_SINGLE_MSG="validrcptto patch" \
line new epatch ${FILESDIR}/${PVR}/va.patch
and put this patch named va.patch in /usr/portage/mail-mta/qmail/files/1.03-r15/
or maybe /usr/local/portage/mail-mta/qmail/files/1.03-r15/

patch begin :)

diff -ur qmail-1.03.orig/qmail-smtpd.c qmail-1.03/qmail-smtpd.c
--- qmail-1.03.orig/qmail-smtpd.c 2003-08-11 20:37:16.000000000 -0700
+++ qmail-1.03/qmail-smtpd.c 2003-08-11 20:39:52.000000000 -0700
@@ -150,6 +150,7 @@
}

void err_bmf() { out("553 sorry, your envelope sender has been denied (#5.7.1)\r\n"); }
+void err_vrt() { out("553 sorry, this recipient is in my badrecipientto list (#5.7.1)\r\n"); }
void err_brt() { out("550 sorry, this message is not deliverable (#5.7.1)\r\n"); }
void err_bmt() { out("533 sorry, your envelope recipient has been denied (#5.7.1)\r\n"); }
void err_nogateway() { out("553 sorry, that domain isn't in my list of allowed rcpthosts (#5.7.1)\r\n"); }
@@ -214,6 +215,9 @@
int bmfok = 0;
stralloc bmf = {0};
struct constmap mapbmf;
+int vrtok = 0;
+stralloc vrt = {0};
+struct constmap mapvrt;
int brtok = 0;
stralloc brt = {0};
struct constmap mapbrt;
@@ -244,7 +248,10 @@
bmfok = control_readfile(&bmf,"control/badmailfrom",0);
if (bmfok == -1) die_control();
if (!constmap_init(&mapbmf,bmf.s,bmf.len,0)) die_nomem();
-
+ vrtok = control_readfile(&vrt,"control/validrcptto",0);
+ if (vrtok == -1) die_control();
+ if (vrtok)
+ if (!constmap_init(&mapvrt,vrt.s,vrt.len,0)) die_nomem();
bmtok = control_readfile(&bmt,"control/badmailto",0);
if (bmtok == -1) die_control();
if (!constmap_init(&mapbmt,bmt.s,bmt.len,0)) die_nomem();
@@ -441,7 +448,16 @@
}
return 0;
}
-
+int vrtcheck()
+{
+ int j;
+ if (!vrtok) return 0;
+ if (constmap(&mapvrt,addr.s,addr.len - 1)) return 1;
+ j = byte_rchr(addr.s,addr.len,'@');
+ if (j < addr.len)
+ if (constmap(&mapvrt,addr.s + j,addr.len - j - 1)) return 1;
+ return 0;
+}
int addrallowed()
{
int r;
@@ -609,6 +625,11 @@
flagbrt = 1;
log_deny("BAD RCPT TO", mailfrom.s,addr.s);
}
+ if (!env_get("RELAYCLIENT") && !vrtcheck()) {
+ strerr_warn4("qmail-smtpd: badrcptto: ",addr.s," at ",remoteip,0);
+ err_vrt();
+ return;
+ }
if (!stralloc_cats(&rcptto,"T")) die_nomem();
if (!stralloc_cats(&rcptto,addr.s)) die_nomem();
if (!stralloc_0(&rcptto)) die_nomem();
Back to top
View user's profile Send private message
petterg
Guru
Guru


Joined: 25 Mar 2004
Posts: 500
Location: Oslo, Norway

PostPosted: Sat Sep 11, 2004 11:40 am    Post subject: Re: another good patch javascript:emoticon(':D')validrcptto Reply with quote

catalinux wrote:
[take a look at http://www3.sympatico.ca/humungusfungus/code/validrcptto.html
patched r15 qmail ebuild with:


And your point is?
There's quite a few nice patches in the r15, but none of them does the job of chkusr patch, which will save the server quite a bit of load in case of spammails to [random chars]@domain.net. To bad it makes a conflict with the smtp-auth over tsl!
The magic-smtpd seems to be even better on stopping spam before arrival, but I haven't figured out the correct way to install it.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Goto page Previous  1, 2, 3 ... 10, 11, 12 ... 23, 24, 25  Next
Page 11 of 25

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum