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 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


All times are GMT -5. The time now is 03:44 PM.