View previous topic :: View next topic |
Author |
Message |
diebels n00b
Joined: 29 Aug 2003 Posts: 67 Location: Arendal, Norge
|
Posted: Fri May 28, 2004 4:36 pm Post subject: hostname dnsdomainname mailaddress [solved] |
|
|
I'm trying to setup a mailserver on my gateway webserver box.
My domain is "anders.arendal.no"
My /etc/hosts
Code: | 127.0.0.1 localhost
217.8.138.29 gateway.anders.arendal.no gateway
|
Code: | root@gateway etc # hostname
gateway.anders.arendal.no |
Code: | root@gateway etc # dnsdomainname
anders.arendal.no |
I've set up the mx record (at my domain provider) to "anders.arendal.no"
When i send mail (with mutt) it makes my mail address look like username@gateway.anders.arendal.no
Should be username@anders.arendal.no.
Also I've not been able to recieve mail yet.
Any tips for proper /etc/hosts and mx configuration? _________________ --
Anders
http://anders.arendal.no
Last edited by diebels on Mon May 31, 2004 9:24 pm; edited 1 time in total |
|
Back to top |
|
|
kezzla Apprentice
Joined: 21 Aug 2003 Posts: 253 Location: Austin, TX
|
Posted: Fri May 28, 2004 4:46 pm Post subject: |
|
|
Well you have listed TWO mail servers for this domain:
Code: | anders.arendal.no mail exchanger = 20 relay.domeneshop.no.
anders.arendal.no mail exchanger = 10 anders.arendal.no. |
Only one of them answers. (relay.domeneshop.no)
Code: | # telnet 194.63.248.6 25
Trying 194.63.248.6...
Connected to 194.63.248.6.
Escape character is '^]'.
220 highcliff.domeneshop.no ESMTP Sendmail 8.12.11/8.12.11; Fri, 28 May 2004 18:43:15 +0200 |
So you need to fix the other mail server, or get rid of its listing in dns. Also sendmail must know that it is responsible for anders.arendal.no so edit your local-host-names file with this information.
As far as mailing out, you need to set the DM macro for sendmail so it effectively masquerades the domain. (hiding your hostname).
sendmail.cf >>
DManders.arendal.no |
|
Back to top |
|
|
diebels n00b
Joined: 29 Aug 2003 Posts: 67 Location: Arendal, Norge
|
Posted: Fri May 28, 2004 5:31 pm Post subject: |
|
|
relay.domeneshop.no is my dns providers sendmail mailserver. It's meant to be a backup case my own server goes down.
I ('m trying to) use postfix, and evantually squirrelmail over ssl.
The postfix configuration has a problem?
Code: | gateway root # telnet anders.arendal.no 25
Trying 217.8.138.29...
Connected to anders.arendal.no.
Escape character is '^]'.
Connection closed by foreign host. |
Code: | gateway postfix # grep -v ^# main.cf | grep -v '^$'
smtpd_sasl_auth_enable = yes
smtpd_sasl2_auth_enable = yes
smtpd_sasl_security_options = noananymous
broken_sasl_auth_clients = yes
smtpd_sasl_local_domain =
smtpd_recipient_restrictions =
permit_sasl_authenticated,
permit_mynetworks,
reject_unauth_destination
smtpd_use_tls = yes
smtpd_tls_key_file = /etc/postfix/newreq.pem
smtpd_tls_cert_file = /etc/postfix/newcert.pem
smtpd_tls_CAfile = /etc/postfix/cacert.pem
smtpd_tls_loglevel = 3
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom
queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/lib/postfix
mail_owner = postfix
myhostname = gateway.anders.arendal.no
mydomain = anders.arendal.no
inet_interfaces = all
mydestination = $myhostname, localhost.$mydomain $mydomain
unknown_local_recipient_reject_code = 450
mynetworks = 192.168.0.0/24, 127.0.0.0/8
alias_maps = hash:/etc/mail/aliases
alias_database = hash:/etc/mail/aliases
home_mailbox = .maildir/
local_destination_concurrency_limit = 2
default_destination_concurrency_limit = 10
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
newaliases_path = /usr/bin/newaliases
mailq_path = /usr/bin/mailq
setgid_group = postdrop
manpage_directory = /usr/share/man
sample_directory = /usr/share/doc/postfix-2.0.19/sample
readme_directory = /usr/share/doc/postfix-2.0.19/readme
default_destination_concurrency_limit = 2
alias_database = hash:/etc/mail/aliases
local_destination_concurrency_limit = 2
alias_maps = hash:/etc/mail/aliases
home_mailbox = .maildir/ |
_________________ --
Anders
http://anders.arendal.no |
|
Back to top |
|
|
kpack Tux's lil' helper
Joined: 29 Mar 2004 Posts: 137
|
Posted: Fri May 28, 2004 6:31 pm Post subject: |
|
|
In your postfix main.cf set:
myorigin=$mydomain |
|
Back to top |
|
|
kezzla Apprentice
Joined: 21 Aug 2003 Posts: 253 Location: Austin, TX
|
Posted: Sat May 29, 2004 2:25 am Post subject: |
|
|
It looks like you either need to forward a port to your internal mail server, OR postfix is not running.
Code: | $ telnet 217.8.138.29 25
Trying 217.8.138.29...
telnet: Unable to connect to remote host: Connection refused |
Until the outside world can connect to 217.8.138.29, you will not receive mail from the outside world.
Is this server connected directly to the internet ? or behind a firewall ? |
|
Back to top |
|
|
diebels n00b
Joined: 29 Aug 2003 Posts: 67 Location: Arendal, Norge
|
Posted: Mon May 31, 2004 12:15 am Post subject: |
|
|
Back from advanced open water course this weekend.
Used a good guide: https://forums.gentoo.org/viewtopic.php?t=56633
Now postfix replies.
Code: | telnet anders.arendal.no 25
Trying 217.8.138.29...
Connected to anders.arendal.no.
Escape character is '^]'.
220 anders.arendal.no ESMTP Postfix
hello
502 Error: command not implemented
quit
221 Bye
Connection closed by foreign host.
|
Thats from my internal network, so an outside test would be apprisiated.
Squirrelmail also running, and able to send mail. Have not been able to recieve yet.
I'll try to remove the mx record of my dns providers mailserver(takes about two hours?)
Code: | anders.arendal.no mail exchanger = 20 relay.domeneshop.no. |
And see if that helps. Guess there is a proper way to use it, but I'll take care of my own server first. _________________ --
Anders
http://anders.arendal.no |
|
Back to top |
|
|
kezzla Apprentice
Joined: 21 Aug 2003 Posts: 253 Location: Austin, TX
|
Posted: Mon May 31, 2004 3:28 am Post subject: |
|
|
Code: | # nmap -sS 217.8.138.29
Starting nmap 3.50 ( http://www.insecure.org/nmap/ ) at 2004-05-30 22:25 CDT
Interesting ports on cD9088A1D.sdsl.catch.no (217.8.138.29):
(The 1655 ports scanned but not shown below are in state: filtered)
PORT STATE SERVICE
22/tcp open ssh
53/tcp closed domain
80/tcp open http
3306/tcp closed mysql |
Port 25 does not appear to be listening from the external IP address. Do you have a firewall blocking port 25 ? |
|
Back to top |
|
|
diebels n00b
Joined: 29 Aug 2003 Posts: 67 Location: Arendal, Norge
|
Posted: Mon May 31, 2004 1:57 pm Post subject: |
|
|
Of course. Now I've 22/tcp ssh, 25/tcp smtp, 80/tcp http, 81/tcp https should be open.
Still not receiving any mail
Should 993/tcp imaps be open? _________________ --
Anders
http://anders.arendal.no |
|
Back to top |
|
|
nobspangle Veteran
Joined: 23 Mar 2004 Posts: 1318 Location: Manchester, UK
|
Posted: Mon May 31, 2004 2:46 pm Post subject: |
|
|
When I try to send mail to your domain I get a
554: Client host rejected: Access denied
doesn't seem to want to take mail from external IP addresses.
Can you send mail locally? |
|
Back to top |
|
|
diebels n00b
Joined: 29 Aug 2003 Posts: 67 Location: Arendal, Norge
|
Posted: Mon May 31, 2004 2:52 pm Post subject: |
|
|
Postfix? at my server denies access.
Got this error message:
Code: | Return-Path: <>
Delivered-To: diebels@start.no
Received: from mx10.start.no (mx10.start.no [195.159.30.241])
by mx112.start.no (Postfix) with ESMTP id D03EAC47C
for <diebels@start.no>; Mon, 31 May 2004 15:32:55 +0200 (CEST)
Received: from smtp1.powertech.no ([195.159.0.145])
by mx10.start.no with ESMTP id 1086010375BDDCJ;
Mon May 31 2004 13:32:55 0000 +0000 (GMT)
Received: by smtp1.powertech.no (Postfix)
id ACA33818C; Mon, 31 May 2004 15:32:55 +0200 (CEST)
Date: Mon, 31 May 2004 15:32:55 +0200 (CEST)
From: MAILER-DAEMON@smtp1.powertech.no (Mail Delivery System)
Subject: Undelivered Mail Returned to Sender
To: diebels@start.no
MIME-Version: 1.0
Content-Type: multipart/report; report-type=delivery-status;
boundary="362178185.1086010375/smtp1.powertech.no"
Message-Id: <20040531133255.ACA33818C@smtp1.powertech.no>
X-PowerTech-Majones: remulade (0, 0) 1086010375BDDCJ ip=195.159.0.145
This is a MIME-encapsulated message.
--362178185.1086010375/smtp1.powertech.no
Content-Description: Notification
Content-Type: text/plain
This is the Postfix program at host smtp1.powertech.no.
I'm sorry to have to inform you that the message returned
below could not be delivered to one or more destinations.
For further assistance, please send mail to <postmaster>
If you do so, please include this problem report. You can
delete your own text from the message returned below.
The Postfix program
<anders@anders.arendal.no>: host anders.arendal.no[217.8.138.29] said: 554
<smtp1.powertech.no[195.159.0.145]>: Client host rejected: Access denied
--362178185.1086010375/smtp1.powertech.no
Content-Description: Delivery error report
Content-Type: message/delivery-status
Reporting-MTA: dns; smtp1.powertech.no
Arrival-Date: Mon, 31 May 2004 15:32:53 +0200 (CEST)
Final-Recipient: rfc822; anders@anders.arendal.no
Action: failed
Status: 5.0.0
Diagnostic-Code: X-Postfix; host anders.arendal.no[217.8.138.29] said: 554
<smtp1.powertech.no[195.159.0.145]>: Client host rejected: Access denied
--362178185.1086010375/smtp1.powertech.no
Content-Description: Undelivered Message
Content-Type: message/rfc822
Received: from epost.start.no (epost.start.no [195.159.1.214])
by smtp1.powertech.no (Postfix) with ESMTP id 362178185
for <anders@anders.arendal.no>; Mon, 31 May 2004 15:32:53 +0200 (CEST)
Received: (from apache@localhost)
by epost.start.no (8.11.6/8.11.2) id i4VDWh716870
for anders@anders.arendal.no; Mon, 31 May 2004 15:32:43 +0200
To: anders@anders.arendal.no
Subject: =?ISO-8859-1?Q?test_inng=E5ende?=
Message-ID: <1086010363.40bb33fb76cbd@epost.start.no>
Date: Mon, 31 May 2004 15:32:43 +0200 (CEST)
From: =?ISO-8859-1?Q?Anders_=D8sterholt?= <diebels@start.no>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
User-Agent: IMP/PHP IMAP webmail program 2.2.8
|
So that means postfix at 217.8.138.29 does not trust any host?
What about this:
Code: | 217.8.138.29 # grep -v ^# /etc/postfix/main.cf | grep -v ^$
queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/lib/postfix
mail_owner = postfix
myhostname = anders.arendal.no
mydomain = anders.arendal.no
myorigin = $mydomain
inet_interfaces = $myhostname, localhost
mydestination = $myhostname, localhost.$mydomain $mydomain
unknown_local_recipient_reject_code = 450
mynetworks = 192.168.0.0/24, 127.0.0.0/8
mailbox_command = /usr/bin/procmail
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
newaliases_path = /usr/bin/newaliases
mailq_path = /usr/bin/mailq
setgid_group = postdrop
manpage_directory = /usr/share/man
sample_directory = /usr/share/doc/postfix-2.0.19/sample
readme_directory = /usr/share/doc/postfix-2.0.19/readme
default_destination_concurrency_limit = 2
alias_maps = hash:/etc/mail/aliases
home_mailbox = .maildir/
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
smtpd_sasl_local_domain =
broken_sasl_auth_clients = yes
smtpd_client_restrictions = permit_sasl_authenticated, reject
smtpd_use_tls=yes
smtpd_tls_auth_only = yes
smtpd_tls_key_file = /etc/ssl/postfix/server.key
smtpd_tls_cert_file = /etc/ssl/postfix/server.crt
smtpd_tls_CAfile = /etc/ssl/postfix/server.pem
smtpd_tls_loglevel = 3
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom
|
_________________ --
Anders
http://anders.arendal.no |
|
Back to top |
|
|
kezzla Apprentice
Joined: 21 Aug 2003 Posts: 253 Location: Austin, TX
|
Posted: Mon May 31, 2004 3:06 pm Post subject: |
|
|
Yep client host rejected...
Code: | $ telnet 217.8.138.29 25
Trying 217.8.138.29...
Connected to 217.8.138.29.
Escape character is '^]'.
220 anders.arendal.no ESMTP Postfix
helo kesstech.com
250 anders.arendal.no
mail from: josh@kesstech.com
250 Ok
rcpt to: root@anders.arendal.no
554 <user5.net1019.tx.sprint-hsd.net[69.34.184.5]>: Client host rejected: Access denied
|
Perhaps you should try getting rid of all the ssl/tls settings? Just try to get mail "working" first, then proceed to secure it down. |
|
Back to top |
|
|
diebels n00b
Joined: 29 Aug 2003 Posts: 67 Location: Arendal, Norge
|
Posted: Mon May 31, 2004 3:42 pm Post subject: |
|
|
Your connection in /var/log/mail/current:
Code: | May 31 17:02:50 [postfix/smtpd] warning: database /etc/mail/aliases.db is older than source file /etc/mail/aliases
May 31 17:02:50 [postfix/smtpd] starting TLS engine
May 31 17:02:50 [postfix/smtpd] connect from mail.pappworth.com[195.137.106.99]
May 31 17:03:10 [postfix/smtpd] A273485C2B6: client=mail.pappworth.com[195.137.106.99]
May 31 17:03:28 [postfix/smtpd] A273485C2B6: reject: RCPT from mail.pappworth.com[195.137.106.99]: 554 <mail.pappworth.com[195.137.106.99]>: Client host rejected: Access denied; from=<test.pappworth.com> to=<anders@anders.arendal.no> proto=ESMTP helo=<mail.pappworth.
com>
May 31 17:05:10 [postfix/smtpd] disconnect from mail.pappworth.com[195.137.106.99]
|
Local mail works
Code: | May 31 17:11:21 [postfix/pickup] F1CF685C2BA: uid=1000 from=<anders>
May 31 17:11:21 [postfix/cleanup] F1CF685C2BA: message-id=<20040531151121.GA11940@anders.arendal.no>
May 31 17:11:22 [postfix/qmgr] F1CF685C2BA: from=<anders@anders.arendal.no>, size=414, nrcpt=1 (queue active)
May 31 17:11:22 [postfix/local] warning: database /etc/mail/aliases.db is older than source file /etc/mail/aliases
May 31 17:11:22 [postfix/local] F1CF685C2BA: to=<anders@anders.arendal.no>, relay=local, delay=1, status=sent ("|/usr/bin/procmail")
|
Is there a problem with the
Code: | mynetworks = 192.168.0.0/24, 127.0.0.0/8 |
in /etc/postfix/main.cf ?
Or is it something with the ssl/tls settings? _________________ --
Anders
http://anders.arendal.no |
|
Back to top |
|
|
diebels n00b
Joined: 29 Aug 2003 Posts: 67 Location: Arendal, Norge
|
Posted: Mon May 31, 2004 4:27 pm Post subject: |
|
|
You were right kezzla.
Commented out all ssl/tls settings from /etc/postfix/main.cf.
Now mail is working
Code: | telnet anders.arendal.no 25
Trying 217.8.138.29...
Connected to anders.arendal.no.
Escape character is '^]'.
220 anders.arendal.no ESMTP Postfix
mail from: diebels@start.no
250 Ok
rcpt to: anders@anders.arendal.no
250 Ok
quit
221 Bye
Connection closed by foreign host. |
Sent one from webmail at start.no, and recevied it and read it with squirrelmail at anders.arendal.no.
Have to figure out what the problem is with the ssl/tls stuff. _________________ --
Anders
http://anders.arendal.no |
|
Back to top |
|
|
kezzla Apprentice
Joined: 21 Aug 2003 Posts: 253 Location: Austin, TX
|
Posted: Mon May 31, 2004 7:36 pm Post subject: |
|
|
w00t ! hehe
You are on your own getting the ssl/tls stuff working...I could never get it working right ! I gave up. I could get courier-imap-ssl working, but it sux cuz you gotta accept the deezam certificate EVERY F#%!ing time you check your mail
Good luck with the postfix ssl/tls - These forums **will** not fail you |
|
Back to top |
|
|
diebels n00b
Joined: 29 Aug 2003 Posts: 67 Location: Arendal, Norge
|
Posted: Mon May 31, 2004 9:21 pm Post subject: |
|
|
quite happy with the setup now. Not sure what I need the postfix sequrity stuff for. I'm now running squirrelmail trough https, so my I guess my usernames and passwords are encrypted.
Love SquirrelMail, cool themes _________________ --
Anders
http://anders.arendal.no |
|
Back to top |
|
|
|