LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
LinkBack Search this Thread
Old 05-24-2009, 03:52 PM   #1
ivanatora
Member
 
Registered: Sep 2003
Location: Bulgaria
Distribution: Ubuntu 9.10, FreeBSD 7.2
Posts: 459

Rep: Reputation: 31
Postfix sends mail with wrong origin domain


Hello,
The hostname of my PC is dev.ivanatora.info. It has an A record in the DNS zone for ivanatora.info. I have a Postfix installation running here. I'm sending mail to outside, but the From: field is user@ivanatora.info instead of user@dev.ivanatora.info. Here is part of main.cf:
Code:
queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
mail_owner = postfix
inet_interfaces = all
mydestination = $myhostname, localhost.$mydomain, localhost
I have not specified myhostname or myorigin, hope the default values are fine, but maybe they are not.
Anyway I set these:
Code:
myhostname = dev.ivanatora.info
mydomain = ivanatora.info
Any ideas what is misconfigured here?
 
Old 05-24-2009, 08:23 PM   #2
irishbitte
Senior Member
 
Registered: Oct 2007
Location: Brighton, UK
Distribution: Ubuntu Hardy, Ubuntu Jaunty, Eeebuntu, Debian, SME-Server
Posts: 1,213
Blog Entries: 1

Rep: Reputation: 82
change the mydomain entry from this:
Code:
mydomain = ivanatora.info
to this:
Code:
mydomain = dev.ivanatora.info
The reason is most people want their mail to come from the domain rather than the host, and postfix (and you) default to writing in the domain rather than the host.
 
Old 05-24-2009, 08:39 PM   #3
billymayday
Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 120Reputation: 120
You may want to be careful changing mydomain, since it can feed through to other parameters in your postfix config.

The other way to d othis would be to use simple address re-writing. You can use "generic" remapping for this. See http://www.postfix.org/ADDRESS_REWRI...E.html#generic
 
Old 05-25-2009, 03:30 AM   #4
ivanatora
Member
 
Registered: Sep 2003
Location: Bulgaria
Distribution: Ubuntu 9.10, FreeBSD 7.2
Posts: 459

Original Poster
Rep: Reputation: 31
irishbitte, that doesn't seem to work. Mail is still sent with user@ivanatora.info.
Another strange issue is this. I'm trying to send mail to Exim system. The Exim is configured with "verify callout" - it tries to call back the sender to see if local user exist at my side. Using pine and user root I'm able to send mail (there is another mail server at ivanatora.info, so the verification callout passes). But using sendmail from the command line fails. The message is delivered, but the verification callback does not pass. I'm running pine with default settings. Any idea why the sendmail binary won't work? Here is example session from maillog:
Code:
May 25 11:26:44 localhost postfix/pickup[15946]: C89B61C739A: uid=0 from=<root>
May 25 11:26:44 localhost postfix/cleanup[16189]: C89B61C739A: message-id=<20090525082644.C89B61C739A@dev.ivanatora.info>
May 25 11:26:44 localhost postfix/qmgr[15945]: C89B61C739A: from=<root@dev.ivanatora.info>, size=291, nrcpt=1 (queue active)
May 25 11:26:45 localhost postfix/smtpd[16186]: connect from zen.r1servers.com[82.119.92.2]
May 25 11:26:45 localhost postfix/smtpd[16186]: warning: lookup root@dev.ivanatora.info, NIS domain ivanatora.info, map mail.aliases: internal yp server or client error
May 25 11:26:45 localhost postfix/smtpd[16186]: NOQUEUE: reject: RCPT from zen.r1servers.com[82.119.92.2]: 451 4.3.0 <root@dev.ivanatora.info>: Temporary lookup failure; from=<> to=<root@dev.ivanatora.info> proto=SMTP helo=<zen.r1servers.com>
May 25 11:26:45 localhost postfix/cleanup[16189]: 8E2011C7397: message-id=<20090525082645.8E2011C7397@dev.ivanatora.info>
May 25 11:26:45 localhost postfix/smtpd[16186]: disconnect from zen.r1servers.com[82.119.92.2]
May 25 11:26:45 localhost postfix/qmgr[15945]: 8E2011C7397: from=<double-bounce@dev.ivanatora.info>, size=766, nrcpt=1 (queue active)
May 25 11:26:45 localhost postfix/local[16182]: warning: lookup postmaster, NIS domain ivanatora.info, map mail.aliases: internal yp server or client error
May 25 11:26:45 localhost postfix/local[16182]: 8E2011C7397: to=<postmaster@dev.ivanatora.info>, orig_to=<postmaster>, relay=local, delay=0.01, delays=0.01/0/0/0.01, dsn=4.3.0, status=deferred (alias database unavailable)
May 25 11:26:45 localhost postfix/smtp[16183]: C89B61C739A: to=<ivan@aiperfekt.com>, relay=aiperfekt.com[82.119.92.2]:25, delay=2.7, delays=2/0/0.21/0.58, dsn=4.0.0, status=deferred (host aiperfekt.com[82.119.92.2] said: 451 Could not complete sender verify callout (in reply to RCPT TO command))

Last edited by ivanatora; 05-25-2009 at 03:39 AM.
 
Old 05-25-2009, 03:55 AM   #5
ivanatora
Member
 
Registered: Sep 2003
Location: Bulgaria
Distribution: Ubuntu 9.10, FreeBSD 7.2
Posts: 459

Original Poster
Rep: Reputation: 31
Sorry for double posting.
I've just checked with Wireshark (great debugging tool!) and I see pine sends the followin command:
Code:
MAIL FROM: <root@ivanatora.info>
While sending from commandline:
Code:
# sendmail ivan@test-server.com                                                       
wire
.
Gives the following command:
Code:
MAIL FROM <root@dev.ivanatora.inf>
Ooohh, dumb me. I had user-domain=ivanatora.info in ~/.pinerc
So Postfix does really sends fine from @dev.ivanatora.info but the remote host have problems with "Temporary lookup failure". I will check the state of the MX records, becouse I have played a little with these and maybe I should wait DNS refreshing.




EDIT
Problem solved.
Added these lines to main.cf:
Code:
alias_database = hash:/etc/aliases
alias_maps = $alias_database
No more lookup errors. I think that disabled NIS (which I don't run anyway). No more "alias database unavailable" errors. Mail transmits fine.

Last edited by ivanatora; 05-25-2009 at 04:39 AM.
 
Old 05-25-2009, 05:12 AM   #6
irishbitte
Senior Member
 
Registered: Oct 2007
Location: Brighton, UK
Distribution: Ubuntu Hardy, Ubuntu Jaunty, Eeebuntu, Debian, SME-Server
Posts: 1,213
Blog Entries: 1

Rep: Reputation: 82
Yup, these things sometimes are as small as that. Check billymaydays post regarding the MYDOMAIN setting will you?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sendmail - wrong mail sender domain display jika Linux - Newbie 1 05-27-2005 02:29 AM
qmail generating mail that sends to the wrong domain? shadoxity Linux - Software 5 04-16-2005 12:56 AM
postfix sends mail t X but not to Y? tethysgods Linux - Networking 4 09-09-2004 12:12 PM
Domain Routing to Postfix from Sendmail = Wrong IP information in Mail Logs! dholingw Linux - Networking 2 05-20-2004 10:06 AM
Changing domain sendmail sends mail with greenhornet Linux - Networking 5 09-09-2002 01:42 AM


All times are GMT -5. The time now is 07:57 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration