i've followed this tutorial in order to get a postfix mail server with virtual domains running:

http://flurdy.com/docs/postfix/ 

Right now i still have not implemented the wole tutorial but i have stopped after here:

http://flurdy.com/docs/postfix/#config-simple-imap 

Right now i would like to be able to send emails, which i'm able to do, and also recieve emails from the world. Right now when i send an email from me@gmail.com i get it rejected by postfix:

Sep 16 09:24:04 myhost postfix/smtpd[25086]: connect from mail-vw0-f44.google.com[209.85.212.44]
Sep 16 09:24:04 myhost postfix/smtpd[25086]: NOQUEUE: reject: RCPT from mail-vw0-f44.google.com[209.85.212.44]: 554 5.7.1 <root@mydomain.com>: Relay access denied; from=<me@gmail.com> to=<root@mydomain.com> proto=ESMTP helo=<mail-vw0-f44.google.com>
Sep 16 09:24:05 myhost postfix/smtpd[25086]: disconnect from mail-vw0-f44.google.com[209.85.212.44]

I must say i'm able to telnet mydomain.com 25 even from outside and from the localhost without problems.

If i send a mail from localhost by running echo .This will go into the body of the mail.. | mail -s -v .Hello root@mydomain.com i'm getting the following error where x.y.w.z simbolizes my public ip address` so there's no mail to check for root user:

Sep 16 09:28:55 myhost postfix/cleanup[25097]: 92E4124E11: message-id=<20110916092855.92E4124E11@mail.mydomain.com>
Sep 16 09:28:55 myhost postfix/qmgr[17100]: 92E4124E11: from=<>, size=2566, nrcpt=1 (queue active)
Sep 16 09:28:55 myhost postfix/bounce[25106]: 5E25724E10: sender non-delivery notification: 92E4124E11
Sep 16 09:28:55 myhost postfix/qmgr[17100]: 5E25724E10: removed
Sep 16 09:28:55 myhost postfix/smtpd[25104]: connect from mydomain.com[x.y.w.z]
Sep 16 09:28:55 myhost postfix/smtp[25103]: warning: host mail.mydomain.com[x.y.w.z]:25 greeted me with my own hostname mail.mydomain.com
Sep 16 09:28:55 myhost postfix/smtp[25103]: warning: host mail.mydomain.com[x.y.w.z]:25 replied to HELO/EHLO with my own hostname mail.mydomain.com
Sep 16 09:28:55 myhost postfix/smtp[25103]: 92E4124E11: to=<ec2-user@mydomain.com>, relay=mail.mydomain.com[x.y.w.z]:25, delay=0.01, delays=0.01/0/0/0, dsn=5.4.6, status=bounced (mail for mydomain.com loops back to myself)
Sep 16 09:28:55 myhost postfix/smtpd[25104]: disconnect from mydomanin.com[x.y.w.z]
Sep 16 09:28:55 myhost postfix/qmgr[17100]: 92E4124E11: removed

Here goes a part of /etc/sysconfig/network i think the problem could be mynetworks_style value??:

myhostname = mail.mydomain.com
mydomain = mydomain.com
myorigin = mydomain.com

relayhost =
inet_interfaces = all
mynetworks_style = host

cat /etc/mailname

mail.pauperis.com

Here is my /etc/hosts file, the real hostname is myhost.mydomain.com but as GoDaddy zone file has an mx entry called mail.mydomain.com which points x.y.w.z as well as mydomain.com does, i added the mail.mydomain.com alias also here because in postfix configuration file i use the name mail.mydomain.com while apache uses mydomain.com

cat /etc/hosts:

127.0.0.1       myhost.mydomain.com localhost localhost.localdomain mail.mydomain.com
#public ip address
x.y.w.z    mydomain.com www.mydomain.com mail.mydomain.com
#private ip address
a.b.c.d  myhost.mydomain.com mail.mydomain.com www.mydomain.com mydomain.com

Thanks in advanced :)

link|improve this question
what is mydestination set to in main.cf? – Mike Sep 16 '11 at 12:48
feedback

migrated from stackoverflow.com Sep 16 '11 at 10:16

This question came from our site for professional and enthusiast programmers.

1 Answer

up vote 0 down vote accepted

in your main.cf

mydestination

needs to be set to include your domain name also

link|improve this answer
Hi, thanks a lot for the answer. In order to make use of virtual domains the tutorial says mydestination to be like this: local_recipient_maps = <nothing here> mydestination = <nothing here> Just for testing, if i wanted to avoid using virtual domains and be able to get emails, should this work? mydestination = $myhostname localhost.$mydomain localhost $mydomain gonna try it when i get home – user846226 Sep 16 '11 at 13:21
That should fix it – Mike Sep 16 '11 at 14:22
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.