-   Linux - Server (
-   -   Postfix and fetchmail problem: sending mail as localhost instead the right domain (

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:


#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 = [::ffff:]/104 [::1]/128
recipient_delimiter = +
inet_interfaces = all

message_size_limit = 20000000
mailbox_size_limit = 200000000

#Configurações de encaminhamento
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:
virtual_mailbox_domains = $zarafadomain
virtual_mailbox_maps = mysql:/etc/postfix/
virtual_alias_maps = hash:/etc/postfix/virtual

smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination


Code:  allanw@cyber.local

poll proto imap
user "" with pass "mypassword" is "allanw" here


Mar  9 15:17:32 jazz postfix/qmgr[5836]: 55293E015C: from=<>, size=312704, nrcpt=1 (queue active)
Mar  9 15:17:33 jazz postfix/smtpd[5894]: 0CD09E00E4: client=localhost[]
Mar  9 15:17:35 jazz postfix/cleanup[5897]: 0CD09E00E4: message-id=<>
Mar  9 15:17:36 jazz postfix/smtp[5924]: 55293E015C: to=<allanw@localhost>, relay=ASPMX5.GOOGLEMAIL.COM[]:25, delay=7.7, delays=3.7/0/0.59/3.4, dsn=5.1.1, status=bounced (host ASPMX5.GOOGLEMAIL.COM[] 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 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/ file, putting the following:

myorigin = $myhostname
I hope it can help somebody in the future.

All times are GMT -5. The time now is 10:01 PM.