LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (http://www.linuxquestions.org/questions/linux-server-73/)
-   -   Postfix and fetchmail problem: sending mail as localhost instead the right domain (http://www.linuxquestions.org/questions/linux-server-73/postfix-and-fetchmail-problem-sending-mail-as-localhost-instead-the-right-domain-867537/)

allanwiese 03-09-2011 03:36 PM

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.

allanwiese 03-10-2011 08:19 AM

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.


All times are GMT -5. The time now is 06:50 PM.