# Upgrading to netqmail from qmail

## dendenners

Hi,

I noticed in the GWN that I'm supposed to upgrade from qmail to netqmail. I set up qmail about 9 months ago and its been running fine for me. I'm afraid if I upgrade now I'll break my mail server, as I've forgotten a lot of what I did to get the thing running in the first place. Is upgrading painless - i.e. is it just a matter of

```
emerge -C qmail
```

and 

```
emerge netqmail
```

or do I have to worry about changing any config files?

Thanks

Denis

----------

## djco

I was wondering about this, as well.

Additionally, if I do this, will I lose any mail arriving at my host during the migration, or is there some way of preventing that from happening?

----------

## MoreCoffeePlease

Mark me down as another user keen to know more about going through with this upgrade... Please!

 :Shocked: 

It took me long enough to get everything set up with vpopmail, courier etc, and I'm really not keen to go through it all again, especially as I've forgotten most of what I learnt then to get it all set up...  I have no idea what the risks of doing this are, and what I should be doing to make sure everything goes smoothly.

To be honest, I was a bit disappointed to see that what appears (to me with no knowledge) to be a big potential change to my system was given such a terse and seemingly unhelpful explaination in the weekly news, with no links to any other documentation other than the netqmail site.

I'm basically panicing here, and wondering if that box will ever get upgraded again!  Not really something I want to do though...

----------

## kreep69

To upgrade from qmail 1.03 to netqmail 1.05 just -

1) stop your qmail completely run /etc/init.d/svscan stop (or use svc commands)

1a) make sure no processes are running (ps axf | grep qmail [or supervise]) if they are wait until finished or kill the processes.

2) emerge --unmerge mail-mta/qmail

3) emerge mail-mta/netqmail ( check this guide for some new use flags and other good info - https://forums.gentoo.org/viewtopic-t-539101-highlight-netqmail.html )

3a) If you patched qmail with anything like chkuser patch you will have to re-apply this to netqmail ebuild then install/qmerge.

4) fix/update config files (run etc-update) - be careful to update their format

5) run /var/qmail/bin/queue-fix (or there is a queue-repair app you can try)

6) Start it back up /etc/init.d/svscan start (or use appropriate svc command)

7) Monitor all your qmail logs and make sure everything is running well.

For me, everything stayed working and netqmail seems to be more updated and a little faster.

P.S. The whole gentoo newsletter posting about this could have been handled better.  Of course at the same time you could have interpreted that since no warnings were raised it implies its safe to upgrade.

P.P.S.  If you're not using the chkuser patch for qmail/netqmail you should as its really excellent (fix Maildir to .maildir manually for now in the source [only in 1 file, 1 place] until there is an option in the config for it) - http://www.interazioni.it/opensource/chkuser/

P.P.P.S. To patch the netqmail ebuild (for netqmail-1.05-r4) - 

ebuild /usr/portage/mail-mta/netqmail/netqmail-1.05-r4.ebuild unpack

patch as needed in /var/tmp/portage/mail-mta/netqmail-1.05-r4/work/netqmail-1.05/netqmail-1.05/

ebuild /usr/portage/mail-mta/netqmail/netqmail-1.05-r4.ebuild compile

ebuild /usr/portage/mail-mta/netqmail/netqmail-1.05-r4.ebuild install

ebuild /usr/portage/mail-mta/netqmail/netqmail-1.05-r4.ebuild qmerge

Note: If you're re-compiling more than once make sure to read the output at the bottom about erasing a certain file, etc.

Happy Gentooing  :Smile: 

----------

## AllenJB

There's a built-in method to patch netqmail - basically put the patches in a directory and specify that directory as QMAIL_PATCH_DIR in /etc/make.conf. Read the ebuild for full details.

----------

## spacejock

I really wish they'd left the badrcptto patch in, though. My spam just rocketed up again.

----------

## nowlodek

 *spacejock wrote:*   

> I really wish they'd left the badrcptto patch in, though. My spam just rocketed up again.

 

Use SPP plugin instead. qmail-spp.sourceforge.net

----------

## spacejock

Thanks. I've got the badrcptto.php script, saved it to the plugins folder and now I'm about to edit the control/smtpplugins file. I notice the example has :badrcptto without the .php and with a : in front - do I copy that or put the .php?  And do I need to change the execute permissions on the php script?

I couldn't find this in the documentation.

----------

## spacejock

Never mind, answered my own questions and it's working fine. Yes, you need the .php extension and yes, you need to set the execute bit. The : prefix is only required if you want to specify command-line arguments for the addon script.

----------

## nastasa_andrey

Did someone try to patch netqmail with qmail-dk patch?

----------

## br41n

Also interested in this, anyone?

----------

## brianlmoon

I could not get the version working from their site.  It was using $_ENV and it should use $_SERVER.

http://dev.phorum.org/badrcptto

I also added preg support.

----------

