# A few Postfix config problems causing weirdness.

## Rylan

I followed the Gentoo Desktop Guide and had to do one thing different from what it said: maildirmake ~/.maildir

  My situation is that I'm on a cable modem and only want to send mail out from my box locally to the internet (ie "cat foo.txt | mail my_account@yahoo.com) and from local users to local users (really only rylan and root).  

  Following the guide it says that this should just work out of the box, but when postfix started it complained

Jun  3 04:36:26 roswell postfix/bounce[16774]: warning: My hostname roswell is not a fully qualified name - set myhostname or mydomain in /etc/postfix/main.cf

  So I opened up /etc/postfix/main.cf and uncommented/edited "myhostname = roswell".  restarted postfix and it doesn't complain anymore.  Now "mutt -x rylan" doesn't seem to send myself mail.  I checked /var/log/mail.log and here's what it says

Jun  3 05:08:16 roswell postfix/pickup[16871]: 5C89912D89: uid=1000 from=<rylan>

Jun  3 05:08:16 roswell postfix/cleanup[16877]: 5C89912D89: message-id=<20020603090816.GA16873@roswell>

Jun  3 05:08:16 roswell postfix/qmgr[16872]: 5C89912D89: from=<rylan@roswell.roswell>, size=377, nrcpt=1 (queue active)

Jun  3 05:08:16 roswell postfix/smtp[16879]: 5C89912D89: to=<rylan@roswell.roswell>, relay=none, delay=0, status=bounced (Name service error for roswell.roswell: Host not found)

Jun  3 05:08:16 roswell postfix/cleanup[16877]: 944D912D8D: message-id=<20020603090816.944D912D8D@roswell>

Jun  3 05:08:16 roswell postfix/qmgr[16872]: 944D912D8D: from=<>, size=1922, nrcpt=1 (queue active)

Jun  3 05:08:16 roswell postfix/smtp[16879]: 944D912D8D: to=<rylan@roswell.roswell>, relay=none, delay=0, status=bounced (Name service error for roswell.roswell: Host not found)

  Now I spend the next 7 hours tinkering with myhostname mydomain myorigin and mydestination in /etc/postfix/main.cf   I tried so many different combinations of roswell, localhost, 127.0.0.1 and edited /etc/hosts to try and make it so it would just relay local mail properly without doubling up roswell.roswell or localhost.localhost or localdomain.localdomain.  Unsuccessfully.  

  I've searched numerous howto's, guides, faq's, google, and searched the forums and haven't seen a single problem like this (well one showed up in google in a language I couldn't even place, without the translate option google seems to normally have)  and I'm sure I'm just doing something incredibly boneheaded that will be simple to fix.

Here's "my postconf -n" output

alias_database = hash:/etc/mail/aliases

alias_maps = hash:/etc/mail/aliases

command_directory = /usr/sbin

config_directory = /etc/postfix

daemon_directory = /usr/lib/postfix

debug_peer_level = 2

default_destination_concurrency_limit = 10

home_mailbox = .maildir/

inet_interfaces = localhost

local_destination_concurrency_limit = 2

mail_owner = postfix

mydestination = $myhostname, localhost

myhostname = roswell

queue_directory = /var/spool/postfix

virtual_maps = hash:/etc/postfix/virtual

and my /etc/postfix/virtual 

root            root@localhost

rylan           rylan@localhost

postmaster      postmaster@localhost

  On a side note when I tried to send mail from my user account to my road runner address with "mutt -x user@ec.rr.com" I got this nifty bounce

Jun  3 05:17:25 roswell postfix/pickup[16871]: 431DA12D8C: uid=1000 from=<rylan>

Jun  3 05:17:25 roswell postfix/cleanup[16887]: 431DA12D8C: message-id=<20020603091725.GA16883@roswell>

Jun  3 05:17:25 roswell postfix/qmgr[16872]: 431DA12D8C: from=<rylan@roswell.roswell>, size=373, nrcpt=1 (queue active)

Jun  3 05:17:26 roswell postfix/smtp[16889]: 431DA12D8C: to=<user@ec.rr.com>, relay=ncmx02.mgw.rr.com[24.93.67.222], delay=1, status=bounced (host ncmx02.mgw.rr.com[24.93.67.222] said: 553 5.1.8 <rylan@roswell.roswell>... Domain of sender address rylan@roswell.roswell does not exist)

Jun  3 05:17:26 roswell postfix/cleanup[16887]: 5D48312D8D: message-id=<20020603091726.5D48312D8D@roswell>

Jun  3 05:17:26 roswell postfix/qmgr[16872]: 5D48312D8D: from=<>, size=2099, nrcpt=1 (queue active)

Jun  3 05:17:26 roswell postfix/smtp[16889]: 5D48312D8D: to=<rylan@roswell.roswell>, relay=none, delay=0, status=bounced (Name service error for roswell.roswell: Host not found)

Should I try to find a way so that it will send it from user@ec.rr.com? or is that a dumb idea for some reason that's not obvious to me?

----------

## lx

You should use myhostname=..... in /etc/postfix/main.cf and fill in a valid / world pingable domain name for your computer. The host tries to ping you in order to validate that your a normal smtp server, so it checks if the IP of sending SMTP server equals the domain it pretends to use.

So you should have a DNS name for your computer, btw you can still use a different mail adres inside your message so replied email doesn't need to contain the used <comp>@<domain> used in the sending process.

----------

## eclipsed

I too am confused about setting postfix up.  I'm a dial-up used so I plan to use postfix to send mail when I'm online.  I read a guide about setting postfix up for my situation, but I still am unsure about what to put in the mydomain, myhostname, and myorgin variables.  Also, for the relayhost...if I'm using my computer to send the mail why should I relay it yet again off some other host?  So should I set mydomain, myhostname, and myorgin to something such as 'yahoo.com'?  If I need to put in a relayhost does it have to be *a* smtp server or does it have to be *my* smtp server?  Yet again, should I set the masquerade_domains = yahoo.com?   :Confused:   Help!  TIA.

-Adam

----------

## Rylan

myhostname = world-pingable-domain-name

I understand that roadrunner's stmp server tries to make sure I'm who I tell it I am, and that is why it rejects me.

My problem is that I don't have a domain name.  I'm just a crappy luser that happened to set my /etc/hostname to roswell.  I just want it to work like sendmail did for me in slack 8 and obsd 2.9.  I want to be able to have all my local mail sent to the proper local users, and be able to cat out files my yahoo account.

I appreciate the suggestion, but since I don't have a hostname or dns entry on the ec.rr.com network, I don't think your solution is workable for me.

And I've seriously thought about doing the dyndns stuff just so that I have a valid world pingable hostname.domainname, but I want to figure out why I can't get htis to work.

----------

## Rylan

Well I broke down and got a hostname at dyndns.org.  I really needed to anyway  :Smile: 

I highly recommend it to everyone here, and there's a really good update client in portage (ddclient)!  The dyndns.org site and the ddclient were very easy to setup to a dns newbie, mainly because of all the excellent, relevant documentation.

Here's the postconf -n output for settings that finally worked for me.

alias_database = hash:/etc/mail/aliases

alias_maps = hash:/etc/mail/aliases

command_directory = /usr/sbin

config_directory = /etc/postfix

daemon_directory = /usr/lib/postfix

debug_peer_level = 2

default_destination_concurrency_limit = 10

home_mailbox = .maildir/

inet_interfaces = localhost

local_destination_concurrency_limit = 1

mail_owner = postfix

mydomain = dyndns.org

myhostname = hostname.dyndns.org

myorigin = $myhostname

queue_directory = /var/spool/postfix

----------

