INBOUND email does not work...

19 posts / 0 new
Last post
#1 Thu, 08/25/2011 - 14:22
MouseAttack

INBOUND email does not work...

Hi All, I have installed Virtualmin with Sendmail and Dovecot (originally I installed Postfix and dovecot) but then php mail() scripts were not working, so Uninstalled postfix and reactivated sendmail....

Sendmail is sending my php emails no problem, I can login to USERMIN and send email no problem, however I cannot RECEIVE any emails inbound.

Need some help please, frying my brain for 3 days over this.

Thu, 08/25/2011 - 14:29
andreychek

Howdy,

When you installed Virtualmin, did you by chance use the install.sh script?

If not, and you're able to start over -- that might save you a lot of hassle. The install.sh script configures everything for you, so you shouldn't have to do much tweaking to get email working.

If you're interested in sticking with sendmail -- I'm unfortunately not really familiar with using it, and Virtualmin comes ready to use Postfix by default... but the key would be to review the mail logs for any errors, as well as to make sure it's listening on port 25, and that your ISP isn't blocking port 25 as some do.

-Eric

Thu, 08/25/2011 - 17:38
MouseAttack

I just installed postfix again and php is continuing to work this time thank god., however it's still not working properly.

I was able to connect via OUTLOOK if I put in my email address as USER@HOSTNAME.com (AKA SERVER1.DOMAIN.COM)

How do i change this to USER@DOMAIN.COM ? Will that resolve the entire problem with my email's not GOING or COMING properly????

Thu, 08/25/2011 - 17:43
andreychek

Howdy,

Well, I need some info about how you performed the Virtualmin installation -- did you use the install.sh, or did you do a manual installation?

Manual installs are a lot more difficult and require a decent amount of setup -- the exact steps can be found here:

http://www.virtualmin.com/documentation/installation/manual

Included in that are various configuration changes that need to be made to Postfix, Dovecot, and Procmail -- all part of the email stack, which may be related to the issues you're seeing now.

If you can, I'd certainly suggest using the automated installation with the install.sh script.

-Eric

Thu, 08/25/2011 - 17:57
MouseAttack

ok I figured out what is going on right now, I just need help fixing it.

INCOMING EMAILS WORK WHEN THEY ARE DIRECTED TO:

USERNAME@HOSTNAME.COM (server1.DOMAIN.COM)

OUTGOING EMAILS WORK WHEN I change the FROM Address 2 - USERNAME@DOMAIN.COM

How do I fix it so INCOMING emails work to @DOMAIN.COM instead of @HOSTNAME.com ????

Thu, 08/25/2011 - 18:19
andreychek

Well, the problem is that your email stack isn't configured correctly. Postfix hasn't been configured to handle the email accounts being added to your system.

If you didn't use the install.sh to perform your installation, then you'll need to work through the various configuration changes in the manual install guide I linked to above in order to get your system working properly.

-Eric

Thu, 08/25/2011 - 19:38
MouseAttack

Hi Andrey, I tried your suggestion, no dice. It actually broke postfix sorta.

====================== Postfix

Postfix should be installed, and configured for virtual hosting. The best way to do this for the vast majority of deployments is to use a simple map file.

Edit main.cf and add the following line:

virtual_alias_maps = hash:/etc/postfix/virtual

Save it, and restart Postfix.

I am all out of options. IT has to be a VERY SIMPLE fix why email

USERNAME@SERVER1.DOMAIN.COM works

and USERNAME@DOMAIN.com doesn't work

, it's a REALLY simple fix, I just dont' know where!!! Anyone??

Thu, 08/25/2011 - 20:06
andreychek

What problem happens exactly when you send an email to username@domain.com? Do you get an error? If so, what error do you get?

-Eric

Thu, 08/25/2011 - 21:01
MouseAttack

This is an automatically generated Delivery Status Notification

THIS IS A WARNING MESSAGE ONLY.

