LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   postfix (cant send or receive mail) (https://www.linuxquestions.org/questions/linux-server-73/postfix-cant-send-or-receive-mail-658993/)

madfed 07-29-2008 07:43 AM

postfix (cant send or receive mail)
 
Hi everyone,
Im in a bit of a dilema, i set up a mail server with postfix, dovecot and squirrelmail on SUSE 11 system, all the configs look correct but it has failed to sent nor receive mail, the most confusing thing abt it is when i send mail to a different domain it does reach the person, but then i cant send mail to the local accounts on the mail system itself.
According to the log, i ges there is something wrong somewhere but i cant figure out what;
Code:

mail1:/srv/www/htdocs/squirrelmail/config # tail -f /var/log/mail
Jul 29 13:49:42 mail1 postfix/smtp[5540]: C9C3FFC057: conversation with c.mx.mail.yahoo.com[216.39.53.3] timed out while receiving the initial server greeting
Jul 29 13:49:44 mail1 postfix/smtp[5540]: C9C3FFC057: host d.mx.mail.yahoo.com[66.196.82.7] refused to talk to me: 421 Message from (217.113.73.135) temporarily deferred - 4.16.50. Please refer to http://help.yahoo.com/help/us/mail/defer/defer-06.html
Jul 29 13:49:56 mail1 postfix/smtp[5540]: C9C3FFC057: to=<rauldrid@yahoo.com>, relay=g.mx.mail.yahoo.com[209.191.88.239]:25, delay=317, delays=0.12/1/314/1.8, dsn=2.0.0, status=sent (250 ok dirdel)
Jul 29 13:49:56 mail1 postfix/qmgr[4298]: C9C3FFC057: removed
Jul 29 13:54:07 mail1 dovecot: imap-login: Login: user=<nelly>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, secured
Jul 29 13:54:07 mail1 dovecot: IMAP(nelly): Disconnected: Logged out
Jul 29 13:56:53 mail1 dovecot: imap-login: Login: user=<nelly>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, secured
Jul 29 13:56:53 mail1 dovecot: IMAP(nelly): Disconnected: Logged out
Jul 29 14:04:07 mail1 dovecot: imap-login: Login: user=<nelly>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, secured
Jul 29 14:04:07 mail1 dovecot: IMAP(nelly

U realize that it managed to deliver mail to a yahoo account, but then the local mails arent delivered to the users inbox.
Can anyone help?

trickykid 07-29-2008 09:28 AM

Yahoo is pretty straight forward in their denying of messages. You'll notice this link provided to why the message was deferred or denied: http://help.yahoo.com/help/us/mail/defer/defer-06.html

From the site:

Quote:

1. the message you attempted to send exhibited characteristics indicative of spam,and/or
2. emails from your network have been generating complaints from Yahoo! Mail users.
So are you sending from a mail server with static IP and proper MX records? Or is this some DHCP connection home server you setup? If it's a DHCP, Yahoo is gonna reject them all day long. Yahoo also likes Domain Keys or they'll end up in the users Spam box most of the time.

madfed 07-29-2008 11:22 PM

postfix (cant send or receive mail)
 
Hi,
i dont have a registered domain but atleast it should allow exchange of mails between the local users on the LAN, shouldn't it? coz the users on the LAN can access the mail server through web (squirrelmail) and they can also compose mails and send, trouble is the mails arent sent to the local accounts on the Server, and thats why im confused, since it cant send mail to external domains like yahoo and G-Mail.
Could anyone tell why this is happening?

Mr. C. 07-29-2008 11:32 PM

I'm more than a little puzzled by what you trying to say. These are the various (some conflicting) statements I'm reading:

1) Users cannot send or receive any mail
2) Users can send mail (to a different person?)
3) Users cannot send to local users
4) Local users can send
5) Users cannot send to remote domains

So let's step back. First, show output from postconf -n.
Second, show the error message from the maillog you see from a message that is failing (that you believe should work).

madfed 07-31-2008 02:49 AM

Quote:

Originally Posted by Mr. C. (Post 3230514)
I'm more than a little puzzled by what you trying to say. These are the various (some conflicting) statements I'm reading:

