# Anyone add validrcptto or goodrcptto patches to qmail?

## sedartree

Hello Smart people,

I am attempting to add the validrcptto patch to standard gentoo qmail-1.03-r13 package.  I downloaded the validrcptto patch from http://www3.sympatico.ca/humungusfungus/code/validrcptto.html.  So far it errors out:

ebuild /usr/portage/mail-mta/qmail/qmail-1.03-r13.ebuild unpack

unpacks to /var/tmp/portage/qmail-1.03-r13/work/qmail-1.03

then I tried patch -p0 <validrcptto.patch from within the unpacked directory, and patch -p1 <validrcpto.patch.  Here is the error message:

```
patching file Makefile

Hunk #1 FAILED at 1535.

1 out of 1 hunk FAILED -- saving rejects to file Makefile.rej

patching file qmail-smtpd.c

Hunk #1 FAILED at 23.

patch: **** malformed patch at line 32: "); flush(); _exit(1); }

```

I am suspect that the patch is not compatible with the gentoo version of qmail.  I am no coder, and am fairly ignorant as to what I am looking at.

This is my first attempt with modifying an ebuild.  

Any one have any experience getting the validrcptto patch to work?

I am looking to cut down on the amount of spam being processed.  The current server is processing thousands of spam a day for less than 50 users.

Current MTA setup: Qmail+qmail-scanner+spamassassin+razor+pyzor+f-prot.

The patched qmail with validrcptto will be running on another server I am building now.

Any other suggestions?  Current Server is overloaded, would like the new one to just drop all messages to invalid users before processing with Spamassassin takes place.

Thanks in advance,

Sedar

----------

## joeljkp

Did you ever figure this out? This sounds like a useful thing to get a solution for, in case anyone else tries the same thing.

----------

## cselkirk

I'm not sure about the validrcptto patch but prehaps the realrcptto patch will do what you require and (untested) apply over the various patches that are applied by the ebuild.

----------

## hillie

I was trying to do this with the netqmail package, and had the same problems.

I ended up just downloading the netqmail source code and applying the netqmail version of his patch (available at the same page) by following the directions on his site, and then doing make, then make setup check

Since Gentoo doesn't change the location of the install it works fine.

I suspect the reason why it hasn't been added to the ebuild is because it apparently conflicts with the qmail-smtp-aith patch, which it looks like it has? since I got all this stuff about configuring auth smtp and also making a cert in the original emerge /config operation.

It would be really nice, however i don't need SMTP AUTH so I'm fine for now.

----------

## Larde

Hi!

Another solution is to use the standard Gentoo netqmail package with qmail-spp enabled. Then choose you plugin from qmail-spp Plugins.

Since I only use local users without vpopmail or anything fancy, I use this plugin to check for nonexisting users (with some changes  :Smile: ).

Hth,

Larde.

----------

## INTP

Like Larde, I'm also using qmail-spp to do what I think you're trying to do. Add 'qmail-spp' to the "use" in /etc/make.conf and it will be installed when you 'emerge mail-mta/netqmail'. (this must have been automatic in mail-mta/qmail, optional in mail-mta/netqmail)

I use a modified version of this plugin to reject incoming mail to addresses that do not exist.

http://qmail-spp.sourceforge.net/plugins/details/?id=17

----------

## SweepingOar

Do you know if the plugin allows you to create your own list of valid recipients? I'm not using vpopmail and I don't have a user account for each valid email recipient (that stuff is handled later).

Actually, I'd rather use netqmail-1.05-validrcptto.cdb.patch than this plugin because it allows the use of a file with valid recipients listed and it also allows you to block or tarpit dictionary attacks. Any idea if I'd succeed if I patch the ebuild as described here:

https://forums.gentoo.org/viewtopic-t-528096-highlight-howto+patch+ebuild.html

?

----------

## SweepingOar

Larde and INTP,

Would you tell me what modifications you made to the plug in? I need to be able to specify a list of valid users because my users aren't on the system, they are down stream from my Gentoo/qmail machine. Thanks.

----------

## Michiel

I applied the netqmail-1.05-validrcptto.cdb.patch on the netqmail source from gentoo by hand and it works fine  :Smile: 

----------

