Forum Moderators: phranque

Message Too Old, No Replies

sendmail configuration for virtual hosts

first time set up of users - relaying denied

         

jamie

3:39 pm on Jan 29, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



hi,

the battle continues with the set up of our first dedicated server... :)

now it is sendmail's turn.

a domain (mydomain.com) has been set up and resolves correctly to my IP. the mx records have been set up using mail.mydomain.com

* i have created user james
* i have added "james@mydomain.com james" to the virtusertable
* i have added "mydomain.com" to relay-domains
* i have added "mydomain.com" to sendmail.cw
* i have added "MY.IP.ADDRESS RELAY" to access

and yet i am still unable to send or receive mail using outlook express.

when trying to send i receive a relaying denied error...

...and i have not received the test mail which i have sent to the account from another domain

(i am using an out of the box redhat 7.2 / apache setup)

any help is much appreciated

seindal

4:44 pm on Jan 29, 2003 (gmt 0)

10+ Year Member



You'll do yourself a giant favour by switching to something easier to handle than sendmail. Postfix is a brilliant choice, there there are also exim and qmail. All of these are easier to setup than sendmail.

Personally I use postfix on servers and exim on desktop machines. The configuration files of these programs are actually readable!

René.

jamie

5:15 pm on Jan 29, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



thanks rené

i shall investigate postfix immediately.

jamie

7:41 pm on Jan 30, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



hi rené,

i have installed postfix, however i always get the message relaying denied.

in my main.cf the things i have changed are:

myhostname = myserver.name.tld (to match our hostname)
mydomain = name.tld (the hostname minus the first bit)

mydestination = $myhostname, localhost.$mydomain, $mydomain, /etc/postfix/localdomains
(in the localdomains file i have listed the domains which i have set up as virtual hosts)

relay_domains = $mydestination, /etc/postfix/relay-domains (same list of domains as localdomains)

alias_maps = hash:/etc/postfix/aliases

virtual_maps = hash:/etc/postfix/virtual
(in this text file i have mapped email addresses to users. e.g. james@mydomain.com james)

i then set up my pop account with my username, password smtp and pop server (mail.mydomain.com) but i can't receive or send - i always get relaying denied.

<added>i am also unable to receive, when sending myself mails from different domains - i just don't get anything</added>

any suggestions?

thanks

seindal

7:55 pm on Jan 30, 2003 (gmt 0)

10+ Year Member



You seem to miss a mynetworks setting:

From the postfix docs

# The mynetworks parameter specifies the list of "trusted" SMTP
# clients that have more privileges than "strangers".
#
# In particular, "trusted" SMTP clients are allowed to relay mail
# through Postfix. See the smtpd_recipient_restrictions parameter
# in file sample-smtpd.cf.
#
# You can specify the list of "trusted" network addresses by hand
# or you can let Postfix do it for you (which is the default).
#
# By default (mynetworks_style = subnet), Postfix "trusts" SMTP
# clients in the same IP subnetworks as the local machine.
#
# Specify "mynetworks_style = class" when Postfix should "trust" SMTP
# clients in the same IP class A/B/C networks as the local machine.
# Don't do this with a dialup site - it would cause Postfix to "trust"
# your entire provider's network. Instead, specify an explicit
# mynetworks list by hand, as described below.
#
# Specify "mynetworks_style = host" when Postfix should "trust"
# only the local machine.
#

jamie

8:17 pm on Jan 30, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



hi rené,

sorry, after i posted i added

mynetworks = 123.123.123.123, 123.123.123.124
(these correspond to the IP addresses i have been allocated on our server)

still doesn't work, it is still relaying denied.

p.s. (after chmod 777 /var/spool/mail i am able to receive mail :) )

<added>hi rené i just did a postfix check and it says:

postfix/postfix-script: warning: /var/spool/postfix/etc/passwd and /etc/passwd differ

i am now investigating

<added again>i have cp /etc/passwd to /var/spool/postfix/etc but still relaying denied. although a postfix check is OK

[edited by: jamie at 8:46 pm (utc) on Jan. 30, 2003]

seindal

8:39 pm on Jan 30, 2003 (gmt 0)

10+ Year Member



> postfix/postfix-script: warning: /var/spool/postfix/etc/passwd and /etc/passwd differ

I never quite understood that, but if you copy /etc/passwd to /var/spool/postfix/etc/passwd it goes away.

René.

jamie

8:47 pm on Jan 30, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



yes you beat me to it ;)

it has gone away. still has me puzzled about the relaying denied.

is it correct to use the IP addresses which our virtual hosts use in the

mynetworks setting?

jamie

8:48 am on Jan 31, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



dear rene,

after a fresh start this morning the following is now the case.

1) i can receive mail from other domains to my postfix account
2) i can send mail to myself using my postfix account and outlook express
3) i still can't send mail to other domains. it gives me relaying denied.

if you do know what might be the problem, i am much obliged for any suggestions. i am also however surfing the google postfix group, so i hope to find the answer there.

thanks anyway for continued help :)

dingman

6:05 pm on Jan 31, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Are you trying to use your dedicated server as the SMTP server for that account in a mail client on another machine? If so, that's your problem. Relaying is allowed in the configuration you described only for mail being sent from that machine. Your workstation has an IP address not listed as a machine to relay for. If you have a fixed IP for your workstation, you can add it to the list. If not, you'll have to set up SMTP authentication. So far, I haven't been able to do so in a manner which actually works :( If I calculate the correct responses and type them in manually, I can relay, but when I try to use a mail client it doesn't work. I don't know why. If you get it worked out, I'll be interested to know how.

jamie

11:30 am on Feb 1, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



hi dingman,

yes that's exactly the problem. i need to allow the virtual hosts on our server to use their pop accounts in outlook express to send and receive from and to any domain they choose.

pop-before-smtp.pl is proving to be an absolute nightmare ;) lots of frustration over the last two days. in fact i am now waiting for a reply from a someone who says he can configure it to do eactly that. i wait with baited breath.....

cheers

jamie

7:36 am on Feb 6, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



6 days later.....

sendmail-8.11.6 configured correctly with pop-before-smtp to allow IP based relaying!

i think i must have read every single post in every single damn usenet, mailling list and forum on the net and have sat up late at night and cussed and sweared ;-) i have installed and deinstalled postfix and been through two different relay hacks with sendmail. it has made me weep with frustration (well almost ;-)

i was a complete linux/apache beginner on the 23th january. and have now set up my first webserver from scratch from the command line with php, mysql, virtual domains and a working sendmail relay!

you really can do anything if you put your mind to it!

james (formerly windows user, now sendmail guru)

seindal

8:26 am on Feb 6, 2003 (gmt 0)

10+ Year Member



Jamie, if you can handle sendmail, you can handle anything :) You have good reason to feel confident.

jamie

3:38 pm on Feb 6, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



thanks rené :)