postfix rewrite headers

Discussion in 'Server Operation' started by leblanc, Nov 14, 2007.

  1. leblanc

    leblanc New Member

    my mail is being rejected from remote smtp servers since they can't verify my domain name enclosed in the mail headers.

    "Sender address rejected: Domain not found "

    heres an envelop:
    PHP:
    -
    X-Original-Tome@mixhacks.com
    Delivered
    -Tome@mixhacks.com
    Date
    Wed14 Nov 2007 00:25:57 -0600
    From
    root <root@linux-server.robust>
    Tome@mixhacks.com
    Subject
    root to me
    User
    -AgentMutt/1.5.16 (2007-06-09)

    since i'm using an account on my box to send email I am getting
    root@`hostname -f`

    i changed my hostname to mixhacks.com but the old hostname must be in the config somewhere.

    postconf | grep robust
    reveals nothing.

    postfix stop
    postfix start
    postfix reload

    doesn't update the hostname attached to root account when mailing.

    1)

    how can i map a user to a specific domain?

    meaning root user sends:
    [email protected]
    me user is sent as:
    [email protected]

    PHP:

    linux
    -server:/var/spool/mail # postconf | grep my
    append_at_myorigin yes
    append_dot_mydomain 
    yes
    lmtp_lhlo_name 
    $myhostname
    local_transport 
    local:$myhostname
    milter_macro_daemon_name 
    $myhostname
    mydestination 
    mail1.mixhacks.commixhacks.comlocalhost
    mydomain 
    mixhacks.com
    myhostname 
    mail1.mixhacks.com
    mynetworks 
    127.0.0.0/[::1]/128
    mynetworks_style 
    subnet
    myorigin 
    mixhacks.com
    parent_domain_matches_subdomains 
    debug_peer_list,fast_flush_domains,mynetworks,permit_mx_backup_networks,qmqpd_authorized_clients,relay_domains,smtpd_access_maps
    proxy_read_maps 
    $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks
    relay_domains 
    $mydestination
    smtp_helo_name 
    $myhostname
    smtpd_banner 
    $myhostname ESMTP $mail_name
    smtpd_client_event_limit_exceptions 
    = ${smtpd_client_connection_limit_exceptions:$mynetworks}
    smtpd_proxy_ehlo $myhostname
    smtpd_recipient_restrictions 
    permit_mynetworks,reject_unauth_destination
     
    Last edited: Nov 14, 2007
  2. falko

    falko Super Moderator ISPConfig Developer

    Which distribution are you using?
     
  3. leblanc

    leblanc New Member

    opensuse 10.3

    I am using opensuse 10.3

    i finally can receive emails from external sources.

    i just haven't figured out how to rewrite the envelop so that it uses a real domain instead of my old hostname.
    until i do that i can't send as i'm seen as a spammer since domain cannot be resolved.


    current configuration
    PHP:
    inet_protocols all
    inet_interfaces 
    all
    biff 
    no
    mail_spool_directory 
    = /var/mail
    masquerade_exceptions 
    root
    masquerade_classes 
    envelope_senderheader_senderheader_recipient
    myhostname 
    mail1.mixhacks.com
    mydestination 
    mail1.mixhacks.commixhacks.comlocalhost
    myorigin 
    mixhacks.com
    program_directory 
    = /usr/lib/postfix
    disable_dns_lookups 
    no
    strict_8bitmime 
    no
    disable_mime_output_conversion 
    no
    smtpd_helo_required 
    no
    smtpd_banner 
    $myhostname ESMTP $mail_name ($mail_version)
    strict_rfc821_envelopes no
    smtp_sasl_auth_enable 
    no
    smtpd_sasl_auth_enable 
    no
    smtpd_use_tls 
    no
    smtp_use_tls 
    no
    alias_maps 
    hash:/etc/aliases
    mailbox_size_limit 
    0
    message_size_limit 
    10240000


    virtual_alias_maps 
    hash:/etc/postfix/hash/valias_maps
    append_at_myorigin 
    yes
    mynetworks_style 
    subnet
    proxy_interfaces 
    mail1.mixhacks.com



    postfix on my system: find / -name postfix
    PHP:

    /var/spool/postfix
    /var/adm/backup/postfix
    /var/adm/SuSEconfig/md5/etc/postfix
    /usr/share/doc/packages/postfix
    /usr/share/SuSEfirewall2/services/postfix
    /usr/sbin/postfix
    /usr/lib/postfix
    /usr/lib/scpm/resource_types/service/get_deps/postfix
    /etc/sysconfig/postfix
    /etc/permissions.d/postfix
    /etc/postfix
    /etc/init.d/postfix
     
    Last edited: Nov 15, 2007
  4. falko

    falko Super Moderator ISPConfig Developer

    You can change the hostname in YaST. Just run
    Code:
    yast
    to start it.
     
  5. leblanc

    leblanc New Member

    yup

    yeah i've already done that.

    but postfix still uses linux-server.robust
    i've grep postconf | grep robust
    and don't see anything.

    i'm thinking the problem is with
    postfix masquerading

    the from address on outbound email keep [email protected]st
    also the email id generated is timestamp.linux-server.robust

    so close but yet so far away.


    today i'm going generate an email from an external client and see if it will rewrite correctly.. to bad i can't fix this locally.

    with all these postfix tutorials.. wished there was just a simple virtual hosting with flat files non db.
     
  6. falko

    falko Super Moderator ISPConfig Developer

    What's the output of
    Code:
    telnet localhost 25
    ?
     
  7. leblanc

    leblanc New Member

    wasted several days

    ha i learned a lot about postfix in these last few days..

    problem was my mutt mail client.

    instead of using a client .. i should have kept it all within postfix:
    #sendmail -v [email protected]
    #sendmail -v [email protected]

    postfix was already setup fine...it doesn't generate
    linux-server.robust


    mutt client has a from field you can set:
    ESC f allows you to edit the from: field
    on per message basis

    you can set it statically in
    vi /home/username/.muttrc
    my_hdr FROM:Leblanc Meneses <[email protected]>
    ... wonder how you add multiple domain support ... [email protected]?

    i still don't know how set the message-id which still appends linux-server.robust

    but at least i know what the real problem is.

    anyways thanks everyone.
     

Share This Page