PDA

View Full Version : Sles11SP3 sendmail problem



christianmolecki
12-Feb-2015, 11:57
Hello,

I have following problem with sendmail.
If I try to send a mail, sendmail uses root@localhost as relay and not the specified outgoing mailserver.

Logentry:

sendmail[569]: starting deamon (8.14.3): SMTP+queueing@00:30:00
sendmail-client [580]: starting deamon (8.14.3): persistent-queueing@00:01:00
sendmail[595]: t1CAbNBj000595: from=root, size=241, class=0, nrcpts=1, msgid=<201502121037.t1CAbNBj000595@testhost.workgroup, relay=root@localhost
sendmail[599]: t1CAbNqp000599: from=root@testhost.workgroup, size=508, class=0, nrcpts=1, msgid=>201502121037.t1CAbNqp000599@testhost.workgroup, proto=ESMTP, daemon=MTA, relay=localhost [127.0.0.1]
sendmail[599]: t1CAbNqp000599: to=<myadress@mydomain>, delay=00:00:00, mailer=esmtp, pri=30508, dsn=4.4.43, stat=queued
sendmail[595]: t1CAbNBj000595: to=<myadress@mydomain>, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30241, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=SENT (t1CAbNqp000599 Message accepted for delivery)


How can I fix this problem?

Best Regards,
Chris.

jmozdzen
12-Feb-2015, 12:13
Hi Chris,

> If I try to send a mail, sendmail uses root@localhost as relay and not the specified outgoing mailserver.
> How can I fix this problem?

by fixing the configuration? ;)

This somehow sounds like a fresh install to me - any reason not to use Postfix instead of sendmail? You'll find more people familiar with the former nowadays, not many sendmail specialists around anymore.

> If I try to send a mail, sendmail uses root@localhost as relay and not the specified outgoing mailserver.

I do read the log a tiny bit different: sendmail tries to forward mail for "myadress@mydomain" to the MTA at 127.0.0.1 (localhost).

Without further details, my guess is that either sendmail has been configured to route to itself or your DNS has an improper MX record for mydomain. How familiar are you with sendmail and Internet mail setup?

Regards,
Jens

christianmolecki
12-Feb-2015, 12:24
Hi Jens,

this is a fresh sendmail installation. I only configured the outgoing mail server via YAST.
The server has no connection to a DNS server and no further routes than the default route

Chris.

jmozdzen
12-Feb-2015, 12:49
Hi Jens,

this is a fresh sendmail installation.

Is "sendmail" a given, or are you free to switch to Postfix?

[QUOTE=christianmolecki;26330I only configured the outgoing mail server via YAST.
The server has no connection to a DNS server and no further routes than the default route[/QUOTE]

IP routes are not what I'm thinking of - it's the mail routing inside sendmail (the "rules") that I'm after. You ought to try to test-drive the sendmail rules (see i.e. http://docstore.mik.ua/orelly/networking/sendmail/ch38_01.htm)

Regards,
Jens

christianmolecki
12-Feb-2015, 13:08
sendmail is not given.

Meanwhile I installed postfix and configured the outgoing mailserver via yast.
Now I get the error: Host or domain name not found. Name service error for name=<mydomain> type=MX: Host not found, try again)


The server has no DNS-servers but is in a (fake-)domain to get a FQDN.

jmozdzen
12-Feb-2015, 13:24
Hi Chris,

Meanwhile I installed postfix and configured the outgoing mailserver via yast.
Now I get the error: Host or domain name not found. Name service error for name=<mydomain> type=MX: Host not found, try again)


The server has no DNS-servers but is in a (fake-)domain to get a FQDN.

I take it that your new server is not to receive any email? That's what would be called a "null client", which forwards all mail to a more knowledgeable MTA. You can set POSTFIX_NULLCLIENT="yes" /etc/sysconfig/postfix and run /usr/sbin/config.postfix to adjust the configuration.

