PDA

View Full Version : email hostname problems


sushestvo
19th May 2006, 17:11
Hi everyone,
I have a server with ISPCOnfig 2.2.1
Everytime I sent an email I always have one problem.
Let's say I send it from soimeuser@firstdomainihave.com
When someone will receive it - FROM tag is fine, but if they open Mail Headers my server always puts a random relay where it was sent from with another domain I have on my server.
TO clarify,
WARNING: One or more of your mailservers is claiming to be a host other than what it really is (the SMTP greeting should be a 3-digit code, followed by a space or a dash, then the host name). If your mailserver sends out E-mail using this domain in its EHLO or HELO, your E-mail might get blocked by anti-spam software. This is also a technical violation of RFC821 4.3 (and RFC2821 4.3.1). Note that the hostname given in the SMTP greeting should have an A record pointing back to the same server. Note that this one test may use a cached DNS record.

mail.myfirstdomain.com claims to be host myotherdomain.net
Even though sometimes it will put correct domain there (postfix) - it's kinda random.
How can I fix this?

till
20th May 2006, 12:31
Do you have an A-Record for mail.myfirstdomain.com pointing to your server IP?
How many IP's do you have?

sushestvo
23rd May 2006, 23:59
Do you have an A-Record for mail.myfirstdomain.com pointing to your server IP?
How many IP's do you have?
I do have an A record.
I have 2 IPs... well actually 3 - but ISPConfig doesn't know about third one as it's not used for Apache at all. It's for nginx, totally insolated from ISPConfig.

till
24th May 2006, 08:37
Sending of mail is not related to apache or ISPConfig itself, it is managed by postfix. Postfix automatically uses the las IP address added to your system to send email. Postfix knows all your IP addresses, even the addresses not configured in ISPConfig.

You can bind postfix to a specific IP for sending mails with this configuration directive in main.cf:

smtp_bind_address = 192.168.0.1

sushestvo
24th May 2006, 15:51
Sending of mail is not related to apache or ISPConfig itself, it is managed by postfix. Postfix automatically uses the las IP address added to your system to send email. Postfix knows all your IP addresses, even the addresses not configured in ISPConfig.

You can bind postfix to a specific IP for sending mails with this configuration directive in main.cf:

smtp_bind_address = 192.168.0.1
The IP address is always the same. The one mail is coming out of.
But it associates different domain name with every single time. And it does not pick up latest domain name that was added, nor latest IP that was added - it never used it - as I said, postfix doesn't know about it as it's not even in ifconfig.
I'm not really sure what's going on with this. But it's weird :$

falko
24th May 2006, 19:17
What's in /etc/postfix/main.cf (please strip out the comments)?
What's the output of hostname -f?

sushestvo
25th May 2006, 15:48
main.cf
queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
mail_owner = postfix
inet_interfaces = all
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.1.5/samples
readme_directory = /usr/share/doc/postfix-2.1.5/README_FILES
smtpd_sasl_local_domain =
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject _unauth_destination
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

virtual_maps = hash:/etc/postfix/virtusertable

mydestination = /etc/postfix/local-host-names
the rest is commented out.

hostname -f: discovery.lockdns.com

falko
25th May 2006, 16:07
You don't have myhostname and mydomain in main.cf.
What's the output of telnet localhost 25?

sushestvo
26th May 2006, 16:37
well, if I specify myhostname and mydomain it will always be the same for all different domains email is sent out from, right? I need it to be dynamic.
If one user sends an email out from @domain1.com and other @domain2.com - they gotta be different.
What do I make myhostname and mydomain to be in this case? And why ISPConfig didn't take care of that? I'm sure no one else experience my problem.
# telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
220 cso.microezza.com ESMTP Postfix
quit
221 Bye
Connection closed by foreign host.

falko
26th May 2006, 17:31
You and your users must set the sender address in your/their email clients. It has nothing to do with the server.