Postfix problems

Installing, Configuring, Troubleshooting server daemons such as Web and Mail
Post Reply
IMAN7
Posts: 9
Joined: 2008/03/02 06:53:59

Postfix problems

Post by IMAN7 » 2008/05/08 21:25:03

Hello
I am running a Centos 5 server with Sendmail.

I am having some problems switching to postfix.

I have the following entry in /etc/aliases: pcguest: alien

The user pcguest doesn't exist, it is aliased to user alien.

The name of my domain is "allies"
the server on which I run Sendmail is called: galatea.allies
On the same server I run Bind and I have the following zone info on allies:

IN NS galatea
galatea IN A 192.168.0.4
IN MX 10 galatea
www IN A 192.168.0.4
mail IN CNAME galatea
linux-l9cq IN A 192.168.0.3

As you see above mail.allies is a CNAME for galatea.

Now from host linux-l9cq I am emailing to galatea the following scenarios:

email to pcguest@mail.allies ---successfully delivered to alien@galatea.allies
email to alien@mail.allies ---succesfully delivered to alien@galatea.allies
email to pcguest@galatea.allies ---succesfully delivered to alien@galatea.allies
email to alien@galatea.allies ---succesfully delivered to alien@galatea.allies

So far so good.
I change the mta with alternatives --config mta to postfix.

I have the following configuration in /etc/postfix/main.cf

debug_peer_level = 2


debugger_command =
PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
xxgdb $daemon_directory/$process_name $process_id & sleep 5


sendmail_path = /usr/sbin/sendmail.postfix

newaliases_path = /usr/bin/newaliases.postfix

mailq_path = /usr/bin/mailq.postfix

setgid_group = postdrop

html_directory = no

manpage_directory = /usr/share/man

sample_directory = /usr/share/doc/postfix-2.3.3/samples

readme_directory = /usr/share/doc/postfix-2.3.3/README_FILES

I have to following lines in access: allies OK, 192.168.0 OK and I have created the access.db file.

going back the previous 4 scenarios, I have the following results:

email to pcguest@mail.allies ---faillure
The following messages appear in /var/log/maillog:

May 8 21:05:40 galatea postfix/smtpd[16644]: connect from unknown[192.168.0.3]
May 8 21:05:40 galatea postfix/smtpd[16644]: 3CC994726A2: client=unknown[192.168.0.3]
May 8 21:05:40 galatea postfix/cleanup[16647]: 3CC994726A2: message-id=
May 8 21:05:40 galatea postfix/smtpd[16644]: disconnect from unknown[192.168.0.3]
May 8 21:05:40 galatea postfix/qmgr[16481]: 3CC994726A2: from=, size=738442, nrcpt=1 (queue active)
May 8 21:05:40 galatea postfix/smtp[16648]: 3CC994726A2: to=, relay=none, delay=0.08, delays=0.08/0.01/0/0, dsn=5.4.6, status=bounced (mail for mail.allies loops back to myself)
May 8 21:05:40 galatea postfix/cleanup[16647]: 51C8F4726A4: message-id=
May 8 21:05:40 galatea postfix/bounce[16649]: 3CC994726A2: sender non-delivery notification: 51C8F4726A4
May 8 21:05:40 galatea postfix/qmgr[16481]: 51C8F4726A4: from=, size=2457, nrcpt=1 (queue active)
May 8 21:05:40 galatea postfix/qmgr[16481]: 3CC994726A2: removed
May 8 21:06:10 galatea postfix/smtp[16648]: connect to linux-l9cq.allies[192.168.0.3]: Connection timed out (port 25)
May 8 21:06:10 galatea postfix/smtp[16648]: 51C8F4726A4: to=, relay=none, delay=30, delays=0/0/30/0, dsn=4.4.1, status=deferred (connect to linux-l9cq.allies[192.168.0.3]: Connection timed out)

email to alien@mail.allies ---failure the following messages appear in /var/log/maillog
May 8 21:08:53 galatea postfix/smtpd[17009]: connect from unknown[192.168.0.3]
May 8 21:08:53 galatea postfix/smtpd[17009]: 349A74726A2: client=unknown[192.168.0.3]
May 8 21:08:53 galatea postfix/cleanup[17012]: 349A74726A2: message-id=
May 8 21:08:53 galatea postfix/qmgr[16481]: 349A74726A2: from=, size=738438, nrcpt=1 (queue active)
May 8 21:08:53 galatea postfix/smtpd[17009]: disconnect from unknown[192.168.0.3]
May 8 21:08:53 galatea postfix/smtp[17013]: 349A74726A2: to=, relay=none, delay=0.08, delays=0.08/0.01/0/0, dsn=5.4.6, status=bounced (mail for mail.allies loops back to myself)
May 8 21:08:53 galatea postfix/cleanup[17012]: 4DF924726A5: message-id=
May 8 21:08:53 galatea postfix/qmgr[16481]: 4DF924726A5: from=, size=2447, nrcpt=1 (queue active)
May 8 21:08:53 galatea postfix/bounce[17014]: 349A74726A2: sender non-delivery notification: 4DF924726A5
May 8 21:08:53 galatea postfix/qmgr[16481]: 349A74726A2: removed