Else (if you don't want all mails to be sent to another MTA) you might have to adjust the RELAY_HOST. From /etc/sysconfig/postfix:


## Path: Network/Mail/Postfix
## Description: Basic configuration of the postfix MTA
## Type: string
## Default: ""
## Config: postfix
#
# Should we use a mailrelay?
# NOTE: ALL mail that is not considered to be my destination
# (POSTFIX_LOCALDOMAINS), will be sent to this host.
# If this host is not your MX, then you have to use [square brackets]
# around the hostname, e.g. [relay.example.com]
# You may also specify an alternate port number, e.g.
# relay.example.com:26 or [relay.example.com]:26 to prevent MX lookups.

Regards,
Jens

jmozdzen
12-Feb-2015, 13:27
Hi Chris,

that info was mis-leading: If you actually have no DNS at all (not just no DNS setup for the domain of the server in question) or your relay server (which you already configured) has no MX record, you ought to use the "[...]" syntax at all times, no matter if you're running the server as a null client or not.

Regards,
Jens

christianmolecki
12-Feb-2015, 13:37
I take it that your new server is not to receive any email? That's what would be called a "null client", which forwards all mail to a more knowledgeable MTA. You can set POSTFIX_NULLCLIENT="yes" /etc/sysconfig/postfix and run /usr/sbin/config.postfix to adjust the configuration.

Your assumption is correct.
I made the changes. But /usr/sbin/config.postfix is not available. So I run /etc/init.d/postfix restart
Unfortunately it didn't change anything.



Else (if you don't want all mails to be sent to another MTA) you might have to adjust the RELAY_HOST. From /etc/sysconfig/postfix:
Nullclient is the right thing for us.

jmozdzen
12-Feb-2015, 13:55
Hi Chris,

Your assumption is correct.
I made the changes. But /usr/sbin/config.postfix is not available. So I run /etc/init.d/postfix restart
Unfortunately it didn't change anything.

My fault - it's /usr/sbin/SuSEconfig.postfix





> Else (if you don't want all mails to be sent to another MTA) you might have to adjust the RELAY_HOST. From /etc/sysconfig/postfix:
Nullclient is the right thing for us.

Please see my other message concerning DNS / MX records: Using the "[...]" syntax you tell Postfix not to try to obtain the actual MTA's address by looking for an MX record in DNS.

Regards,
Jens

christianmolecki
17-Feb-2015, 11:59
Hallo Jens,

ich glaube wir könnten uns auch auf Deutsch unterhalten :)

Wo muss ich denn diese Eckigen Klammern angeben?


Grüße
Christian

jmozdzen
17-Feb-2015, 12:13
Hi Christian,

Hallo Jens,

ich glaube wir könnten uns auch auf Deutsch unterhalten :)

natürlich könnten *wir* das, but for the sake of other international readers of this forum/thread, I suggest not to switch to German :)


Wo muss ich denn diese Eckigen Klammern angeben?

You'd need to use the "[...]" syntax when specifying a host name that has no DNS MX record. In your specific case, that'd probably be RELAY_HOST in /etc/sysconfig/postfix (or the corresponding value in YaST) as quoted in my earlier message:




## Path: Network/Mail/Postfix
## Description: Basic configuration of the postfix MTA
## Type: string
## Default: ""
## Config: postfix
#
# Should we use a mailrelay?
# NOTE: ALL mail that is not considered to be my destination
# (POSTFIX_LOCALDOMAINS), will be sent to this host.
# If this host is not your MX, then you have to use [square brackets]
# around the hostname, e.g. [relay.example.com]
# You may also specify an alternate port number, e.g.
# relay.example.com:26 or [relay.example.com]:26 to prevent MX lookups.


Regards,
Jens

christianmolecki
17-Feb-2015, 12:24
Hello Jens,

I made following entry in the config: POSTFIX_RELAYHOST="[IP-of-Mailserver]"


Unfortunatly the problem persists

jmozdzen
17-Feb-2015, 12:33
Hi Christian,

Hello Jens,

I made following entry in the config: POSTFIX_RELAYHOST="[IP-of-Mailserver]"


Unfortunatly the problem persists

did you re-run "/usr/sbin/SuSEconfig.postfix"? It then might be worth to share the contents of "/etc/postfix/main.cf" plus current syslog entries for a test mail.

Regards,
Jens