#61 email attachments not working

closed-fixed
nobody
None
5
2012-01-17
2012-01-13
bertys
No

using latest v3.0-rc6 setting log level to 'files' results in mail errors being sent from my server.
it looks as if it's trying to send the mail to the wrong variable. here's a snippet from the email:

"I'm afraid I wasn't able to deliver your message to the following addresses.
This is a permanent error; I've given up. Sorry it didn't work out.
</home/mysql.backups/daily/mysql/daily_mysql_2012-01-13_12h09m_Friday.sql.gz>:
Recipient unknown"

I've seen the previous bug report with what looks to be the same issue, which says it was fixed in RC1.
either it isn't fixed, i'm doing something wrong, or this is a different bug.

Thanks

Discussion

1 2 3 .. 6 > >> (Page 1 of 6)
  • PittaGurneyi
    PittaGurneyi
    2012-01-13

    Please give me the following information:
    CONFIG_mail_use_uuencoded_attachments=?
    If this is set to yes, please try
    mail -s "My subject" your_email_address < "content"
    If it is set to no, try
    mutt -s "My subject" your_email_address < "content"
    For some reason mail or mutt (my guess is mutt) mistake one of the files for the email address.

     
  • PittaGurneyi
    PittaGurneyi
    2012-01-13

    There is an error: Please replace < "content" with <<< "content"

     
  • PittaGurneyi
    PittaGurneyi
    2012-01-13

    If - as I assume - it's mutt, please take a look at the manpage, i.e. man mutt, and look for the syntax line, i.e.
    mutt [-nx] [-e cmd] [-F file] [-s subj] [-b addr] [-c addr] [-a file [...] --] addr|mailto_url [...] < message
    What does this look like for you?
    Operating system?
    mutt -v for the version would also be helpful.

     
  • bertys
    bertys
    2012-01-13

    syntax from 'man mutt' as follows

    SYNOPSIS
    mutt [-nRyzZ] [-e cmd] [-F file] [-m type] [-f file]

    mutt [-nx] [-e cmd] [-a file] [-F file] [-H file] [-i file] [-s subj] [-b addr]
    [-c addr] addr [...]

    mutt [-n] [-e cmd] [-F file] -p

    mutt -v[v]

    output from 'mutt -v' as follows

    System: Linux 2.6.9-89.31.1.ELsmp (i686) [using ncurses 5.4]
    Compile options:
    -DOMAIN
    -DEBUG
    -HOMESPOOL -USE_SETGID -USE_DOTLOCK -DL_STANDALONE
    +USE_FCNTL -USE_FLOCK
    +USE_POP +USE_IMAP +USE_GSS +USE_SSL +USE_SASL
    +HAVE_REGCOMP -USE_GNU_REGEX
    +HAVE_COLOR +HAVE_START_COLOR +HAVE_TYPEAHEAD +HAVE_BKGDSET
    +HAVE_CURS_SET +HAVE_META +HAVE_RESIZETERM
    +HAVE_PGP -BUFFY_SIZE -EXACT_ADDRESS -SUN_ATTACHMENT
    +ENABLE_NLS -LOCALES_HACK +HAVE_WC_FUNCS +HAVE_LANGINFO_CODESET +HAVE_LANGINFO_YESEXPR
    +HAVE_ICONV -ICONV_NONTRANS +HAVE_GETSID +HAVE_GETADDRINFO
    ISPELL="/usr/bin/ispell"
    SENDMAIL="/usr/sbin/sendmail"
    MAILPATH="/var/mail"
    PKGDATADIR="/usr/share/mutt"
    SYSCONFDIR="/etc"
    EXECSHELL="/bin/sh"
    -MIXMASTER
    To contact the developers, please mail to <mutt-dev@mutt.org>.
    To report a bug, please use the flea(1) utility.

    running on SMEServer 7.5.1 (CentOS 4.8)

    mail -s "My subject" your_email_address <<< "content"
    and
    mutt -s "My subject" your_email_address <<< "content"
    both send email fine

     
  • PittaGurneyi
    PittaGurneyi
    2012-01-13

    Please put
    set -x
    directly before (just make a new line before it)
    case "${CONFIG_mailcontent}" in line 121
    and
    set +x
    directly after
    esac in line 186.
    Then, when you run the script, it will show you how the commands are being executed. Please post the invocation of mail/mutt depending on what appears but you should replace for example your email address - nobody needs to know that. But make sure you don't remove any " " or ' '.

     
  • bertys
    bertys
    2012-01-13

    here's the output from the script after making your adjustments:

    # Checking for permissions to write to folders:
    base folder /home/e-smith/files/users/bertys/home ... exists ... ok.
    backup folder /home/e-smith/files/users/bertys/home/mysql.backups ... exists ... writable? yes. Proceeding.
    + case "${CONFIG_mailcontent}" in
    + [[ -s /home/e-smith/files/users/bertys/home/mysql.backups/ERRORS_localhost-367104000.log ]]
    + backupfiles=("${backupfiles[@]}" "$log_errfile")
    + errornote='WARNING: Error Reported - '
    ++ mktemp /home/e-smith/files/users/bertys/home/mysql.backups/tmp/mail_content.XXXXXX
    + temp=/home/e-smith/files/users/bertys/home/mysql.backups/tmp/mail_content.H17311
    ++ du -c /home/e-smith/files/users/bertys/home/mysql.backups/status/status_daily_2012-01-13_16h41m_Friday.txt.gz /home/e-smith/files/users/bertys/home/mysql.backups/daily /horde/daily_horde_2012-01-13_16h41m_Friday.sql.gz /home/e-smith/files/users/bertys/home/mysql.backups/daily/mysql/daily_mysql_2012-01-13_16h41m_Friday.sql.gz /home/e-smi th/files/users/bertys/home/mysql.backups/daily/sme7admin/daily_sme7admin_2012-01-13_16h41m_Friday.sql.gz /home/e-smith/files/users/bertys/home/mysql.backups/daily/ul2db/d aily_ul2db_2012-01-13_16h41m_Friday.sql.gz /home/e-smith/files/users/bertys/home/mysql.backups/daily/work_db/daily_work_db_2012-01-13_16h41m_Friday.sql. gz /home/e-smith/files/users/bertys/home/mysql.backups/ERRORS_localhost-367104000.log
    ++ awk 'END {print $1}'
    + attsize=620
    + (( 4000 >= 620 ))
    + [[ xno = \x\y\e\s ]]
    + mutt -s 'WARNING: Error Reported - MySQL Backup Log and SQL Files for ulserv - 2012-01-13_16h41m' -a /home/e-smith/files/users/bertys/home/mysql.backups/status/status_ daily_2012-01-13_16h41m_Friday.txt.gz /home/e-smith/files/users/bertys/home/mysql.backups/daily/horde/daily_horde_2012-01-13_16h41m_Friday.sql.gz /home/e-smith/files/user s/bertys/home/mysql.backups/daily/mysql/daily_mysql_2012-01-13_16h41m_Friday.sql.gz /home/e-smith/files/users/bertys/home/mysql.backups/daily/sme7admin/daily_sme7admin_20 12-01-13_16h41m_Friday.sql.gz /home/e-smith/files/users/bertys/home/mysql.backups/daily/ul2db/daily_ul2db_2012-01-13_16h41m_Friday.sql.gz /home/e-smith/files/users/bertys /home/mysql.backups/daily/work_db/daily_work_db_2012-01-13_16h41m_Friday.sql.gz /home/e-smith/files/users/bertys/home/mysql.backups/ERRORS_localhost-367 104000.log -- admin@work.com
    + rm /home/e-smith/files/users/bertys/home/mysql.backups/tmp/mail_content.H17311
    + set +x

     
  • PittaGurneyi
    PittaGurneyi
    2012-01-13

    Now take a look at /home/e-smith/files/users/bertys/home/mysql.backups/ERRORS_localhost-367
    104000.log please (if it is still there) and post the content.
    furthermore please try
    mutt -s "My subject" -a select_a_file_1 select_a_file_2 -- your_email_address <<< "content"
    If this fails try
    mutt -s "My subject" -a select_a_file_1 -a select_a_file_2 your_email_address <<< "content"

     
  • PittaGurneyi
    PittaGurneyi
    2012-01-13

    I guess the error log isn't there, so please make another adjustment:
    [[ -e "$log_file" ]] && rm -f "$log_file"
    [[ -e "$log_errfile" ]] && rm -f "$log_errfile"
    put a # in front of both lines. This will prevent the rm command from being executed.
    Just rerun the script and the error log will remain.

     
  • bertys
    bertys
    2012-01-13

    error log contains the following:

    du: WARNING: use --si, not -H; the meaning of the -H option will soon
    change to be the same as that of --dereference-args (-D)
    /usr/bin/find: line 1: ELF: command not found

    first part has been explained in previous bug reports, last line appeard recently, not sure why. email attach problem existed before I saw that error so i'm sure it's not related

     
  • bertys
    bertys
    2012-01-13

    as per your suggestion...

    mutt -s "My subject" -a select_a_file_1 select_a_file_2 -- your_email_address <<< "content"
    FAILS
    seems multiple attachments require their own '-a'. once I added -a before the second file it worked

     
1 2 3 .. 6 > >> (Page 1 of 6)