1) Users cannot send or receive any mail
2) Users can send mail (to a different person?)
3) Users cannot send to local users
4) Local users can send
5) Users cannot send to remote domains

So let's step back. First, show output from postconf -n.
Second, show the error message from the maillog you see from a message that is failing (that you believe should work).


Hi,thanx for your reply,
here is the output from postconf -n

Code:

mail1:~ # postconf -n
alias_maps = hash:/etc/aliases
biff = no
broken_sasl_auth_clients = yes
canonical_maps = hash:/etc/postfix/canonical
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/lib/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
defer_transports =
disable_dns_lookups = no
disable_mime_output_conversion = no
home_mailbox = Maildir/
html_directory = /usr/share/doc/packages/postfix/html
inet_interfaces = all
inet_protocols = all
mail_owner = postfix
mail_spool_directory = /var/mail
mailbox_command =
mailbox_size_limit = 0
mailbox_transport =
mailq_path = /usr/bin/mailq
manpage_directory = /usr/share/man
masquerade_classes = envelope_sender, header_sender, header_recipient
masquerade_domains =
masquerade_exceptions = root
message_size_limit = 10240000
mydestination = $myhostname, localhost.$mydomain
mydomain = nelly.com
myhostname = nelly.$mydomain
mynetworks = 127.0.0.0/8
mynetworks_style = subnet
newaliases_path = /usr/bin/newaliases
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/packages/postfix/README_FILES
relayhost =
relocated_maps = hash:/etc/postfix/relocated
sample_directory = /usr/share/doc/packages/postfix/samples
sender_canonical_maps = hash:/etc/postfix/sender_canonical
sendmail_path = /usr/sbin/sendmail
setgid_group = maildrop
smtp_sasl_auth_enable = no
smtp_tls_note_starttls_offer = yes
smtp_use_tls = yes
smtpd_client_restrictions =
smtpd_helo_required = no
smtpd_helo_restrictions =
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,check_relay_domains
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = yes
smtpd_sasl_local_domain =
smtpd_sasl_security_options = noanonymous
smtpd_sender_restrictions = hash:/etc/postfix/access
smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem
smtpd_tls_auth_only = no
smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crt
smtpd_tls_key_file = /etc/postfix/ssl/smtpd.key
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
smtpd_use_tls = yes
strict_8bitmime = no
strict_rfc821_envelopes = no
tls_random_source = dev:/dev/urandom
transport_maps = hash:/etc/postfix/transport
unknown_local_recipient_reject_code = 550
virtual_alias_domains = hash:/etc/postfix/virtual
virtual_alias_maps = hash:/etc/postfix/virtual

And also from /var/log/mail

Code:

mail1:~ # tail -f /var/log/mail
Jul 31 10:27:08 mail1 postfix/smtp[3693]: warning: connect to private/tlsmgr: No such file or directory
Jul 31 10:27:08 mail1 postfix/smtp[3693]: warning: problem talking to server private/tlsmgr: No such file or directory
Jul 31 10:27:08 mail1 postfix/smtp[3693]: warning: no entropy for TLS key generation: disabling TLS support
Jul 31 10:27:24 mail1 postfix/smtp[3693]: B2A0DFC057: to=<editorial@nelly.com>, relay=mail.mtgir.com[194.132.118.184]:25, delay=17, delays=0.13/1.1/14/0.86, dsn=5.7.1, status=bounced (host mail.mtgir.com[194.132.118.184] said: 550 5.7.1 <nelly@nelly.com>: Sender address rejected: Please%see%http://spf.pobox.com/why.html?sender=nelly%40nelly.com&ip=217.113.73.135&receiver=mail.mtgir.com : Reason: mechanism (in reply to RCPT TO command))
Jul 31 10:27:24 mail1 postfix/cleanup[3692]: DA835FC05B: message-id=<20080731072724.DA835FC05B@nelly.nelly.com>
Jul 31 10:27:24 mail1 postfix/qmgr[3291]: DA835FC05B: from=<>, size=2936, nrcpt=1 (queue active)
Jul 31 10:27:24 mail1 postfix/bounce[3703]: B2A0DFC057: sender non-delivery notification: DA835FC05B
Jul 31 10:27:24 mail1 postfix/qmgr[3291]: B2A0DFC057: removed
Jul 31 10:27:28 mail1 postfix/smtp[3693]: DA835FC05B: to=<nelly@nelly.com>, relay=mail.mtgir.com[194.132.118.184]:25, delay=3.2, delays=0.08/0/2.4/0.77, dsn=5.1.1, status=bounced (host mail.mtgir.com[194.132.118.184] said: 550 5.1.1 <nelly@nelly.com>: Recipient address rejected: User unknown in virtual mailbox table (in reply to RCPT TO command))
Jul 31 10:27:28 mail1 postfix/qmgr[3291]: DA835FC05B: removed

For Example i have two users (nelly & editorial) on the machine running postfix, but when nelly sends email to editorial, its not delivered to editorials inbox. Like i said this system has no public domain so its more of a LAN thing, but i have a running Mail Server with SUSE 10.2 which has a fully registered Domain and its running very well. when i send a mail from the server im tryin' to set up to the already running server, its deliverd, so are the mails i send to other different accounts like yahoo and so on.

billymayday 07-31-2008 03:02 AM

What is the hostname/homainname of your machine? If it isn't something.nelly.com, there's your problem

Edit - I just had a look on the net, and there is a nelly.com. Now either you need to tell your local system that you want it to use your machine instead of the real nelly.com (you could put an entry in /etc/hosts to do that), or better still, use a name that isn't used elsewhere (you'd still need an entry in hosts).

