LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Postfix main.cf (https://www.linuxquestions.org/questions/linux-server-73/postfix-main-cf-670290/)

halvorls 09-16-2008 10:14 AM

Postfix main.cf
 
Hi!

I have make a main .cf file to postfix, what hvae i do wrong?

Here is the config file:

# See /usr/share/postfix/main.cf.dist for a commented, more complete version


# Debian specific: Specifying a file name will cause the first
# line of that file to be used as the name. The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname

smtpd_banner = $myhostname ESMTP $mail_name
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

# TLS parameters
smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key
smtpd_tls_session_cache_database = btree:${queue_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${queue_directory}/smtp_scache

smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = hd.hvalstaddata.com
smtpd_recipient_restrictions = permit_mynetworks permit_sasl_authenticated reject_unauth_destination

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.

myhostname = hd.hvalstaddata.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydestination = $myhostname, localhost.$mydomain, $mydomain
mynetworks = 127.0.0.0/8
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
virtual_alias_maps = hash:/etc/postfix/virtual
myorigin = hd.hvalstaddata.com
relayhost = mail.broadpark.no

broken_sasl_auth_clients = yes

TB0ne 09-16-2008 10:32 AM

Quote:

Originally Posted by halvorls (Post 3282079)
Hi!

I have make a main .cf file to postfix, what hvae i do wrong?

Here is the config file:

Don't know what you've done wrong...since you actually haven't said what isn't working, what errors you're getting, and what version/distro of Linux you're using, or anything about your environment.

halvorls 09-16-2008 11:21 AM

The problem is:

- I can not send mail to an emailadress outside domain.

- When i try to send a mail to a mailadress outside domain, i get a error "Relay access denied".


What is wrong in my main.cf file?

main.cf file:


# See /usr/share/postfix/main.cf.dist for a commented, more complete version


# Debian specific: Specifying a file name will cause the first
# line of that file to be used as the name. The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname

smtpd_banner = $myhostname ESMTP $mail_name
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

myhostname = hd.hvalstaddata.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
mydestination = $myhostname, localhost.$mydomain, $mydomain
mynetworks = 127.0.0.0/8
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
virtual_alias_maps = hash:/etc/postfix/virtual
myorigin = $mydomain
relayhost = smtp.broadpark.no

TB0ne 09-16-2008 11:32 AM

Quote:

Originally Posted by halvorls (Post 3282124)
The problem is:

- I can not send mail to an emailadress outside domain.

- When i try to send a mail to a mailadress outside domain, i get a error "Relay access denied".


What is wrong in my main.cf file?

main.cf file:

relayhost = smtp.broadpark.no

The relay host at smtp.broadpark.no has to be set up to ALLOW you to send mail through them. If it's not, it won't work.

If this is your ISP (again, you don't say anything about your environment or give details), they may require authentication. That will also have to be put in (follow the directions for Postfix configuration for that).

halvorls 09-24-2008 06:16 PM

Hi!

But whay i get the error acsess denied?

billymayday 09-24-2008 07:38 PM

Post the exact error messages from the log please, and when posting config info for postfix, always post the output of "postconf -n"

Do you get relay access denied when you send from the server or from a machine connected to the server? If the problem is from a machine connected to the server, you will either need to add that network subnet to the mynetworks parameter or set up authentication for clients of different subnets (only clients on mynetworks can relay by default, and you have this set to localhost).

If the problem is the relayhost as suggested above, add

Code:

debug_peer_level = 2
debug_peer_list = smtp.broadpark.no

to main.cf and restart postfix. That problem is most likely authentication at the relay, and we can talk you through that pretty easily.

halvorls 09-25-2008 07:34 AM

The problem is from the server and from the client conected to server!

linuxgurusa 09-25-2008 08:17 AM

Sometimes one need a CIA degree in decyphering some posts ;-)

In your main.cf file, where you have the following line :

mynetworks = 127.0.0.0/8

YOu need to add your lan range that needs to send mail via this server

mynetworks = 127.0.0.0/8,192.168.0.0/24 for example

billymayday 09-25-2008 04:03 PM

More like the whole CIA


All times are GMT -5. The time now is 04:10 AM.