YOU DO NOT NEED TO RESEND YOUR MESSAGE.

Delivery to the following recipient has been delayed:

 kolmin@kolmin.com

Message will be retried for 2 more day(s)

Technical details of temporary failure: The recipient server did not accept our requests to connect. Learn more at http://mail.google.com/support/bin/answer.py?answer=7720 [mail.kolmin.com. (0): Destination address required]

But when I send email to kolmin@SERVER1.kolmin.com it WORKS and is received on the server. SERVER1.KOLMIN.COM is my hostname.

For SENDING EMAIL FROM the server, using the virtualmin / usermin script, I must change the FROM field FROM kolmin@SERVER1.kolmin.com TO kolmin@kolmin.com and it works.

My username is kolmin and my domain is kolmin.com

this is really frustrating, thank you for your attempted help.

Thu, 08/25/2011 - 22:08
MouseAttack

I changed some things around in main.cf ONLY, and I got email working back and forth THROUGH

USERNAME@SERVER1.DOMAIN.COM ONLY.

I do not know how to make it USERNAME@DOMAIN.COM (KOLMIN@SERVER1.KOLMIN.COM) . I do not know how to change this at all, and how do I create virtual aliases, I need a BLACKHOLE meaning *@kolmin.com is forwarded to > MAINEMAIL@ANOTHERDOMAIN.COM

Can you share your main.cf file?

Here is an example of my main.cf

daemon_directory = /usr/libexec/postfix


mail_owner = postfix


myorigin = $mydomain


inet_interfaces = all

mydestination = $myhostname, localhost.$mydomain, localhost

unknown_local_recipient_reject_code = 550

alias_maps = hash:/etc/aliases

alias_database = hash:/etc/aliases

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
smtpd_sasl_local_domain =
smtpd_sasl_auth_enable = yes

smtpd_sasl_local_domain =
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_sasl_authenticated_header = yes
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
mynetworks = 127.0.0.0/8
smtpd_tls_auth_only = no
smtp_use_tls = yes
smtpd_use_tls = yes
smtp_tls_note_starttls_offer = yes
smtpd_tls_key_file = /etc/postfix/ssl/smtpd.key
smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crt
smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom
home_mailbox = Maildir/
mailbox_command =

virtual_alias_maps = hash:/etc/postfix/virtual
Fri, 08/26/2011 - 08:29
MouseAttack

Sending an email TO USERNAME@DOMAIN.COM gives me this error:

Google tried to deliver your message, but it was rejected by the recipient domain. We recommend contacting the other email provider for further information about the cause of this error. The error that the other server returned was: 554 554 5.7.1 kolmin@kolmin.com: Relay access denied (state 14).

Fri, 08/26/2011 - 12:27
andreychek

The "relay access denied" errors suggest that your server doesn't think it's setup to receive email for that domain.

That may suggest there's a problem with the /etc/postfix/virtual file -- that file should have entries in it for each domain, and each email account that's added.

This is all normally setup for you on a fresh distribution install when using the install.sh installer to install Virtualmin, so the key here is to figure out what's different from a default setup.

You mentioned in another thread that the virtual file is blank -- if you look in System Settings -> Virtualmin Configuration, what is "Mail server to configure" set to? That should be set to "Postfix".

-Eric

Fri, 08/26/2011 - 16:08
MouseAttack

Yes, that is set to postfix in vritualmin control panel.

Fri, 08/26/2011 - 16:13
andreychek

Howdy,

Since you started with Sendmail, and later moved to Postfix -- and only recently configured it to use the virtual file, it's possible that the appropriate entries in the virtual file weren't correctly created.

What happens if you create a new Virtual Server... perhaps just a test one... now that you have Postfix installed, do the entries in the "virtual" file get created?

-Eric

Fri, 08/26/2011 - 16:14
MouseAttack

I don't know why, but my postfix main.cf config was just changed:

