Virtual postfix sending problem

Discussion in 'HOWTO-Related Questions' started by generalchaos, Jul 10, 2006.

  1. generalchaos

    generalchaos New Member

    It seems like when im sending mail out that it is always going to [email protected]lhost , any ideas why? This is making all of my servers website scripts not be able to mail the users it needs to send mail to.

    even if I just type "echo "test" | mail [email protected]" it sends it to [email protected]lhost
     
  2. falko

    falko Super Moderator ISPConfig Developer

    What's in your mail og when you try to send an email?
    What's in /etc/postfix/main.cf (please strip out the comments)?
    What's in /etc/aliases?
     
  3. generalchaos

    generalchaos New Member

    Not sure what exactly your asking for here.

    main.cf is
    Code:
    virtual_mailbox_domains =/etc/postfix/vhosts.txt
    virtual_mailbox_base = /var/spool/vmail
    virtual_mailbox_maps = hash:/etc/postfix/vmaps.txt
    virtual_uid_maps = static:506
    virtual_gid_maps = static:507
    virtual_alias_maps = hash:/etc/postfix/valias.txt
    queue_directory = /var/spool/postfix
    command_directory = /usr/sbin
    daemon_directory = /usr/libexec/postfix
    mail_owner = postfix
    myhostname = localhost
    mydomain = $myhostname
    myorigin = $myhostname
    inet_interfaces = all
    mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
    unknown_local_recipient_reject_code = 550
    mynetworks_style = host
    relayhost = smtp.comcast.net
    alias_maps = hash:/etc/aliases, nis:mail.aliases
    alias_database = hash:/etc/aliases
    debugger_command =
    	 PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
    	 xxgdb $daemon_directory/$process_name $process_id & sleep 5
    sendmail_path = /usr/sbin/sendmail.postfix
    newaliases_path = /usr/bin/newaliases.postfix
    mailq_path = /usr/bin/mailq.postfix
    setgid_group = postdrop
    html_directory = no
    manpage_directory = /usr/share/man
    Code:
    # General redirections for pseudo accounts.
    bin:		root
    daemon:		root
    adm:		root
    lp:		root
    sync:		root
    shutdown:	root
    halt:		root
    mail:		root
    news:		root
    uucp:		root
    operator:	root
    games:		root
    gopher:		root
    ftp:		root
    nobody:		root
    radiusd:	root
    nut:		root
    dbus:		root
    vcsa:		root
    canna:		root
    wnn:		root
    rpm:		root
    nscd:		root
    pcap:		root
    apache:		root
    webalizer:	root
    dovecot:	root
    fax:		root
    quagga:		root
    radvd:		root
    pvm:		root
    amanda:		root
    privoxy:	root
    ident:		root
    named:		root
    xfs:		root
    gdm:		root
    mailnull:	root
    postgres:	root
    sshd:		root
    smmsp:		root
    postfix:	root
    netdump:	root
    ldap:		root
    squid:		root
    ntp:		root
    mysql:		root
    desktop:	root
    rpcuser:	root
    rpc:		root
    nfsnobody:	root
    
    ingres:		root
    system:		root
    toor:		root
    manager:	root
    dumper:		root
    abuse:		root
    
    # mailman aliases
    mailman:	postmaster
    mailman-owner:	mailman
    
    newsadm:	news
    newsadmin:	news
    usenet:		news
    ftpadm:		ftp
    ftpadmin:	ftp
    ftp-adm:	ftp
    ftp-admin:	ftp
    www:		webmaster
    webmaster:	root
    noc:		root
    security:	root
    hostmaster:	root
    info:		postmaster
    marketing:	postmaster
    sales:		postmaster
    support:	postmaster
    
    
    # trap decode to catch security attacks
    decode:		root
    
    # Person who should get root's mail
    #root:		marc
     
  4. falko

    falko Super Moderator ISPConfig Developer

    The mail log.

    Are you sending emails to any of these users? These mails are all redirected to root because of these entries in /etc/aliases.
     
  5. generalchaos

    generalchaos New Member

    heres what my maillog shows when I do something that requires mail being sent.

    Code:
    Jul 12 12:37:36 localhost postfix/pickup[22519]: A945F250326: uid=502 from=<apache>
    Jul 12 12:37:36 localhost postfix/cleanup[22559]: A945F250326: message-id=<20060712163736.A945F250326@localhost>
    Jul 12 12:37:36 localhost postfix/qmgr[22520]: A945F250326: from=<[email protected]>, size=811, nrcpt=1 (queue active)
    Jul 12 12:37:37 localhost postfix/smtp[22561]: A945F250326: to=<[email protected]>, relay=smtp.comcast.net[216.148.227.147], delay=1, status=bounced (host smtp.comcast.net[216.148.227.147] said: 550 [PERMFAIL] comcast.net requires valid sender domain (in reply to RCPT TO command))
    Jul 12 12:37:37 localhost postfix/cleanup[22559]: 37C9B250328: message-id=<20060712163737.37C9B250328@localhost>
    Jul 12 12:37:37 localhost postfix/qmgr[22520]: 37C9B250328: from=<>, size=2655, nrcpt=1 (queue active)
    Jul 12 12:37:37 localhost postfix/qmgr[22520]: A945F250326: removed
    Jul 12 12:37:37 localhost postfix/local[22563]: 37C9B250328: to=<[email protected]>, orig_to=<[email protected]>, relay=local, delay=0, status=sent (delivered to mailbox)
    Jul 12 12:37:37 localhost postfix/qmgr[22520]: 37C9B250328: removed
    
    So it looks like either something changed with a comcast setup (even though it always worked before) or its not liking the fact that the email is coming from [email protected]lhost ?
     
  6. generalchaos

    generalchaos New Member

    After looking around some more and doing a dnsreport, the problem is the "myhostname = localhost" ...I don't know what to do about this though. If I set the hostname to one of my domains, it will send email fine (however the from field is blank in the email)

    but I have multiple domains.
     
  7. falko

    falko Super Moderator ISPConfig Developer

    You must change

    Code:
    myhostname = localhost
    in /etc/postfix/main.cf. Use a real domain/FQDN here that's on your server. Restart Postfix afterwards.
     
  8. generalchaos

    generalchaos New Member

    well, thats what im doing right now, but im using no-ip for my domains so its not actually on my server.

    It works fine if I email from the domain that I wrote in there, but if i use my other sites the emails come from "(unknown)".
     
  9. falko

    falko Super Moderator ISPConfig Developer

    You can use one of your no-ip domains for myhostname.
     

Share This Page