# Is there a Gentoo sendmail guide somewhere?

## whit

Please don't respond if you don't like sendmail. I've been running it for years on RedHat and Debian reliably and without any compromises. If I reference it's docs I can even do a good install from scratch. But I'm trying out the Gentoo way, and I really would like to know why after emerging sendmail and trying to send a test message from mutt while logged in as root I get "Program mode requires special privileges: root or TrustedUser." I _am_ root. I uncomment the TrustedUser definition of root in /etc/mail/sendmail.cf and go to /etc/init.d/sendmail to ask it to stop (and restart), and it complains it can't find its pid file, but stops. But when I go to restart it it says "Warning Sendmail has already been started." Sure - but it's not running and I want to start it. Which makes me wonder whether Gentoo really has a sane installation of sendmail, or whether I really should hand install before I run into other such incompleteness in what I suspect is a package assembled for a distro with an anti-sendmail bias that's provided it broken sort of on purpose. Pardon my paranoia, but if it's not on purpose it's still pretty much broken on install - is this just a few small details, or is it this broken all the way down? If it _is_ just the details, is there a guide to fixing them? Thanks.

----------

## BackSeat

 *whit wrote:*   

> Please don't respond if you don't like sendmail.

 

Well, I think I can at least partially help you, but I don't like sendmail - should I stop now?

 *whit wrote:*   

> /etc/init.d/sendmail to ask it to stop (and restart), and it complains it can't find its pid file, but stops. But when I go to restart it it says "Warning Sendmail has already been started." Sure - but it's not running and I want to start it.

 

I've seen this with other services; sometimes runscript can get confused, usually when a service doesn't start properly. If sendmail (or any other service) isn't running but runscript thinks it is, you can persuade it that the service isn't running with:

```
/etc/init.d/sendmail zap
```

In my experience there is normally an error in a config file: perhaps the logfile can help you locate the problem?

 *whit wrote:*   

> what I suspect is a package assembled for a distro with an anti-sendmail bias that's provided it broken sort of on purpose.

 

Not only is that paranoia, it's also an unnecessary insult to the Gentoo developers. Yes, you have problems, and I sympathise, but hurling insults at what is proving to be a very popular distro doesn't buy you any favours.

BS

----------

## whit

 *BackSeat wrote:*   

>  *whit wrote:*   "]what I suspect is a package assembled for a distro with an anti-sendmail bias that's provided it broken sort of on purpose. 
> 
> Not only is that paranoia, it's also an unnecessary insult to the Gentoo developers. Yes, you have problems, and I sympathise, but hurling insults at what is proving to be a very popular distro doesn't buy you any favours.
> 
> BS

 

Hey, it's a great distro, and I mean no insult to the developers! And I thank you for your advice, which I'll try as soon as I've learned how to get around some other showstopper bugs in how Gentoo installs sendmail. To have a distro whose sendmail doesn't come close to working out of the box is a bit strange. I guess it's just gotten to where people are so in love with qmail or whatever that it hasn't been gotten around to - even though it's on the short list of major, most-run daemons in the world at large. Sendmail handles complex configurations very, very well. I can drop Debian on a server, edit a few lines in sendmail.cf, and it's in business. Other apps are universally compatible with it. Hopefully sendmail will soon also be a sane option on Gentoo. Meanwhile guess I need to either install sendmail from scratch or learn qmail - which I was hoping to avoid since I'm already running a buncha sendmail servers and am comfortable with it.

----------

## pjp

Have you done a search to see if anyone else has reported the same problems?

----------

## whit

Yes, spent a while searching on this first, and checked (and filed in) Bugzilla. Didn't see other reports of the same problems. Whether that's because few Gentoo users are doing sendmail or because I haven't mastered efficient use of this forum's search function I don't know. I've got a virgin install of the current Gentoo, though - not anything strange here sendmail should be tripping over. Was just looking at qmail docs, but it takes jumping through hoops to get it to work with procmail and fetchmail - plus I _like_ mbox, I've lost huge chunks of mail to maildir storage problems in the past - so I'll probably just hand install sendmail and do the -i thing to fake Gentoo out about it.