Can you show us the output of hostname and domainname please

madfed 07-31-2008 03:12 AM

Hi,
in my network configs, the host hostname is 'mail1' and the domain name is 'nelly.com'

billymayday 07-31-2008 03:23 AM

What does

ping nelly.com showW Is it

Quote:

PING nelly.com (194.132.118.108) 56(84) bytes of data.
Or similar? I suspect it is.

If it is, you are going to need to add a line to /etc/hists that looks like


yourIPaddress mail1.nelly.com mail1 nelly.com

So say you IP ia 1.2.3.4, you could just do

echo "1.2.3.4 mail1.nelly.com mail1 nelly.com" > /etc/hosts

billymayday 07-31-2008 03:26 AM

Can you also post the output of

cat /etc/hosts.conf


Should be OK, but worth checking that your hosts file will be read

madfed 07-31-2008 04:47 AM

Hi, just 2 clarify, i dont own nelly.com (194.132.118.108) and i totally have no attachment to that domain, only that my SUSE box onto which im tryin 2 set up postfix has nelly.com as its domain name, but this is not a fully registered domain name. like i said, mine is just a LAN thing.

output for cat /etc/hosts
Quote:

mail1:~ # cat /etc/hosts
#
# hosts This file describes a number of hostname-to-address
# mappings for the TCP/IP subsystem. It is mostly
# used at boot time, when no name servers are running.
# On small systems, this file can be used instead of a
# "named" name server.
# Syntax:
#
# IP-Address Full-Qualified-Hostname Short-Hostname
#

127.0.0.1 localhost

# special IPv6 addresses
::1 localhost ipv6-localhost ipv6-loopback

fe00::0 ipv6-localnet

ff00::0 ipv6-mcastprefix
ff02::1 ipv6-allnodes
ff02::2 ipv6-allrouters
ff02::3 ipv6-allhosts
127.0.0.2 mail1.nelly.com mail1
192.168.43.51 nelly nelly

billymayday 07-31-2008 04:58 AM

Quote:

Originally Posted by madfed (Post 3231869)
Hi, just 2 clarify, i dont own nelly.com (194.132.118.108) and i totally have no attachment to that domain, only that my SUSE box onto which im tryin 2 set up postfix has nelly.com as its domain name, but this is not a fully registered domain name. like i said, mine is just a LAN thing.

output for cat /etc/hosts