email to pcguest@galatea.allies ---failure
the following messages appear /var/log/maillog
May 8 21:11:12 galatea postfix/smtpd[17724]: connect from unknown[192.168.0.3]
May 8 21:11:12 galatea postfix/smtpd[17724]: 611754726A2: client=unknown[192.168.0.3]
May 8 21:11:12 galatea postfix/cleanup[17727]: 611754726A2: message-id=
May 8 21:11:12 galatea postfix/qmgr[16481]: 611754726A2: from=, size=738448, nrcpt=1 (queue active)
May 8 21:11:12 galatea postfix/smtpd[17724]: disconnect from unknown[192.168.0.3]
May 8 21:11:12 galatea postfix/cleanup[17727]: 7429B4726A6: message-id=
May 8 21:11:12 galatea postfix/local[17728]: 611754726A2: to=, relay=local, delay=0.1, delays=0.08/0.01/0/0.01, dsn=2.0.0, status=sent (forwarded as 7429B4726A6)
May 8 21:11:12 galatea postfix/qmgr[16481]: 7429B4726A6: from=, size=738582, nrcpt=1 (queue active)
May 8 21:11:12 galatea postfix/qmgr[16481]: 611754726A2: removed
May 8 21:11:12 galatea postfix/smtp[17729]: 7429B4726A6: to=, orig_to=, relay=none, delay=0.02, delays=0.01/0.01/0/0, dsn=5.4.4, status=bounced (Host or domain name not found. Name service error for name=allies.allies type=A: Host not found)
May 8 21:11:12 galatea postfix/cleanup[17727]: 7B6404726A2: message-id=
May 8 21:11:12 galatea postfix/bounce[17730]: 7429B4726A6: sender non-delivery notification: 7B6404726A2
May 8 21:11:12 galatea postfix/qmgr[16481]: 7B6404726A2: from=, size=2764, nrcpt=1 (queue active)
May 8 21:11:12 galatea postfix/qmgr[16481]: 7429B4726A6: removed

email to alien@galatea.allies ---succesfully delivered to alien@galatea.allies
the following messages appear in /var/log/maillog
May 8 21:13:28 galatea postfix/smtpd[18136]: connect from unknown[192.168.0.3]
May 8 21:13:28 galatea postfix/smtpd[18136]: DF5894726A6: client=unknown[192.168.0.3]
May 8 21:13:28 galatea postfix/cleanup[18139]: DF5894726A6: message-id=
May 8 21:13:28 galatea postfix/qmgr[16481]: DF5894726A6: from=, size=738444, nrcpt=1 (queue active)
May 8 21:13:28 galatea postfix/smtpd[18136]: disconnect from unknown[192.168.0.3]
May 8 21:13:29 galatea postfix/local[18140]: DF5894726A6: to=, relay=local, delay=0.1, delays=0.07/0/0/0.03, dsn=2.0.0, status=sent (delivered to mailbox)
May 8 21:13:29 galatea postfix/qmgr[16481]: DF5894726A6: removed

Why postfix doesn't understand the aliases? I have run the newaliases command but that dosn't solve the problem.
After all according the configuration postfix reads the aliases from /usr/bin/newaliases.postfix and this file is a symbolic link to /usr/sbin/sendmai.postfix.
Why postfix resolves mail.allies badly?
What configuration changes should I make?
Thank you for your help

NedSlider
Forum Moderator
Posts: 2897
Joined: 2005/10/28 13:11:50
Location: UK

Postfix problems

Post by NedSlider » 2008/05/08 23:25:18

The first two mails to mail.allies bounce because you have set mail as a CNAME in DNS pointing to galatea, and thus created a loop where the mail server is trying to relay mail to itself. Don't use CNAMEs for mail servers, define them as an A record.

The third mail fails not because aliasing isn't working - it is, read your log file. It fails because of address rewriting:

[quote]May 8 21:11:12 galatea postfix/smtp[17729]: 7429B4726A6: to=, orig_to=, relay=none, delay=0.02, delays=0.01/0.01/0/0, dsn=5.4.4, status=bounced (Host or domain name not found. Name service error for name=allies.allies type=A: Host not found)[/quote]

pcguest is correctly aliased to alien, but alien@allies.allies which doesn't exist.

I would suggest you post the output of '[b]postconf -n[/b]' to assist others in helping you.

IMAN7
Posts: 9
Joined: 2008/03/02 06:53:59

Re: Postfix problems

Post by IMAN7 » 2008/05/12 20:17:49

Here it is

[root@galatea ~]# postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
debug_peer_level = 2
html_directory = no
inet_interfaces = all
mail_owner = postfix
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
mydestination = $myhostname, localhost.$mydomain, localhost
mydomain = allies
myhostname = galatea.allies
mynetworks = 192.168.0.0/24, 127.0.0.0/8
myorigin = $mydomain
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.3.3/README_FILES
sample_directory = /usr/share/doc/postfix-2.3.3/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
smtpd_client_restrictions = check_client_access hash:/etc/postfix/access
unknown_local_recipient_reject_code = 550

NedSlider
Forum Moderator
Posts: 2897
Joined: 2005/10/28 13:11:50
Location: UK

Re: Postfix problems

Post by NedSlider » 2008/05/12 22:41:49

Did you fix your DNS records?

That all looks OK. I would be tempted to add $mydomain to mydestination like so:

mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain

Also, your domain is missing it's tld component. I'm not sure if that is maybe causing you issues. Changing it to allies.local may help (assuming it's not a registered domain).

Then test again and report back.

Ned

IMAN7
Posts: 9
Joined: 2008/03/02 06:53:59

Re: Postfix problems

Post by IMAN7 » 2008/06/15 03:27:36

I removed the CNAME entry from the zone.
It turned out that in order to solve the address rewrite problem, I had to assign the value
myorigin =$myhostname instead of myorigin=$mydomain.

Post Reply