----------

## col

I had the same problem. At first I though it was a permissions problem with the /var/spool/mail etc. .... I eventually got sendmail to work after setting up & using a local bind server thereby giving sendmail server a fully qualified domain name. Do a sendmail -v -bi .... it helped me.

I really think gentoo needs some guides for the common server side software like bind, postfix, sendmail, apache .....

----------

## whit

 *col wrote:*   

> I eventually got sendmail to work after setting up & using a local bind server thereby giving sendmail server a fully qualified domain name.

 

Thanks for the tip. That's not a general sendmail requirement, of course. And if Gentoo's sendmail is set to require it, it should have been in the ebuild script. But the box in question doesn't have a public IP - it's NATed and the scheme is to use sendmail/procmail with fetchmail to bring mail in, and sendmail to send it out through the NAT (it's useful to have the local log, and keeps the load down on another sendmail server on the firewall). The box has done this quite happily with RedHat and Debian - it's not that strange a use. And running bind on it would be just a waste of RAM and CPU. So ... off to the manual sendmail install. 

I do agree that when complex packages like this are configured in peculiar ways, it's important that the distribution have documents saying just which options have been chosen, especially when the options themselves are paranoid and set to disable the software except in very narrow conditions. Not that there's no place for paranoia by sysadmins - but it should be a local condition, not institutionalized in the distros, imh(paranoid)o.

----------

## pjp

 *whit wrote:*   

> Thanks for the tip. That's not a general sendmail requirement, of course. And if Gentoo's sendmail is set to require it, it should have been in the ebuild script.

 Might be worth mentioning over at bugs.

----------

## col

 *whit wrote:*   

> But the box in question doesn't have a public IP 

 

Niether does mine. I tested sendmail with the 127.0.0.1 on my bind server & sendmail works fine with this DNS config :

www             IN      A       127.0.0.1

mail            IN      A       127.0.0.1

ftp             IN      A       127.0.0.1

ns1             IN      A       127.0.0.1

linux		IN	A	127.0.0.1

@               IN      MX      5       127.0.0.1.

@               IN      MX      10      localdomain.

@               IN      NS      ns1.localdomain.

@               IN      A       127.0.0.1

(the hostname being linux.localdomain)

set your /etc/resolv.conf to 127.0.0.1 & setup named.conf with forwarder addresses & the above zone file. 

Dont ask me why but this worked for me. 

mail.log:

Oct 30 14:29:24 linux sendmail[6207]: g9U3TOQ2006206: to=<col@localdomain>, ctladdr=<test@localdomain> (1838/1244), delay=00:00:00, xdelay=00:00:00, mailer=local, pri=30759, relay=local, dsn=2.0.0, stat=Sent

Oct 30 14:29:25 linux imapd[6209]: Logout user=test host=localhost [127.0.0.1]

To get a working sendmail server I emerged bind & created the above record. Then I emerged sendmail , xinetd, uw-imap and squirrelmail. It all works perfectly now but would have been lots easier with a small howto.Last edited by col on Wed Oct 30, 2002 6:56 am; edited 2 times in total

----------

## rac

Just on a historical note, when I started using Gentoo there was no sendmail ebuild, so it's relatively young.

----------

## klieber

 *col wrote:*   

> I really think gentoo needs some guides for the common server side software like bind, postfix, sendmail, apache .....

 

I doubt many people would argue that point.  The larger question is, "who is going to volunteer their time to write such a guide?"

--kurt

----------

## whit

 *klieber wrote:*   

>  *col wrote:*   I really think gentoo needs some guides for the common server side software like bind, postfix, sendmail, apache ..... 
> 
> I doubt many people would argue that point.  The larger question is, "who is going to volunteer their time to write such a guide?"
> 
> --kurt

 

The smaller questions is, where are the notes from the people who put together the packages on which choices they made? Without these, particularly with something like sendmail, it becomes a complex task of reverse engineering to figure out why it's not happy without bind entries for "localhost." I imagine it was built with options (sendmail has more complex options than perhaps anything but Apache) that try to take a shortcut on having user input in order to properly set the domain as it is built - but the shortcut requires an environment with bind on the same system set in a certain way in order to work - so it's a long way around really, and we end up with a broken sendmail. But that's just a guess. It's likely that a few small edits to sendmail.cf after the build can work around this - but that's where it becomes a real reverse engineering puzzle. Besides direct edits to sendmail.cf, while common, are "wrong" according to sendmail creed. If we knew which options the package builder had included to produce the current problems, it would at least be easier to create and document the workarounds.

----------

## klieber

 *whit wrote:*   

> The smaller questions is, where are the notes from the people who put together the packages on which choices they made? 

 

Did you consider emailing the developer, asking a question on gentoo-dev, catching them on IRC or filing a bug report?

Some of the information you want is in the ChangeLog for each particular app.  A great deal of the information you want is not.  You're right -- it can be somewhat of an easter egg hunt.

--kurt

----------

## col

 *klieber wrote:*   

>  *col wrote:*   I really think gentoo needs some guides for the common server side software like bind, postfix, sendmail, apache ..... 
> 
> I doubt many people would argue that point.  The larger question is, "who is going to volunteer their time to write such a guide?"
> 
> --kurt

 

It would be cool if gentoo had community built docs...like a way to submit your notes to a server in a more formal manner than these forums. Then make the docs searchable. Maintainers could also pull the best parts out of the forums & insert them into the docs.  We would end up with better docs this way rather than having a single user write them.

There may be a way to use sendmail without bind using the ebuild . I did not bother looking into this because I need bind on my sendmail server.

----------

## klieber

 *col wrote:*   

> It would be cool if gentoo had community built docs...like a way to submit your notes to a server in a more formal manner than these forums. Then make the docs searchable. Maintainers could also pull the best parts out of the forums & insert them into the docs.  We would end up with better docs this way rather than having a single user write them.

 

We started a Gentoo Documentation project that's since stagnated because the project leader *cough*me*cough* ran short on time.  If anyone is interested in taking up the cause, feel free to send me a PM.  

--kurt

----------

## mgraves

I had the same problem and since I didn't see any solution I thought I'd share.  The /var/spool/clientmqueue directory has the incorrect ownership. It installed for me to root.root but should be smmsp.smmsp (e.g drwxrwx---    2 smmsp    smmsp        4096 Nov  9 09:53 clientmqueue)

Another solution might be to change

O RunAsUser=smmsp

O TrustedUser=smmsp

vars in /etc/mail/submit.cf

Hope this helps.

----------

## col

I also have incorrect permissions on the clientmqueue directory. Sendmail has been working fine with this but I am getting an errors in the mail.log......

----------

## Stalione

mgraves was right...the dir permissions on my /var/spool/clientmqueue was:

 *Quote:*   

> 
> 
> drwxrwx---    2 smmsp    users         104 Mar 11 11:02 clientmqueue
> 
> 

 

I changed it to 

 *Quote:*   

> 
> 
> drwxrwx---    2 smmsp    smmsp         104 Mar 11 11:02 clientmqueue
> 
> 

 

Before making this change I kept getting error messages saying:

 *Quote:*   

> 
> 
> 82445 rooster mail crit tag 2003- 03-11 10:48:53
> 
> sendmail[5638]: NOQUEUE: SYSERR(apache): can not chdir(/var/spool/clientmqueue/): Permission denied
> ...

 

Now it works!!! Yey!

----------

## MrSpock

If you encounter a simular problem (like me) check that your sendmail binary has the following permissions

```
-r-xr-sr-x    1 root     smmsp      667364 Feb  9 12:43 sendmail
```

keep an close eye to the 's' in the groups permission. that one was missing for me (normal 0444) so it didn't work. setting the 'set gid on execution' did the trick. use the mc if you don't know octal code  :Cool: 

----------

## kabutor

I love you mrspock THAT did the trick ..  :Smile: 

----------

## MrSpock

always a plessure to help out a 'guru'  :Laughing: 

----------

## MindBlaster

mrspock, you really helped me there!

Thank you!!

----------