I'd guessed you didn't have anything to do with nelly.com (it's nordic by the way).

I don't get your hosts file. Why 192.168.43.51 nelly nelly and why 127.0.0.2 mail1.nelly.com mail1

the 127.0.0.2 may work (I don't know for sure) but wou would need a nelly.com entry there as well (something like 127.0.0.2 mail1.nelly.com mail1 nellycom).


To be honest, I'd change

127.0.0.1 localhost

to

127.0.0.1 localhost nelly.com mail1.nelly.com mail1

madfed 07-31-2008 05:50 AM

i ges i kinna messed up the whole server n like u see in the /etc/hosts file, it doesnt really depict the changes i made over 4 days ago, coz my ip is 192.168.43.52 not .51, that was the old one which i changed, but still shows in the /etc/hosts file,
Also i think my dovecot crushed coz i checked and realised it wasnt running, when i start it it brings a long string of weired errors;
So i decided 2 install everything from scratch, so m currently installing SUSE 11.
Will let you knw guys. i need your help real bad.
Thnx Guys.

Mr. C. 07-31-2008 11:21 AM

Don't usurp an existing domain name. This leads to all sorts of trouble.

If you don't own a domain name, and this is LAN-only, use something like x.local (eg. neli.local).

When you settle down your changes, and are ready to begin again, we'll start afresh.

madfed 08-01-2008 12:57 AM

Hi there,
im up again n i need your help right from the start. i need 2 install Postfix with SMTP-AUTH-TLS, dovecot and i have squirrellmail already installed.
Thnx.

madfed 08-01-2008 01:08 AM

And if anyone has a documentation on this process i will be more than grateful.

Mr. C. 08-01-2008 01:18 AM

I make no recommendations on HowTo's in general, but here's one you can try out::

http://www.howtoforge.com/perfect-server-opensuse11

madfed 08-01-2008 01:27 AM

Thnx Mr.C. I appreciate so much.

madfed 08-01-2008 08:51 AM

Hi all,
i managed to set up the server and all the neccessary services are running. problem is with postfix again, after following the document at i still encountered th e same issues.
First of all i set the hostname of the machine to nelly, and the domain to mail1.local
All these configs are also correctly defined in the /etc/postfix/main.cf.
-The users are able to login thru squirrelmail
-They are able to compose mail, and send to other users configured on the machine, but the mail is not delivered to the recipients inbox, this is the log generated i the process
Quote:

Aug 1 16:28:53 nelly dovecot: IMAP(sam): Disconnected: Logged out
Aug 1 16:29:07 nelly postfix/smtp[3525]: certificate verification failed for mx2.suse.de[195.135.220.15]:25: untrusted issuer /O=Root CA/OU=http://www.cacert.org/CN=CA Cert Signing Authority/emailAddress=support@cacert.org
Aug 1 16:29:09 nelly postfix/smtp[3525]: 69B5B1A3331: to=<editorial@suse.de>, relay=mx2.suse.de[195.135.220.15]:25, delay=17, delays=0.19/0.03/16/0.83, dsn=5.0.0, status=bounced (host mx2.suse.de[195.135.220.15] said: 554 <sam@suse.de>: Sender address rejected: We don't accept our own addresses as sender address on this host! (in reply to RCPT TO command))
Aug 1 16:29:10 nelly postfix/cleanup[3524]: 1A9341A3335: message-id=<20080801132910.1A9341A3335@nelly.mail1.local>
Aug 1 16:29:10 nelly postfix/qmgr[3303]: 1A9341A3335: from=<>, size=2782, nrcpt=1 (queue active)
Aug 1 16:29:10 nelly postfix/bounce[3532]: 69B5B1A3331: sender non-delivery notification: 1A9341A3335
Aug 1 16:29:10 nelly postfix/qmgr[3303]: 69B5B1A3331: removed
Aug 1 16:29:21 nelly postfix/smtp[3525]: certificate verification failed for mx1.suse.de[195.135.220.2]:25: untrusted issuer /O=Root CA/OU=http://www.cacert.org/CN=CA Cert Signing Authority/emailAddress=support@cacert.org
Aug 1 16:29:23 nelly postfix/smtp[3525]: 1A9341A3335: to=<sam@suse.de>, relay=mx1.suse.de[195.135.220.2]:25, delay=14, delays=0.13/0/13/0.75, dsn=5.0.0, status=bounced (host mx1.suse.de[195.135.220.2] said: 550 <sam@suse.de>: Recipient address rejected: User unknown in local recipient table (in reply to RCPT TO command))
Im so confused coz the log shows something like sam@suse.de,just 2 mention, sam is a username i created on the system, but where does the @suse.de domain come from?

Secondly, when sam sends mail to domains like yahoo, G-mail etc, they are delivered only that it shows the mail is from sam@suse.de, im so confused by this suse.de thing, the relay in the log indicates mx1.suse.de, can anyone help me here coz im so lost and confused.

Thnx

Mr. C. 08-01-2008 11:49 AM

Again, post your postconf -n output.

It really, really, really is best to get things working one step at a time (eg. postfix w/o TLS/AUTH, AUTH standalone, and then combine).

madfed 08-02-2008 12:44 AM

Hi
Here is the output from Postconf -n

Code:

nelly:~ # postconf -n
alias_maps = hash:/etc/aliases
biff = no
broken_sasl_auth_clients = yes
canonical_maps = hash:/etc/postfix/canonical
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/lib/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
defer_transports =
disable_dns_lookups = no
disable_mime_output_conversion = no
home_mailbox = Maildir/
html_directory = /usr/share/doc/packages/postfix/html
inet_interfaces = all
inet_protocols = all
mail_owner = postfix
mail_spool_directory = /var/mail
mailbox_command =
mailbox_size_limit = 0
mailbox_transport =
mailq_path = /usr/bin/mailq
manpage_directory = /usr/share/man
masquerade_classes = envelope_sender, header_sender, header_recipient
masquerade_domains =
masquerade_exceptions = root
message_size_limit = 10240000
mydestination = $myhostname, localhost.$mydomain
mydomain = mail1.local
myhostname = nelly.$mydomain
mynetworks = 127.0.0.0/8
mynetworks_style = subnet
newaliases_path = /usr/bin/newaliases
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/packages/postfix/README_FILES
relayhost =
relocated_maps = hash:/etc/postfix/relocated
sample_directory = /usr/share/doc/packages/postfix/samples
sender_canonical_maps = hash:/etc/postfix/sender_canonical
sendmail_path = /usr/sbin/sendmail
setgid_group = maildrop
smtp_sasl_auth_enable = no
smtp_tls_note_starttls_offer = yes
smtp_use_tls = yes
smtpd_client_restrictions =
smtpd_helo_required = no
smtpd_helo_restrictions =
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,check_relay_domains
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = yes
smtpd_sasl_local_domain =
smtpd_sasl_security_options = noanonymous
smtpd_sender_restrictions = hash:/etc/postfix/access
smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem
smtpd_tls_auth_only = no
smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crt
smtpd_tls_key_file = /etc/postfix/ssl/smtpd.key
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
smtpd_use_tls = yes
strict_8bitmime = no
strict_rfc821_envelopes = no
tls_random_source = dev:/dev/urandom
transport_maps = hash:/etc/postfix/transport
unknown_local_recipient_reject_code = 550
virtual_alias_domains = hash:/etc/postfix/virtual
virtual_alias_maps = hash:/etc/postfix/virtual


Mr. C. 08-02-2008 02:42 AM

What version of postfix was installed?

The parameter check_relay_domains at the end of smtpd_recipient_restrictions was deprecated back in 2002-12-02.

This is one of the reasons why I generally do not give pointers to HowTo's - so many are wrong, or dated.

madfed 08-03-2008 11:47 PM

Version of postfix installed:-

Quote:

nelly:~ # rpm -q postfix
postfix-2.5.1-28.1
Do you think its the postfix with the problem or the configs?
Thanx

Mr. C. 08-03-2008 11:53 PM

I'd suggest you start with the default postfix config file, and work from there. If you want to do this, move the existing main.cf file elsewhere, and reinstall postfix to get the standard config (or at least the one that is used with your distro). Then post the output of postconf -n again.

madfed 08-04-2008 07:10 AM

hi there
Quote:

nelly:/ # postconf -n
biff = no
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/lib/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
html_directory = /usr/share/doc/packages/postfix/html
inet_interfaces = all
inet_protocols = all
mail_owner = postfix
mailq_path = /usr/bin/mailq
manpage_directory = /usr/share/man
mydomain = mail1.local
myhostname = nelly.mail1.local
newaliases_path = /usr/bin/newaliases
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/packages/postfix/README_FILES
sample_directory = /usr/share/doc/packages/postfix/samples
sendmail_path = /usr/sbin/sendmail
setgid_group = maildrop
unknown_local_recipient_reject_code = 550
I un-installed the postfix and reinstalled fresh one and changed a few parameters as shown in the output above,

billymayday 08-04-2008 07:17 AM

So what is happening? It it working?

madfed 08-04-2008 09:13 AM

Nope,
same issue, user can login and compose mail but its not delivered to recipients Inbox, and also weired domains showing up the logs.
Quote:

nelly:/ # tail -f /var/log/mail
Aug 4 14:59:28 nelly postfix/qmgr[9028]: 1D5A51A3335: from=<>, size=2754, nrcpt=1 (queue active)
Aug 4 14:59:28 nelly postfix/qmgr[9028]: F0C101A3331: removed
Aug 4 14:59:34 nelly postfix/smtp[9070]: 1D5A51A3335: to=<nelly@suse.de>, relay=mx2.suse.de[195.135.220.15]:25, delay=6.2, delays=0.07/0/5.4/0.73, dsn=5.0.0, status=bounced (host mx2.suse.de[195.135.220.15] said: 550 <nelly@suse.de>: Recipient address rejected: User unknown in local recipient table (in reply to RCPT TO command))
Aug 4 14:59:34 nelly postfix/qmgr[9028]: 1D5A51A3335: removed
Aug 4 14:59:39 nelly dovecot: imap-login: Login: user=<sam>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, secured
Aug 4 14:59:39 nelly dovecot: IMAP(sam): Disconnected: Logged out
Aug 4 14:59:40 nelly dovecot: imap-login: Login: user=<sam>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, secured
Aug 4 14:59:40 nelly dovecot: IMAP(sam): Disconnected: Logged out
Aug 4 14:59:40 nelly dovecot: imap-login: Login: user=<sam>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, secured
Aug 4 14:59:40 nelly dovecot: IMAP(sam): Disconnected: Logged out

I didnt configure my domain as suse.de, but as u see in the log there appears sam@suse.de, nelly@suse.de; as for sam & nelly, they are configured users on the Server but where does the suse.de come in from. actually my configured domain is mail1.local.
Im totally lost!

checkmate3001 08-04-2008 09:31 AM

First setup postfix and then setup dovecot.

Postfix howto:
http://www.postfix.org/docs.html

Dovecot howto:
http://wiki.dovecot.org/FrontPage

Setup the most basic postfix: just local user mail. Then slowly adapt to allow external mail and out-going mail.

Take baby steps. I also would recommend a VERY good book called: The Book of Postfix - State of the art message transport, by Ralf Hildebrandt and Patrick Koetter. ISBN: 978-1-59327-001-8
I'm reading it now. It will tell you everything you need to know about postfix. I haven't read other books on postfix, but this seems to get it all.

billymayday 08-04-2008 03:48 PM

What is the exact command you are using to send mail, or if from a client, what address are you sending to?

What is the content of /etc/hosts?

Do you have a line similar to

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

in main.cf?

Can your try

echo "hello" | mail -s test1 nelly

echo "hello" | mail -s test2 nelly@mail1.local

and

echo "hello" | mail -s test3 nelly@nelly.mail1.local

and show the logs around these

You've got something strange on your system

madfed 08-05-2008 01:17 AM

Hi
Quote:

Can your try

echo "hello" | mail -s test1 nelly

echo "hello" | mail -s test2 nelly@mail1.local

and

echo "hello" | mail -s test3 nelly@nelly.mail1.local
I tried the above n the first command delivers mail to nelly's inbox and it shows that its from root@nelly.mail1.local
Second command has its mail bounced.
Third command also delivers mail to nelly Inbox

Now that means i have to send mail to user@nelly.mail1.local, for mail to be delivered to the users inbox. but then it shows the mail is from user@suse.de, thats kinna weired coz i thought it wud show that its from user@nelly.mail1.local, isn't it? i dont knw where the suse.de is coming from.
For example i login as sam and send mail to editorail@nelly.mail1.local, the mail is delivered but then it shows its from sam@suse.de.

billymayday 08-05-2008 02:07 AM

What is the hostname of your machine (type hostname from command prompt)

Edit - and what's in /etc/hosts?

madfed 08-05-2008 02:22 AM

checkmate3001, thanx so much for the links and postfix guide. Now about the postfix book do u hav a soft copy or printed one?

Mr. C. 08-05-2008 02:24 AM

Postfix adds myorigin (which defaults to myhostname) onto email addresses that are unqualified (eg. nelly gets rewritten as root@nelly.mail1.local). So this matches what you see in test1. And test3 ends up being the same as test1 because of this.

test2 fails, because the domain "mail1.local" does not match myorigin (which above we set is set to the default nelly.mail1.local).

If you want the domain "mail1.local" to be the domain used, set myorigin:

myorigin = $mydomain

Please show exactly the log lines, or mail headers that reference "suse.de".

madfed 08-05-2008 02:25 AM

my hostname is nelly, and my /etc/hosts file looks like this;

Quote:

nelly:/ # cat /etc/hosts
#
# hosts This file describes a number of hostname-to-address
# mappings for the TCP/IP subsystem. It is mostly
# used at boot time, when no name servers are running.
# On small systems, this file can be used instead of a
# "named" name server.
# Syntax:
#
# IP-Address Full-Qualified-Hostname Short-Hostname
#

127.0.0.1 localhost

# special IPv6 addresses
::1 localhost ipv6-localhost ipv6-loopback

fe00::0 ipv6-localnet

ff00::0 ipv6-mcastprefix
ff02::1 ipv6-allnodes
ff02::2 ipv6-allrouters
ff02::3 ipv6-allhosts
127.0.0.2 nelly.mail1.local nelly
192.168.43.6 nelly.mail1.com nelly
Thnx

billymayday 08-05-2008 02:36 AM

You need to add nelly.local in there, so

27.0.0.2 nelly.mail1.local nelly.local nelly
192.168.43.6 nelly.mail1.com nelly.local nelly

madfed 08-05-2008 02:40 AM

Hi, here is a cut out from the log generated when i logged in as nelly and sent mail to editorial@nelly.mail1.local
Quote:

Aug 5 10:27:00 nelly postfix/smtpd[11704]: 5C35E1A3334: client=localhost[127.0.0.1]
Aug 5 10:27:00 nelly postfix/cleanup[11707]: 5C35E1A3334: message-id=<60767.192.168.43.172.1217921220.squirrel@192.168.43.6>
Aug 5 10:27:00 nelly postfix/qmgr[11681]: 5C35E1A3334: from=<nelly@suse.de>, size=717, nrcpt=1 (queue active)
Aug 5 10:27:00 nelly postfix/smtpd[11704]: disconnect from localhost[127.0.0.1]
Aug 5 10:27:00 nelly postfix/local[11741]: warning: dict_nis_init: NIS domain name not set - NIS lookups disabled
Aug 5 10:27:00 nelly dovecot: imap-login: Login: user=<nelly>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, secured
Aug 5 10:27:00 nelly postfix/local[11741]: 5C35E1A3334: to=<editorial@nelly.mail1.local>, relay=local, delay=0.19, delays=0.1/0.01/0/0.08, dsn=2.0.0, status=sent (delivered to mailbox)
Do u notice the 'from' it says nelly@suse.de

Mr. C. 08-05-2008 02:40 AM

Postfix doesn't use the hosts file unless disable_dns_lookups = yes..

billymayday 08-05-2008 02:46 AM

Quote:

Originally Posted by Mr. C. (Post 3237109)
Postfix doesn't use the hosts file unless disable_dns_lookups = yes..

But it can't resolve it to send to it either

Mr. C. 08-05-2008 02:47 AM

How are you sending the mail? What MUA are you using? The from=<nelly@suse.de> is the Envelope Sender. This is set by your MUA when you send the mail to your server.

madfed 08-06-2008 07:34 AM

Hi guys,
I really really appreciate all the efforts you have invested in this and it really means alot to me, i now think i had a problem with the domain and hostname configs, coz right now i can send and receive mail locally, but i guess if i get a fully qualified domain name everything will be fine. i applied for one from my ISP and its in the process.
Anyways thank you very much and im totally grateful.

B.T.W
Can u guys show me how to increase the attachments maximum size? coz right now its at 2MB, i would really like to put at around 15MB,
Also lets say i need to send email to all users on the server without typing all of them one by one, that means i need to create some sort of aliases, how do i go about that? lets say i need it to be like staff@nelly.mail1.local, i need help on this.
Thnx n Rgds.

billymayday 08-06-2008 04:11 PM

There's a parameter for main.cf call message_size_limit. Set this to the number of bytes you'd like to allow.

Quote:

message_size_limit (default: 10240000)

The maximal size in bytes of a message, including envelope information.

Note: be careful when making changes. Excessively small values will result in the loss of non-delivery notifications, when a bounce message size exceeds the local or remote MTA's message size limit.

Mr. C. 08-06-2008 05:31 PM

madfed,

Postfix can use a phony domain name - a real domain name is not even necessary to send mail outbound, but you have to rewrite the envelope sender. This is all documented in the Small Home and Office README on the postfix site (I think I referred you to that site).

Unless you are also able to get a PTR DNS (aka: reverse DNS) name, you will have trouble sending to other MTAs. If you are on a residential or dynamic IP, you will have trouble sending to other MTAs.

Quote:

Originally Posted by billymayday
But it can't resolve it to send to it either

I think you are misunderstanding how this works. Postfix can mail just fine without an entry in /etc/hosts:

Code:

$ cat /etc/hosts
127.0.0.1      localhost
127.0.1.1      lappy

$ postconf mydomain myhostname myorigin mydestination
mydomain = mydomain.local
myhostname = mail.mydomain.local
myorigin = mydomain.local
mydestination = $mydomain, localhost.localdomain, localhost

$ echo Hello | mail -s "A subby" mrc

$ cat /var/log/main.log
Aug  6 15:27:13 lappy postfix/pickup[8465]: D8198C8238: uid=0 from=<root>
Aug  6 15:27:13 lappy postfix/cleanup[8474]: D8198C8238: message-id=<20080806222713.D8198C8238@mail.mydomain.local>
Aug  6 15:27:13 lappy postfix/qmgr[8466]: D8198C8238: from=<root@mydomain.local>, size=310, nrcpt=1 (queue active)
Aug  6 15:27:13 lappy postfix/local[8476]: D8198C8238: to=<mrc@mydomain.local>, orig_to=<mrc>, relay=local, delay=0.06, delays=0.04/0.01/0/0.01, dsn=2.0.0, status=sent (delivered to mailbox)
Aug  6 15:27:13 lappy postfix/qmgr[8466]: D8198C8238: removed


Mr. C. 08-06-2008 05:36 PM

Quote:

Originally Posted by madfed (Post 3238593)
Also lets say i need to send email to all users on the server without typing all of them one by one, that means i need to create some sort of aliases, how do i go about that? lets say i need it to be like staff@nelly.mail1.local, i need help on this.
Thnx n Rgds.

If they are local users, add an alias to the aliases file. To find its location,

$ postconf -d alias_database
alias_database = hash:/etc/aliases

and then add

staff: email1, email2, email3, ...

then run

newaliases

billymayday 08-06-2008 05:37 PM

So are you saying that Postfix doesn't bother resolving hostnames in mydestinations (which would make sense)? Otherwise they need to be resolved somewhere, ang this name won't be in any dns server.

Mr. C. 08-06-2008 05:50 PM

Exactly.

man 5 postconf:
Quote:

mydestination (default: $myhostname, localhost.$mydomain, localhost)
The list of domains that are delivered via the $local_transport mail
delivery transport. By default this is the Postfix local(8) delivery
...
Postfix checks the recipient domain against mydestination; if it matches, its a local delivery, so no need to lookup any hostnames.

billymayday 08-06-2008 06:14 PM

Fair 'nuff, and good to add a little something to the knowledge base

madfed 08-07-2008 03:51 AM

Hi

Quote:

$ postconf -d alias_database
alias_database = hash:/etc/aliases

and then add

staff: email1, email2, email3, ...

then run

newaliases

Thanx so much for yo help guys, it all worked out perfect and i cant thank you enough for all the help you have rendered to me.
i must say i have learnt alot from you guys.
God Bless.


All times are GMT -5. The time now is 11:37 PM.