smtpd_sasl_local_domain =
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_sasl_authenticated_header = yes
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, check_recipient_access mysql:/etc/postfix/mysql-virtual_recipient.cf, reject_unauth_destination
mynetworks = 127.0.0.0/8 [::1]/128
smtpd_tls_auth_only = no
smtp_use_tls = yes
smtpd_use_tls = yes
smtp_tls_note_starttls_offer = yes
smtpd_tls_key_file = /etc/postfix/smtpd.key
smtpd_tls_cert_file = /etc/postfix/smtpd.cert
smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom
myhostname = server.kolmin.com
home_mailbox = Maildir/
mailbox_command =
virtual_alias_domains =
virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf, mysql:/etc/postfix/mysql-virtual_email2email.cf
virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains.cf
virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf
virtual_mailbox_base = /var/vmail
virtual_uid_maps = static:5000
virtual_gid_maps = static:5000
smtpd_tls_security_level = may
transport_maps = proxy:mysql:/etc/postfix/mysql-virtual_transports.cf
relay_domains = mysql:/etc/postfix/mysql-virtual_relaydomains.cf
relay_recipient_maps = mysql:/etc/postfix/mysql-virtual_relayrecipientmaps.cf
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_cano$
smtpd_sender_restrictions = check_sender_access mysql:/etc/postfix/mysql-virtual_sender.cf
smtpd_client_restrictions = check_client_access mysql:/etc/postfix/mysql-virtual_client.cf
maildrop_destination_concurrency_limit = 1
maildrop_destination_recipient_limit = 1
virtual_transport = maildrop
header_checks = regexp:/etc/postfix/header_checks
mime_header_checks = regexp:/etc/postfix/mime_header_checks
nested_header_checks = regexp:/etc/postfix/nested_header_checks
body_checks = regexp:/etc/postfix/body_checks

Can you please show me what YOURS looks like so I can compare?

Fri, 08/26/2011 - 16:30
andreychek

Wow, those aren't subtle changes... that will certainly prevent it from working at all :-)

The Postfix config is different across distros... what I'd recommend doing is using the config that you shared in your earlier comment, which is a good default.

You'll then need to review the manual installation directions that I shared above, and go through all the configuration changes mentioned in it (including those for Postfix, procmail, and dovecot). It looks like you're still missing some of the changes described in it. In addition to all the config changes described in there, you'll also need to make sure you perform the procmail-wrapper installation that it describes.

Without all those steps, things won't work properly.

A manual installation like you're trying to perform is much more difficult, and you'll really need review the entire manual install guide or things won't work properly :-)

-Eric

Fri, 08/26/2011 - 16:35
MouseAttack

Ok I don't know how I finally got it, because I tried this before, but i got USERNAME@DOMAIN.COM working.

When I added $mydomain to the mydestination = line, it's working. FINALLY. I tried this before I have no idea why it decided NOW to work.

mydestination = $mydomain, server.kolmin.com, localhost, localhost.localdomain

I STILL must change my FROM email address in webmin/virtual min from USERNAME@HOSTNAME to USERNAME@DOMAIN NAME Do you know how to correct that by default to send properly in webmin/virtual min?

Also, I tried setting up a forwarder to forward USERNAME@DOMAIN to MYGMAIL@GMAIL.COM, but no dice

Fri, 08/26/2011 - 16:37
MouseAttack

ERIC, I reviewed the manual installation that you linked to TWO DOZEN TIMES.

There is only ONE CHANGE, adding the Virtual_domain_aliases line to main.cf, the manual instructions don't have anything else to do with postfix!!!

Fri, 08/26/2011 - 16:44
andreychek

The instructions in the "procmail" section include several things you'll need to setup on your server, including a change to the Postfix main.cf file. It doesn't look like you're performed those steps yet :-)

That all needs to be completed before things will work.

Additionally, until the "virtual" file has an entry for all your domains, things won't work properly.

I made some suggestions above as to how to begin troubleshooting the virtual file issue.

-Eric

Topic locked