LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 03-09-2011, 02:36 PM   #1
allanwiese
LQ Newbie
 
Registered: Jul 2009
Distribution: Debian
Posts: 14

Rep: Reputation: 1
Postfix and fetchmail problem: sending mail as localhost instead the right domain


Hello everyone!

I'm configuring a MTA using Postfix.
I have started configuring my internal domain and everything has worked well. Then I have configured my server to forward messages to an external domain (using relayhost, sender_canonical_maps and recipient_canonical_maps directives). Sending e-mails was OK. But, when I tried to configure the Fetchmail to fetch the messages in the external server, my problems have started.

What happend is the following: the fetchmail was getting the messages in the external server, but was not delivering them to the mailboxes. The messages was standing in the users' /var/spool/mail files. Looking after the mail.log file I've noticed that there was a problem with message size. And it looked also trying to receive the messages through localhost domain instead of my configured domain.

Here are my configuration files:

/etc/postfix/main.cf:
Code:
#Please change this to your domain

smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no
append_dot_mydomain = no

myhostname = jazz.cyber.local
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
#mydestination = $myhostname, localhost
mydestination = $myhostname
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
recipient_delimiter = +
inet_interfaces = all

message_size_limit = 20000000
mailbox_size_limit = 200000000

#Configurações de encaminhamento
relayhost = ASPMX5.GOOGLEMAIL.COM
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
sender_canonical_maps = hash:/etc/postfix/sender_canonical
recipient_canonical_maps = hash:/etc/postfix/recipient_canonical

#smtp_use_tls = yes
#smtp_tls_CAfile = /etc/postfix/cert.pem
#smtp_tls_session_cache_database = btree:/var/run/smtp_tls_session_cache

# Zarafa configuration
zarafadomain = cyber.local
virtual_transport = lmtp:127.0.0.1:2003
virtual_mailbox_domains = $zarafadomain
virtual_mailbox_maps = mysql:/etc/postfix/mysql-aliases.cf
virtual_alias_maps = hash:/etc/postfix/virtual

smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
sender_canonical:
Code:
allanw@cyber.local   allanw@cybernetbr.com
recipient_canonical:
Code:
allanw@cybernetbr.com   allanw@cyber.local
/etc/fetchmailrc:
Code:
poll imap.gmail.com proto imap
user "allanw@cybernetbr.com" with pass "mypassword" is "allanw" here
/var/log/mail.log:
Code:
Mar  9 15:17:32 jazz postfix/qmgr[5836]: 55293E015C: from=<maiconsbs@gmail.com>, size=312704, nrcpt=1 (queue active)
Mar  9 15:17:33 jazz postfix/smtpd[5894]: 0CD09E00E4: client=localhost[127.0.0.1]
Mar  9 15:17:35 jazz postfix/cleanup[5897]: 0CD09E00E4: message-id=<AANLkTinS8tqRNuT-wrstDEErRyF4jOjayAzvKJoeivXr@mail.gmail.com>
Mar  9 15:17:36 jazz postfix/smtp[5924]: 55293E015C: to=<allanw@localhost>, relay=ASPMX5.GOOGLEMAIL.COM[74.125.157.27]:25, delay=7.7, delays=3.7/0/0.59/3.4, dsn=5.1.1, status=bounced (host ASPMX5.GOOGLEMAIL.COM[74.125.157.27] said: 550-5.1.1 The email account that you tried to reach does not exist. Please try 550-5.1.1 double-checking the recipient's email address for typos or 550-5.1.1 unnecessary spaces. Learn more at                              550 5.1.1 http://mail.google.com/support/bin/answer.py?answer=6596 x21si5214543yhc.201 (in reply to RCPT TO command))
Mar  9 15:17:36 jazz postfix/qmgr[5836]: D2740E0161: removed
Mar  9 15:17:36 jazz postfix/cleanup[5930]: 53C09E0160: message-id=<20110309181736.53C09E0160@jazz.cyber.local>
Mar  9 15:17:36 jazz postfix/bounce[5929]: 55293E015C: sender non-delivery notification: 53C09E0160
Mar  9 15:17:36 jazz postfix/qmgr[5836]: 53C09E0160: from=<>, size=4949, nrcpt=1 (queue active)
Mar  9 15:17:36 jazz postfix/qmgr[5836]: 55293E015C: removed
Does anyone have an idea about what is happening to my MTA server working with Fetchmail?
I would really apreciate any help.

Best regards.
 
Old 03-10-2011, 07:19 AM   #2
allanwiese
LQ Newbie
 
Registered: Jul 2009
Distribution: Debian
Posts: 14

Original Poster
Rep: Reputation: 1
Good morning everybody!

I've solved my problem.

The solution is quite simple:
You just have to change the myorigin directive in the /etc/postfix/main.cf file, putting the following:
Code:
myorigin = $myhostname
I hope it can help somebody in the future.
 
1 members found this post helpful.
  


Reply

Tags
fetchmail, mta, postfix


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
problem with sending mail in postfix sohailkmu Linux - Server 4 03-04-2011 05:55 AM
Postfix Problem Sending SMTP Mail j.smith1981 Linux - Server 2 10-27-2010 09:51 PM
Fetchmail attempts to deliver to non-existent users with localhost as domain Tim Johnson Linux - Networking 5 02-28-2010 10:10 AM
Fetchmail/Postfix domain problem EldinTux SUSE / openSUSE 0 01-09-2005 05:47 AM
postfix : sending local mail without domain iainr Linux - Software 2 12-10-2003 03:05 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

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

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration