Problem on Postix

19 posts / 0 new
Last post
#1 Mon, 09/12/2011 - 10:46
input

Problem on Postix

Hi all

Suddenly my virtualmin pro postfix is not working correctly. After I change the size of email messages allowed o postfix, all messages started to be redirected to the domains but with the prefix of the host (ex: an email with destination address@domain.com goes to address@host.domain.com.

Can anybody help me on this and tell how to redirect the messages that are in queue.

Any help will be most obliged.

Regards Hermano Correia

Mon, 09/12/2011 - 10:56
andreychek

Howdy,

If you log into Virtualmin, and click System Settings -> Re-Check Config, does it see any problems with the configuration on your server?

-Eric

Mon, 09/12/2011 - 10:59
input

Yes already tried no errors.

I am in trouble because this is a production server...

Mon, 09/12/2011 - 11:19
andreychek

Do you happen to have a Virtual Server that contains the same name as the hostname on your server? If so, it's possible that's causing problems...

-Eric

Mon, 09/12/2011 - 11:23
input

No I haven't.

Mon, 09/12/2011 - 11:32
andreychek

It's normal that an email sent to user@example.com would be delivered to system.username@hostname.domain.tld.

Each email user has a system username, and that's how Postfix delivers incoming email that it receives.

If you're finding that such messages are bouncing... most common causes of that are caught by running the Re-Check Config.

However, you may want to manually verify that in /etc/postfix/main.cf, that your system's full hostname appears in the "mydestination" line.

-Eric

Mon, 09/12/2011 - 11:46
input

My main.cf:

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

Mon, 09/12/2011 - 12:05
andreychek

Try adding your full hostname to the end of that.

-Eric

Mon, 09/12/2011 - 12:06
input

An additional information is that I am using user@domain.tld mailboxes.

If you want I can give access to system if it necessary and easier for you...

Mon, 09/12/2011 - 12:19
input

Problem remains. I already tried to add the hostname.

This is very strange because everything was working fine till this change in the morning...

Mon, 09/12/2011 - 12:50
andreychek

What is the output of the command "postconf -n" on your system?

-Eric

Mon, 09/12/2011 - 12:53
input

virtual_alias_maps = hash:/etc/postfix/virtual

Mon, 09/12/2011 - 12:56
andreychek

Hmm, it shouldn't be just one line... you should see a bunch of lines. That command shows all the settings in your main.cf that are different from the default.

-Eric

Mon, 09/12/2011 - 13:03
input

This is some mess on the rewrite of the addresses.

as you can see on this message sent to a mailbox from gmail account:

Reporting-MTA: dns; host.mydomain.tld X-Postfix-Queue-ID: 825237A0A21 X-Postfix-Sender: rfc822; user@gmail.com Arrival-Date: Mon, 12 Sep 2011 17:42:11 +0100 (WEST)

Final-Recipient: rfc822; user-domain.tld@host.mydomain.tld Original-Recipient: rfc822;user@domain.tld Action: failed Status: 5.4.6 Diagnostic-Code: X-Postfix; mail for host.mydomain.tld loops back to myself

All domains are substituted by host.mydomain.tld

Can you help me? I am really stuck.

Mon, 09/12/2011 - 13:07
input

Sorry it missed the copy past. The output is the following:

alias_database = hash:/etc/aliases

alias_maps = hash:/etc/aliases

broken_sasl_auth_clients = yes

command_directory = /usr/sbin

config_directory = /etc/postfix

daemon_directory = /usr/libexec/postfix

debug_peer_level = 2

home_mailbox = Maildir/

html_directory = no

mailbox_command = /usr/bin/procmail-wrapper -o -a $DOMAIN -d $LOGNAME

mailq_path = /usr/bin/mailq.postfix

manpage_directory = /usr/share/man

message_size_limit = 200480000

mydestination = $myhostname, localhost.$mydomain, localhost, localhost.localdomain, input-vz-lx01.input.pt

newaliases_path = /usr/bin/newaliases.postfix

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

relay_domains = $mydestination, rofer.pt, cunhagomes.pt, webmail.jlbarros.cunhagomes.pt, cunhagomes.com, irenfilipa.com

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

sender_bcc_maps = hash:/etc/postfix/bcc

sendmail_path = /usr/sbin/sendmail.postfix

setgid_group = postdrop

smtpd_recipient_restrictions = permit_mynetworks permit_sasl_authenticated reject_unauth_destination check_policy_service unix:/var/spool/postfix/postgrey/socket

smtpd_sasl_auth_enable = yes

smtpd_sasl_security_options = noanonymous

transport_maps = hash:/etc/postfix/transport

unknown_local_recipient_reject_code = 550

virtual_alias_maps = hash:/etc/postfix/virtual
Mon, 09/12/2011 - 13:21
andreychek

Okay, so the key is here:

Final-Recipient: rfc822; user-domain.tld@host.mydomain.tld Original-Recipient: rfc822;user@domain.tld Action: failed Status: 5.4.6 Diagnostic-Code: X-Postfix; mail for host.mydomain.tld loops back to myself

The addresses listed in there are normal -- that's exactly how email should be delivered.

What's not normal is the "mail for host.mydomain.tld loops back to myself" message. That suggests that Postfix doesn't think it's configured to receive email for your server name.

If you run the command "hostname" -- what output does it return? Is it the same name as the "host.mydomain.tld" above?

It looks like "relay_domains" is set... that's not a default. Unless you're sure you need that, you may want to comment that out.

The same goes for your "transport_maps" setting... that's not a default either, and could potentially cause trouble unless you're sure you need it.

You may want to try commenting those out, restarting Postfix, and then try resending your email.

As far as why this happened -- my suspicion is that some other setting was changed at some point, and just not active. Changing the message size today probably just caused a Postfix restart, which made other settings active. So it's just a matter if determining which setting is causing the problem :-)

-Eric

Mon, 09/12/2011 - 13:39 (Reply to #16)
input

Ok, is understable that something else have changed before the max size msg change.

I migrate this server from another and now this one is in production.

Everything was ok before the postfix restart, so the happen in the last few days,

I have relay for that domains on this server, configured by virtualmin. All the changes made on postfix less the one concerning the msg size where made by virtualmin, so I really don't know if I should comment this lines but I will try. Neverthless all the mailboxes on postfix created on the virtualmin appears on user@domain.tld format, so when you say that the id on the gmail msg is ok, I really don't understand how the system translates that.

I will try to solve this, eventhough I am not a postfix expert... But I am concerned with this situation because this can mean that all my customers suddenly can stop receiving email and it's not easy to find out why.

Mon, 09/12/2011 - 13:50
andreychek

Neverthless all the mailboxes on postfix created on the virtualmin appears on user@domain.tld format, so when you say that the id on the gmail msg is ok, I really don't understand how the system translates that.

That's all part of the Virtualmin magic that goes into configuring Postfix!

This might be a simpler way of explaining it though... all of the users on your server actually have two email addresses.

One is user@domain.tld.

The other is user-domain.tld@host.mydomain.tld.

That's because their actual system account is "user-domain.tld". You'll see entries for that in the /etc/passwd file.

So, in your /etc/postfix/virtual file, you have a number of "virtual" email addresses setup, like user@domain.tld.

Once Postfix receives those, it turns around and delivers it to the address "user-domain.tld@host.mydomain.tld".

That normally all occurs behind the scenes, and just works. Unfortunately, in your case, something isn't working right!

I will try to solve this, eventhough I am not a postfix expert

Well, we're here to help... I'm trying to get a better understanding of what's going on, and tossing out some ideas that might resolve your issue. But, if none of those ideas help, the next step is to have someone log in and take a look to see if we can determine what's going on there.

You might want to start with the "hostname" questions above... and also determining what, if anything, is in your /etc/postfix/transport file (which will show what exactly the transport_maps line is doing).

-Eric

Mon, 09/12/2011 - 15:32 (Reply to #18)
input

Hi again

I figured out the problem... The increase of msg size was real the problem. I made an error an put a zero more than I should and the size of the msg become bigger than the max size of the mail box.

I recomend you to make a test between this two fields in Virtualmin to prevent this kind of error.

Regards and thanks for all your help

Hermano Correia

Topic locked